You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PlatformException(authorize_and_exchange_code_failed, Failed to authorize: [error: null, description: Invalid ID Token], ID Token expired, null) on authorize_and_exchange
#510
Closed
Wwwolfgang opened this issue
Jul 26, 2024
· 1 comment
I made this issue so that other people can find it. The problem in my case was, that on the phone the Time was not set to automatic and was set manually. For that reason the Id Token seemed to be expired.
So if you experience this problem, check your time settings.
await _appAuth.authorizeAndExchangeCode(AuthorizationTokenRequest( const String.fromEnvironment("CLIENT_ID"), const String.fromEnvironment("CALLBACK_URL_SCHEME"), serviceConfiguration: AuthorizationServiceConfiguration( authorizationEndpoint: Uri.https( const String.fromEnvironment("ISSUER"), '/api/oidc/authorize') .toString(), tokenEndpoint: Uri.https(const String.fromEnvironment("ISSUER"), '/api/oidc/token') .toString(), endSessionEndpoint: Uri.https( const String.fromEnvironment("ISSUER"), '/api/oidc/endsession') .toString(), ), scopes: ['openid', 'all_scopes', 'offline_access', 'profile'], preferEphemeralSession: true, loginHint: userId, promptValues: ['login'], allowInsecureConnections: true, discoveryUrl: const String.fromEnvironment("DISCOVERY_URL"), ))
It works on almost any phone(Android), but when I tried it on an old Huawei phone with Android 9 I get this error:
PlatformException(authorize_and_exchange_code_failed, Failed to authorize: [error: null, description: Invalid ID Token], ID Token expired, null)
If anyone knows what I could do, please tell me. I don't want to write all the logic myself but apparently I have to.
Originally posted by @Wwwolfgang in #486 (comment)
The text was updated successfully, but these errors were encountered: