capacitor-community / generic-oauth2

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

Feat: Supabase Oauth Example #187

Closed maxcodefaster closed 2 years ago

maxcodefaster commented 2 years ago

Describe the Feature

Example of how to use with supabase oauth.

Platform(s) Support Requested

Describe Preferred Solution

A code example on how to use capacitor oauth plugin with supabase oauth.

Describe Alternatives

Related Code

See React Native example https://supabase.com/docs/reference/javascript/auth-signin#sign-in-using-a-refresh-token-eg-in-react-native

Additional Context

moberwasserlechner commented 2 years ago

This is not a feature/docs update I will provide as it is normally done by the project's developer (like yourself) or by someone consulting on this.

maxcodefaster commented 2 years ago

The problem using this plugin with supabase is, that the plugin requires a state, but state is all handeled internally in supabase (supabase <-> oauth providers). So therefore the auth request always fails with the plugin. I saw that you removed the "disabelState" variable many commits ago. Any chance to override this without creating a new fork, or if I have to fork which way would be the easiest to disable the state checks? Thank you

moberwasserlechner commented 2 years ago

If supabase is no oauth provider this plugin is not the right choice for it.

I you really want to do this in a fork you simply need to remove the auto generation of the state parameter for every platform.

moberwasserlechner commented 2 years ago

I'm closing this as Supabase is apparently no OAuth Provider so it is out of scope to support that.