# Send offline access to google with Auth0-React

**URL:** <https://community.auth0.com/t/send-offline-access-to-google-with-auth0-react/96175>\
**Category:** Get Help\
**Tags:** google-social-connection, connections\
**Created:** [December 10, 2022, 2:36pm UTC](https://community.auth0.com/t/send-offline-access-to-google-with-auth0-react/96175 "2022-12-10T14:36:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablo.pascual](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pablo.pascual/32/41859_2.png) [@pablo.pascual](https://community.auth0.com/u/pablo.pascual)\
**Post date:** [December 10, 2022, 2:36pm UTC](https://community.auth0.com/t/send-offline-access-to-google-with-auth0-react/96175/1 "2022-12-10T14:36:12Z")

</div>

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](https://community.auth0.com/t/store-and-retrieve-google-refresh-token/28973/4) 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](http://community.auth0.com/t/cant-get-google-refresh-token-using-auth0-js/11756/2)

How can I do that using the mentioned component?

Thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 12, 2022, 3:52pm UTC](https://community.auth0.com/t/send-offline-access-to-google-with-auth0-react/96175/3 "2022-12-12T15:52:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pablo.pascual](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pablo.pascual/32/41859_2.png) [@pablo.pascual](https://community.auth0.com/u/pablo.pascual)\
**Post date:** [December 12, 2022, 4:01pm UTC](https://community.auth0.com/t/send-offline-access-to-google-with-auth0-react/96175/4 "2022-12-12T16:01:42Z")

</div>

> [@dan.woda](#):
>
> 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)](https://github.com/auth0/auth0-react)

How can I send:  
access\_type: “offline” and connection\_scope: “[https://www.googleapis.com/auth/calendar.events.readonly](https://www.googleapis.com/auth/calendar.events.readonly)”

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

@dan.woda

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 12, 2022, 5:49pm UTC](https://community.auth0.com/t/send-offline-access-to-google-with-auth0-react/96175/5 "2022-12-12T17:49:26Z")

</div>

Thanks for the clarification!

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 30, 2023, 9:41pm UTC](https://community.auth0.com/t/send-offline-access-to-google-with-auth0-react/96175/7 "2023-01-30T21:41:49Z")

</div>

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