-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
acquireToken returns v1 token #7
Comments
Are you using different request scopes when acquiring a token manually? The original request scope (used on login) is set in the request options. You can set a different request scope when calling acquireToken manually by passing it as a function argument. If you have different scopes for these two calls then the two tokens would not match. Regarding the difference in versions, quoting this line from the relevant section of the official documentation, should answer your question:
|
Thanks @mvertopoulos for the quick reply. But any acquireToken calls witht he same scopes as the initial login, return a v1 token |
I am reopening this issue to do some further research and I will get back to you. |
i've created a new scope for my frontend application to use. and it seems to work now. the issued token for this new scope is a v2 token. I'm not entirely sure how the tokens are issued. According to the issue from msal, a access token is issued for each resource. |
msal gives a token that can be validated. msGraph gives a token that cannot. If you call However if you call My issues became that I was unable to authenticate to my api for more than an hour, and was quite frustrating... My solution was as follows.
I would have used lib.store to get my msal.idtoken, but the developer saw fit to hide everything from access... This solution works for me to use idToken for my personal api calls, and $msal.msGraph calls still function. |
not sure if it's related to this library.
basically after login, the access token is a v2 token.
after calling acquireToken manually, the response contains a v1 token.
AzureAD/microsoft-authentication-library-for-js#1040
The text was updated successfully, but these errors were encountered: