Get Google Scopes
Based on this: https://developers.google.com/identity/protocols/oauth2/native-app#check-granted-scopes, Google should return a "scope" field on the response to indicate which permissions the user allowed.
Is there a way to receive this info after delegating the auth process through Supabase?
Google for Developers
OAuth 2.0 for iOS & Desktop Apps | Google for Developers
8 Replies
hmm, do you see any entries in auth.oauth_clients table. There is is a grant_types column which might be relevant.
There are no entries in that table
Okay i think what is happening here is you have used the implicit flow to delegate signing up with oauth with google but you actually need to follow the pkce flow in your case as you actually probably want to interact with google services and get things like scope so it might make more sense to do the exchange of code for tokens server side where you will also get the scopes back (hopefully) https://supabase.com/docs/guides/auth/sessions/pkce-flow
PKCE flow | Supabase Docs
About authenticating with PKCE flow.
I do use the PKCE flow.
I set flowType to "pkce".
I call:
Then on my register handler, I get code from the query parameters and call:
Ahh okay
I guess I can verify the scopes by calling the Google APIs and checking the status
It's a weird workaround though when using Supabase
yeah i think that might be the best option, this might not be all that common for pkce i.e custom selection of roles. Most providers have that 'all or nothing' approach so it might be that the level of abstraction done by is only focused on access/refresh token