capacitor-community / generic-oauth2

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

Google OAuth 2 on Android #194

Open emmernme opened 2 years ago

emmernme commented 2 years ago

Hey! Great plugin, haven't had any issues on iOS. However, OAuth on Android seems to open in an in app browser, which Google has disallowed since 2017. This makes Google mad, presenting a 403: disallowed_useragent error. Trying to configure the Android Capacitor useragent to another useragent made no change.

I have so far only tested this on the simulator in Android Studio, so I figured I would ask if this is an expected issue and if there is a way to for example force the plugin to open the user interface in the default browser or elsewhere, which Google would accept?

confuzeus commented 1 year ago

Looks like you need to provide your own custom handler for that.

I decided to use https://www.npmjs.com/package/@codetrix-studio/capacitor-google-auth instead for google auth on Android.