Category
Version
Please specify what version of the library you are using: [ 1.0.3 ]
Expected / Desired Behavior / Question
Running the getPaged method, then getNext will throw a [403] Forbidden when using ADAL (custom Authorization header).
I suspect it could be because headers are not copied over in getNext.
Steps to Reproduce
This is my demo-code
const pnp = require('@pnp/sp');
const fetch = require('node-fetch');
const settings = require('./settings.json');
global.fetch = fetch;
global.Request = fetch.Request;
global.Headers = fetch.Headers;
(async () => {
const sp = pnp.sp.configure({
headers: {
Authorization: `Bearer ${settings.token}`
}
}, settings.url);
let page = await sp.web.getList(settings.list).items.select('Id').getPaged();
// This throws a 403
await page.getNext();
})();
settings.json has the token hard coded (for testing purposes), a (absolute) URL to the SharePoint Online SPWeb and a server relative URL to a list.
Note, this also affects getAll, since this method uses getPaged.
Category
Version
Please specify what version of the library you are using: [ 1.0.3 ]
Expected / Desired Behavior / Question
Running the
getPagedmethod, thengetNextwill throw a [403] Forbidden when using ADAL (customAuthorizationheader).I suspect it could be because headers are not copied over in getNext.
Steps to Reproduce
This is my demo-code
settings.jsonhas the token hard coded (for testing purposes), a (absolute) URL to the SharePoint Online SPWeb and a server relative URL to a list.Note, this also affects
getAll, since this method usesgetPaged.