# Google OAuth Plugin

### Step 1. Create a Google project

Go to [Google API console](https://console.developers.google.com/) and create a project

### Step 2. Set up OAuth consent screen

![You can restrict your app for the users from your domain (Internal) or make it public (External)](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2Fx1EAP3WcAYdgVvat7zia%2Fgoo-1.png?alt=media\&token=68cc6d4e-01c0-44fb-af10-68e6a2d23dd4)

![Add URL of your app here, specify the authorised domain directual.app](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2F24nkc4ETDWRmQw7IAUow%2Fgoo-2.png?alt=media\&token=e985669c-bb1a-482e-8acc-23e8547d57f5)

{% hint style="info" %}
If you use [custom domain](https://readme.directual.com/web-pages/web-app-settings/custom-domain) you should authorise it on [Google Search Console](https://search.google.com/search-console/about).
{% endhint %}

![Pick scopes: email and profile](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FL1CO4gK4DblnsaVrnamQ%2Fgoo-3.png?alt=media\&token=4743e444-9389-4bf0-babf-039602e81d4c)

### Step 2. Create credentials

![](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FpYr1bNIG0xi73ZlBJDpz%2Fgoo-4.png?alt=media\&token=b83baa4d-8b57-4da3-9ec8-6f463fd4f8df)

![Add URIs — yourapp.directual.app or your custom domain](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FtRiMq4VzJOE7Ky4t51Vw%2Fgoo-5.png?alt=media\&token=6af8783b-94d5-4f92-8706-66bd24b9545e)

![Copy your Client ID and Client Secret](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FrR0Z5iJW7C15E7pVoaH0%2Fgoo-6.png?alt=media\&token=490ea6cd-3831-44cd-a5ca-db5726701cee)

### Step 3. Install plugin

![](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2FGJ01J0vhuNe9YDML1S7M%2Fgoo-7.png?alt=media\&token=8f114f9b-8ceb-4429-b6a9-9eab1a8907d5)

{% hint style="warning" %}
Note, that if you want your users have a chance to **Sign Up** via Google, set the parameter `autoCreateUser` to `true`
{% endhint %}

### Step 4. Enjoy

![](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4Nnmtk9_gFGWOddsf6%2Fuploads%2Fre7VdmNJHxHk877e3wxZ%2Fgoo-final.png?alt=media\&token=97e834b2-e7d3-4ab8-9c60-fc56f220397d)
