Description
I am using certificate based login with O365 CLI. Below command to add new modern site fails with following error.
Command:
spo site add --alias t1 --title t1
After looking at the code, I observed its using undocumented endpoint (_api/GroupSiteManager/CreateGroupEx). The code needs to be updated to use the Site Manager api (https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest)
Error:
Error: {"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"07133caf-496f-4b6d-9c6b-27bb4bd7379e","date":"2020-07-24T22:22:04"}}
Steps to reproduce
Login using cert to get app-only token.
Example:
login --authType certificate --certificateFile C:\OpenSSL\bin\protected.pfx --thumbprint XYZ --password pass@word1
Run below command:
spo site add --alias t1 --title t1
Expected result
Creates the modern site.
Actual result
Error:
Error: {"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"07133caf-496f-4b6d-9c6b-27bb4bd7379e","date":"2020-07-24T22:22:04"}}
Environment
OS: Windows 10 v1909
PS: ver 5.1.18362.752
O365 CLI: 2.12.0
Description
I am using certificate based login with O365 CLI. Below command to add new modern site fails with following error.
Command:
spo site add --alias t1 --title t1
After looking at the code, I observed its using undocumented endpoint (_api/GroupSiteManager/CreateGroupEx). The code needs to be updated to use the Site Manager api (https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest)
Error:
Error: {"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"07133caf-496f-4b6d-9c6b-27bb4bd7379e","date":"2020-07-24T22:22:04"}}
Steps to reproduce
Login using cert to get app-only token.
Example:
login --authType certificate --certificateFile C:\OpenSSL\bin\protected.pfx --thumbprint XYZ --password pass@word1
Run below command:
spo site add --alias t1 --title t1
Expected result
Creates the modern site.
Actual result
Error:
Error: {"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"07133caf-496f-4b6d-9c6b-27bb4bd7379e","date":"2020-07-24T22:22:04"}}
Environment
OS: Windows 10 v1909
PS: ver 5.1.18362.752
O365 CLI: 2.12.0