# Sample auth settings for google oauth

**URL:** <https://talk.getindico.io/t/sample-auth-settings-for-google-oauth/2251>\
**Category:** General Discussion\
**Created:** [May 22, 2021, 8:42pm UTC](https://talk.getindico.io/t/sample-auth-settings-for-google-oauth/2251 "2021-05-22T20:42:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed\_Al-Shammaa](https://talk.getindico.io/user_avatar/talk.getindico.io/mohammed_al-shammaa/32/756_2.png) [@Mohammed\_Al-Shammaa](https://talk.getindico.io/u/Mohammed_Al-Shammaa)\
**Post date:** [May 22, 2021, 8:42pm UTC](https://talk.getindico.io/t/sample-auth-settings-for-google-oauth/2251/1 "2021-05-22T20:42:21Z")

</div>

I would like to enable signing in with google workspace accounts (institutional accounts). The only topic that discuss this is this topic:

> [@LDAP and Google auth](https://talk.getindico.io/t/ldap-and-google-auth/679):
>
> I would like to use own ldap auth and also give users to auth via google account. Can you give me hint how to configure it? Thank you very much

and I couldn’t figure out how to make the settings for Google Oauth. Is there a sample settings/steps that can be followed easily to achieve this?

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [May 26, 2021, 2:14pm UTC](https://talk.getindico.io/t/sample-auth-settings-for-google-oauth/2251/2 "2021-05-26T14:14:22Z")

</div>

Google uses OpenID-Connect (OIDC) nowadays: [OpenID Connect &nbsp;|&nbsp; Google Identity &nbsp;|&nbsp; Google Developers](https://developers.google.com/identity/protocols/oauth2/openid-connect)

This should be pretty straightfoward to use with the `authlib` auth/identity provider type:

```python
AUTH_PROVIDERS = {
    'google': {
        'type': 'authlib',
        'title': 'Google',
        'authlib_args': {
            'client_id': 'xxx',
            'client_secret': 'xxx',
            'server_metadata_url': 'https://accounts.google.com/.well-known/openid-configuration',
            'client_kwargs': {'scope': 'openid profile email'}
        },
        'callback_uri': '/authlib/google',
        'use_id_token': True,
    },
}

IDENTITY_PROVIDERS = {
    'google': {
        'type': 'authlib',
        'title': 'Google',
        'mapping': {
            'first_name': 'given_name',
            'last_name': 'family_name',
        }
    },
}

```

---

<div class="post-metadata">

**Author:** ![Mohammed\_Al-Shammaa](https://talk.getindico.io/user_avatar/talk.getindico.io/mohammed_al-shammaa/32/756_2.png) [@Mohammed\_Al-Shammaa](https://talk.getindico.io/u/Mohammed_Al-Shammaa)\
**Post date:** [May 26, 2021, 11:11pm UTC](https://talk.getindico.io/t/sample-auth-settings-for-google-oauth/2251/3 "2021-05-26T23:11:42Z")

</div>

@ThiefMaster Thank you very much. It’s working now. It took some time to find out that I also need to `pip install authlib`, thanks to you as well in this post:

> [@Using Keycloak SSO](https://talk.getindico.io/t/using-keycloak-sso/2169/12):
>
> Ah yes of course, authlib is not a direct dependency of Indico so I forgot to mention that you need to pip install authlib
