Refresh token is always undefined #322
Comments
'offline_access' scope is required to obtain a refresh token. Please add it in the scope in creds and try again. Also please upgrade to version 3.0.7. |
@lovemaths is it possible to get refresh_token for v1 or not really? Is offline_access available only in v2? |
Also is it possible to switch app registration from using v1 endpoints to v2 endpoints? Or specify for new app registration that it should use v2 endpoints. Thank you. |
@szarouski Please see below: (1) To specify the resource, for v1 we use (2) v1 is supposed to give you both access token and refresh token when you ask for an access token. For v2 you need to explicitly use I don't quite understand your app registration question, could you give more details what you want to achieve? |
@lovemaths thanks for your reply. For v1 I don't get a new refresh token when I renew access token (similar problem to following: https://stackoverflow.com/questions/35308425/not-able-to-get-new-refresh-token-from-azure-ad-with-grant-type-refresh-token-ca/) - I wonder if that might be due to AD configuration? (I'm just a dev, don't have access to it). However I get new refresh token with v2 endpoint with offline_access when I'm renewing access token (which is weird, why I can for v2, but can't for v1). Another thing that I found is that it is possible to keep getting access token via authorization call with client_credentials & it doesn't seem to expire, I wonder it that is a valid approach? For app registration I'm wondering if it is possible to use azure portal to create registration with v2 endpoint support. At the moment it seems that I had to use |
@szarouski It seems I can always get refresh token when I renew access token with v1. I am not sure what went wrong, I am asking around to see if anyone might know the answer. v1 and v2 are two separated endpoints and the usage are very different, so it is normal that the behavior are different. You can always call For v2 app registration you have to go to apps.dev.microsoft.com, it cannot be done on azure portal. |
@lovemaths thanks for looking at that. Here is how things are setup, maybe it will shed some light. |
I encountered a similar problem where I couldn't get a refresh token with V2. I solved this with the following config:
|
@MarkHerhold - thanks for this! I've spent the last 4 hours trying different combinations and this worked for me to get a refresh token. Didn't need the clientSecret however. |
I'm trying to get a refresh token using this Passport strategy, but for some reason I can't make it work. I've tried de-authorizing the app several times (I know a refresh token is only granted on the first auth), but it doesn't seem to make a difference.
I'm on version
3.0.6
.The Code
I suspect that this might be a usage issue by me, but I'm out of places to ask for help. Perhaps I have a configuration parameter wrong on https://apps.dev.microsoft.com?
The text was updated successfully, but these errors were encountered: