Is it possible to get the access token response using the OAuth2 User-Agent Flow method with Google API

I use the OAuth2 User-Agent Flow method to authenticate Google users.

The authentication process works fine.

But I need to know if the users has granted the scopes so the app can perform correctly.

The information is given by Google in the access token response.

Is there any way to get this response with OAuth2 User-Agent Flow?

Try this endpoint
https://www.googleapis.com/oauth2/v1/tokeninfo

1 Like

Thanks Jici for your feedback!

(I reply lately because I just came back from my paternity leave)

Do you have any additional ressources from Google on how I can use this endpoint ?

It seems I need to use the acess token as a parameter but Bubble’s OAuth2 User-Agent Flow method doesn’t seem to give access to it

If you have set user-agent flow, Bubble handle the access token for you.
Just add new api endpoint with this url
Don’t forget that API Connector will not keep your connection alive. You will need to signup in debug mode again to be able to initialize new call.

1 Like

Many thanks, for your very quick response!

I test it right now then.

I confirmed that it works pretty well, thanks a lot @Jici !

1 Like

what happens when i want to renew a token? Is this handled automatically by the oauth user-agent flow?

Bubble user-agent flow will do the refresh token itself when needed

awesome, will validate

Does bubble user-agent flow refresh the token after x days (or however long the token is valid for)…

after a few days it seems to unauthorise again…but haven’t nailed exactly why

Do you mean in API connector? Bubble doesn’t refresh this one. Only for users authenticated with this flow, but not if you did it in debug mode and the auth is expired in API connector. At this moment, the access token will be used for API connector so you can add calls.