Authenticationmanager does not refresh the access token

393
1
03-20-2023 04:17 AM
GhefarMansour
New Contributor

I use the TokenAuthenticationType "Code" and expected a "silent token refresh", but does not worked for me.
The URL is a "ArcGIS Portal" where i already registered my app. 
Hier is how I generate the tokens:

public static async Task<Credential> PromptCredentialAsync(CredentialRequestInfo info)

{

var credential = await AuthenticationManager.Current.GenerateCredentialAsync(
info.ServiceUri,
new GenerateTokenOptions()
{
TokenAuthenticationType = TokenAuthenticationType.OAuthAuthorizationCode,
TokenExpirationInterval = TimeSpan.FromMinutes(10) // Just as an example - the default is 30 minutes
});

...

 

After teh token hast been expired, the user has to authenticate again (user/password), what I want to be avoided. Any one knows abou that?

Thanks a lot.

 

0 Kudos
1 Reply
GhefarMansour
New Contributor

According to my experience with OAuth2, choosing the OAuthAuthorizationCode should refresh the access token silently/automatically (that is what I need). - Only with OAuthAuthorizationImplicit would mean that the user must authenticate again.

0 Kudos