OAuth token scope for tenant template #623
Replies: 2 comments 3 replies
-
Hi @joelfmrodrigues, |
Beta Was this translation helpful? Give feedback.
-
Hi @magnusjak, I never ended up resolving the issue with Invoke-PnPTenantTemplate as shortly after facing this issue, the project requirements changed and I no longer needed to use that command, but I can use the access tokens with the other commands and all works fine. I just need to ensure that I always use the access token with the right scope for the command I need to execute. $SCOPE_SP = "offline_access https://$SPOTenantName.sharepoint.com/.default"
$SCOPE_SP_ADMIN = "offline_access https://$SPOTenantName-admin.sharepoint.com/.default"
$SCOPE_GRAPH = "offline_access https://graph.microsoft.com/.default" URLs for the requests: $authorizeRequestUri = "https://login.microsoftonline.com/$SPOTenantId/oauth2/v2.0/authorize"
$tokenRequestUri = "https://login.microsoftonline.com/$SPOTenantId/oauth2/v2.0/token" |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Working on a project with many environment limitations where we were forced by the client policies to handle OAuth2 refresh tokens when connecting with PnP PowerShell. The refresh token is initially generated outside of our Function.
In summary:
Connect-PnPOnline -Url $SiteUrl -AccessToken $AccessToken
for operations.I tried with two tokens where the scope was SharePoint and Graph and this is working well. I can use the access token for SharePoint to execute SharePoint operations and the Graph token for Graph operations.
But I am now facing a problem that I don't know how to address, but hope this is a simple question:
My script now needs to apply a tenant template with
Invoke-PnPTenantTemplate -Path "$templateFilePath" -Parameters $templateParameters
that will provision a SharePoint site and a Teams team. But I don't know what the scope of my access token needs to be in order to support SharePoint and Teams provisioning.What should be the scope of my access token that I use with
ConnectPnPOnline
in order to provision SharePoint and Teams with a single tenant template?Beta Was this translation helpful? Give feedback.
All reactions