Reputation: 215
I wrote a console ASP.NET app to acquire accesstokens. I have clientId,client secret of my app and i do the following:
var authContext = new AuthenticationContext("https://login.windows.net/common/oauth2/authorize"); var acquireTask = authContext.AcquireTokenAsync(Resource, new ClientCredential(clientId,ClientSecret), new Uri(RedirectUri), new PlatformParameters(PromptBehavior.Auto));
This doesnot return the refreshToken. How can i get the refresh token. Seems like none of the overloaded methods namely AcquireTokenAsync return the refreshtokens. I tried using one with client credentials as well.
What's the correct procedure. None of the ADAl docs talk about this.
Upvotes: 0
Views: 317
Reputation: 936
The refresh Token were removed from ADAL v3.x onwards and ADAL caches refresh token and automatically uses it whenever AcquireToken method is called or requested token needs renewing. The ADAL version 2.x used to have the refresh token in the AuthenticationResults. Please refer to the blog for more details.
Upvotes: 1