This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
[BUG] When applying provisioning template using a ClientContext created for a Federated tenant, an 'access denied' exception is thrown #2786
Labels
Environment
[*] Office 365 / SharePoint Online
Expected or Desired Behavior
I've created a template with a single client side page that I want to apply to a web.
Observed Behavior
The ClientSidePage 'stub' is created but the actual template is not applied. The provisioning engine throws an 'access denied' error.
The reason for this is that the tenant uses Federation, which means that no explicit credentials are supplied nor can an access token be retrieved from the authentication header (which is how PnP normally calls API's not covered by 'regular' CSOM).
This scenario can can be covered by also 'copying' the Federation authorization cookies (present in the clientcontext) to the HttpClientHandlers for the API requests.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: