Closed steve1607 closed 6 years ago
Your code is getting an id_token and using it in a call to Graph, which expects an access token. Graph is rejecting it because it's the wrong kind of token, and for the wrong resource. To modify the sample so that it gets an access token to a resource:
Provide the resource id to getCachedToken
authContext.getCachedToken("https://graph.microsoft.com")
Call _renewToken instead of _renewIdToken
authContext._renewToken("https://graph.microsoft.com", function(err, accessToken) { ... })
You are my hero! Thanks for your help and sorry for seeing the error on your side.
I installed the sample and everything works fine. I wanted to use the token from the "silent"-authentication sample in a graph call, so I copied the ajax call from the simple.hbs into silent.hbs and called it after token validation.
This is my code in silent.hbs:
As you can see, I only copied and pasted the code in line 168-190 and called it in 205.
This is the result:
Some tests have shown, that the token in local storage remains the same, even after logging in and out of Teams or deleting all browser history and caches.
Any ideas, what to do to resolve this issue? As we can only submit our app with working silent authentication and we can't get it working we are quite helpless.