You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
Please specify what version of the library you are using: [2.0.5]
Expected / Desired Behavior / Question
I want to be able to make non GET requests (modifying requests like POST, PUT, PATCH) to a SharePoint instance while not being on the SharePoint site when sending the request.
Observed Behavior
As the DigestCache doesn't apply the headers supplied in pnp.setup() where the Authorization headers are normally added, you get a 403 response anytime the digest is requested because you're doing a modyfying request.
Steps to Reproduce
Use pnp from an external web application that is on a different domain, and then do any modyfying request.
Inside the digestcache.ts file it uses the HttpClient.fetchRaw() method which doesn't apply any headers from the configuration object. Also the headers from the configuration are not explicitly added to the request. It should be possible to solve the issue by simply applying all headers from the configuration inside digestcache.ts
The text was updated successfully, but these errors were encountered:
In the scenario of passing an access token to access SharePoint endpoints, the step to get the request digest is not needed, so should be skipped if the token is present in the request header.
Ok, I see your point @garrytrinder . This means that there actually are 2 separate problems:
The headers are not added to the digest request.
The digest request should not be sent in the first place if the Authorization header is present (but it is).
You also want to be able to send other headers than the Authorization header which the also should be included in the digest request. For the purpose of separation of concerns I would suggest to have a separate issue and pull request for the 2nd problem.
Category
[ ] Enhancement
[x] Bug
[ ] Question
Version
Please specify what version of the library you are using: [2.0.5]
Expected / Desired Behavior / Question
I want to be able to make non GET requests (modifying requests like POST, PUT, PATCH) to a SharePoint instance while not being on the SharePoint site when sending the request.
Observed Behavior
As the DigestCache doesn't apply the headers supplied in
pnp.setup()
where the Authorization headers are normally added, you get a 403 response anytime the digest is requested because you're doing a modyfying request.Steps to Reproduce
Use pnp from an external web application that is on a different domain, and then do any modyfying request.
Inside the digestcache.ts file it uses the
HttpClient.fetchRaw()
method which doesn't apply any headers from the configuration object. Also the headers from the configuration are not explicitly added to the request. It should be possible to solve the issue by simply applying all headers from the configuration inside digestcache.tsThe text was updated successfully, but these errors were encountered: