Skip to content
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

Open
oppie85 opened this issue Oct 6, 2020 · 1 comment

Comments

@oppie85
Copy link

oppie85 commented Oct 6, 2020

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

  • Create a template with one ClientSide page that contains a couple of webparts
  • Apply to a tenant that uses Federation using a ClientContext created by weblogon.
@ghost
Copy link

ghost commented Oct 6, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Oct 6, 2020
oppie85 added a commit to oppie85/PnP-Sites-Core that referenced this issue Oct 6, 2020
Pass cookiecontainer to HttpClientHandler to support  provisioning client sage pages on tenant sith Federated authentication login
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant