Send offline access to google with Auth0-React

Hi there,

I’m working with Auth0-react library using the Auth0Provider component and I need to get the refresh tokens.
After reading this post Store and retrieve Google Refresh token - #4 by mathiasconradt I successfully did most of the things mentions except this one:

In order to make Auth0 get a refresh token in the first place, your SPA needs to make the authorize request with the parameters:

access_type: "offline"

as well as the respective audience to the authorize request, such as:

connection_scope: "https://www.googleapis.com/auth/calendar.events.readonly"

Example here: Can’t get google refresh token using auth0.js - #2 by vinicius.spagnol

How can I do that using the mentioned component?

Thanks

Hi @pablo.pascual,

It looks like it’s laid out fairly directly in the post you linked. Is there a specific part you are struggling with?

Yes, the post example is done using another library I don’t know how this can be achieved using auth0-react library GitHub - auth0/auth0-react: Auth0 SDK for React Single Page Applications (SPA)

How can I send:
access_type: “offline” and connection_scope: “https://www.googleapis.com/auth/calendar.events.readonly

to Google /authentication url using the auth0-react library and SPA.

@dan.woda

Thanks for the clarification!

I think you should be able those params directly to the loginWithRedirect() function.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.