capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!
MIT License
234 stars 115 forks source link

Bug: id_token on Android fail #272

Open EduarPer opened 2 months ago

EduarPer commented 2 months ago

Capacitor version:

Run npx cap doctor:

@capacitor/android: 6.1.2 @capacitor/cli: 6.1.0 @capacitor/core: 6.1.0

Library version:

OAuth Provider:

Your Plugin Configuration

{
    // Replace this with your plugin configuration
}

Affected Platform(s):

Current Behavior

When execute logout method on angular the parameter id_token is not available on Java class "GenericOAuth2Plugin" on Android Studio and the always enter on the if statement

String idToken = ConfigUtils.getParam(String.class, call.getData(), PARAM_ID_TOKEN); if (idToken == null) { this.disposeAuthService(); this.discardAuthState(); call.resolve(); return; }

zolakt commented 1 month ago

There is something definitely missing with this logout support.

You can get around the id_token issue by adding it manually to the config object, but then you will hit another issue where it doesn't parse the logoutUrl.

It has been reported here https://github.com/capacitor-community/generic-oauth2/pull/233#issuecomment-1542479281 over a year ago. So I wonder if this lib is even maintained anymore?

Btw. for web and Android, this is the only logout approach that worked for me https://github.com/capacitor-community/generic-oauth2/issues/97#issuecomment-2178188975. Haven't tested iOS yet