Microsoft graph throws the below exception when initializing the client using the access token
the access token was generated just before initializing the client & also the same token works in post-man
what is that I'm doing wrong?
code ๐๐
let graphClient = graph.Client.init({
// Use the provided access token to authenticate
// requests
authProvider: (done) => {
done(null, accessToken);
}
});
Post-man response ๐๐
Quoting the install guide:
import @microsoft/microsoft-graph-client into your module and also you will need polyfills for fetch like isomorphic-fetch.
Here is what you need to do.
npm install isomorphic-fetch
import "isomorphic-fetch"; OR require('isomorphic-fetch');