# Google workspace invalid scopes error

**URL:** <https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [July 31, 2023, 4:53pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504 "2023-07-31T16:53:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiwi](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Kiwi](https://community.auth0.com/u/Kiwi)\
**Post date:** [July 31, 2023, 4:53pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504/1 "2023-07-31T16:53:45Z")

</div>

I’ve been trying to connect my google workspace account with Auth0.

filled in the client\_id and secret properly, also managed to create a connection on postman. Received the access token there and managed to call the calender api endpoint from google. On postman it all worked.

When trying to login through Auth0 with my google workspace on my webapp, I get the following error message:

```auto

Some requested scopes were invalid. 
{valid=[https://www.googleapis.com/auth/userinfo.email, 
 https://www.googleapis.com/auth/userinfo.profile], invalid=[offline_access]}
  
[Learn more about this error]
(https://developers.google.com/identity/protocols/oauth2)
If you are a developer of CompanyX, 
see [error details](https://accounts.google.com/).

```

Error 400: invalid\_scope

I Don’t understand why it works on postman and not on Auth0, any help is appreciated!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 31, 2023, 8:29pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504/3 "2023-07-31T20:29:49Z")

</div>

Hey there @Kiwi !

I don’t think the `offline_access` scope is needed for a Google connection - According to the docs [here](https://auth0.com/docs/secure/tokens/access-tokens/identity-provider-access-tokens#renew-third-party-tokens) you’ll want to pass `access_type=offline` instead to get a refresh token.

Keep us posted!

---

<div class="post-metadata">

**Author:** ![Kiwi](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Kiwi](https://community.auth0.com/u/Kiwi)\
**Post date:** [July 31, 2023, 8:56pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504/4 "2023-07-31T20:56:48Z")

</div>

Hey @ty.frith,

Thanks for your quick reply!  
It is what makes me confused, since I am using the google workspace enterprise connection within my auth0 tenant. I’m not passing anything to get the google access token, Auth0 is doing this under the hood if I’m correct.  
I’m just filling in my google workspace client\_id and secret, which are correct (if I enter the wrong credentials I get a different error message).

When logging in in my webapp, I get the universal login screen. But when I actually log in with a users password and email through the connection, the error pops up.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 31, 2023, 9:37pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504/5 "2023-07-31T21:37:35Z")

</div>

No problem, happy to help!

> [@Kiwi](#):
>
> When logging in in my webapp, I get the universal login screen. But when I actually log in with a users password and email through the connection, the error pops up.

How are you initiating the login flow (call to `/authorize` which brings up universal login) in your app? Are you using an SDK? Does the enterprise connection you’ve configured work if you [test it](https://auth0.com/docs/authenticate/identity-providers/enterprise-identity-providers/test-enterprise-connections) from within your Auth0 tenant directly?

Because it works in Postman, my guess is that the `offline_access` scope is being passed wherever the initial authorize request is being configured/initiated.

Keep us posted!

---

<div class="post-metadata">

**Author:** ![Kiwi](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Kiwi](https://community.auth0.com/u/Kiwi)\
**Post date:** [July 31, 2023, 10:01pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504/6 "2023-07-31T22:01:08Z")

</div>

Aha, I get what you mean. Didn’t think about how I was initiating the login function. I have been having a MS AAD registered with the app for a while.

It looks like I would need to pass the offline\_access scope for MS AAD access but not for the google workspace access!

Removed the scopes from the authorized function and now it works, thanks for your support!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 31, 2023, 10:03pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504/7 "2023-07-31T22:03:53Z")

</div>

Awesome, good news! Thanks for follow up here 🙂

---

<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:** [August 14, 2023, 10:04pm UTC](https://community.auth0.com/t/google-workspace-invalid-scopes-error/112504/8 "2023-08-14T22:04:32Z")

</div>

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