openid / AppAuth-Android

Android client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
https://openid.github.io/AppAuth-Android
Apache License 2.0
2.82k stars 881 forks source link

Get Expired token when Using " performActionWithFreshTokens " to refresh token #935

Open MarkMagdyHelm opened 1 year ago

MarkMagdyHelm commented 1 year ago

On latest version

implementation 'net.openid:appauth:0.11.1'

Part of the Code

currentState?.performActionWithFreshTokens(authService, clientAuth, AuthStateAction { accessToken, idToken, ex -> if (ex != null) { when (ex.code) { 2002 -> { doAuthorization(devicePersistenceManager, context, authService) } }

Issue description

After checking the expiration date of the current token and found it expired ,after that i tried to get new valid token from the sdk by using performActionWithFreshTokens as the above code the sdk sometimes returns expired token on the successful callback with expired date

deepakkanyan commented 5 months ago

facing same.

siddheshpalkar2 commented 2 weeks ago

Ensure you set the setPrompt() method to AuthorizationRequest.Builder()