# Google OAuth setup

In order to connect Google accounts to Aurinko through OAuth2 authentication you'll need to create your own Google Project and OAuth client ID. You will configure Aurinko to use this client ID. If you have any trouble creating a Google Project and OAuth client ID, get in touch with  [support@aurinko.io](mailto:mailto:support@aurinko.io) and we'd be happy to help you out!

### **Create a Google Project**

***

To get started, head over to <https://console.developers.google.com/>. You will be prompted to log in with a Google account if you're not already logged in with one. If you don't have a Google account, you can create one at <https://accounts.google.com/signup/>.

Use the selector at the top (next to the Google logo) and click the 'NEW PROJECT' button in the popup window that opens.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e08105204286364bc934af3/file-0Ff0FtVciY.jpg" alt=""><figcaption></figcaption></figure></div>

Name your project and click **"CREATE"**.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0810f02c7d3a7e9ae59382/file-4apQyUobao.jpg" alt=""><figcaption></figcaption></figure></div>

It may take up to a minute or two for Google to finish creating the project.

### **Enable APIs**

***

Click the **"ENABLE APIS AND SERVICES"** button.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0812162c7d3a7e9ae59385/file-ezce8mtGJd.jpg" alt=""><figcaption></figcaption></figure></div>

You'll be presented with the following search box:

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e08129904286364bc934af4/file-5YTx5IteAr.jpg" alt=""><figcaption></figcaption></figure></div>

Type "gmail" into the search box and click on the **"Gmail API"** card once it appears.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0812ff2c7d3a7e9ae59386/file-9W6gMAt3TU.jpg" alt=""><figcaption></figcaption></figure></div>

Click the large blue "**ENABLE"** button next to the Gmail logo.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e08135604286364bc934af5/file-FV5bPdzIdd.jpg" alt=""><figcaption></figcaption></figure></div>

You'll find yourself on the following page. Click the search box in the center of the top bar.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0813d704286364bc934af6/file-r019jZBFRU.jpg" alt=""><figcaption></figcaption></figure></div>

Type "calendar" and click on **"Google Calendar API"** once it appears.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0814592c7d3a7e9ae59389/file-6nyxIUYqrN.jpg" alt=""><figcaption></figcaption></figure></div>

Click **"ENABLE"** for the Google Calendar API.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0814dc2c7d3a7e9ae5938c/file-coR0m73mH3.jpg" alt=""><figcaption></figcaption></figure></div>

In the similar manner find and enable Contacts API, Google People API, and Tasks API.

### **Configure OAuth consent screen**

***

The last step to do in the Google Developer Console is to create a credential for OAuth, starting with configuring the consent screen. Click the **"CREATE CREDENTIALS"** button.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0816232c7d3a7e9ae5938d/file-Y74fQhIo7T.jpg" alt=""><figcaption></figcaption></figure></div>

On the next screen, click "client ID".

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e08168304286364bc934af7/file-Cy2tTimoYw.jpg" alt=""><figcaption></figcaption></figure></div>

Then click **"Configure consent screen"**.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0816d304286364bc934af8/file-ISKpV9e1UO.jpg" alt=""><figcaption></figcaption></figure></div>

Choose "Internal" or "External" user type. An "Internal" user type Google application will only allow access to users from your organization ( <mark style="color:red;">`@your-organization.com`</mark>). This type of application allows you to entirely skip the App Verification and Security Review processes required by Google for public-access applications, but limits which accounts can authenticate to your application.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0817f92c7d3a7e9ae5938e/file-GBHMgCF63r.jpg" alt=""><figcaption></figcaption></figure></div>

On the following page, fill out the "Application name" field.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e08196f2c7d3a7e9ae59390/file-uD0m92W592.jpg" alt=""><figcaption></figcaption></figure></div>

You'll need to determine what Google scopes you add to your consent screen based on your application's behavior. Please reference this mapping to see how Aurinko scopes will map to Google scopes during the authentication process:

| Aurinko scope        | Google API permission                                                                                    |
| -------------------- | -------------------------------------------------------------------------------------------------------- |
| `Mail.ReadOnly`      | [`https://www.googleapis.com/auth/gmail.readonly`](https://www.googleapis.com/auth/gmail.readonly)       |
| `Mail.ReadWrite`     | [`https://www.googleapis.com/auth/gmail.modify`](https://www.googleapis.com/auth/gmail.modify)           |
| `Mail.Draft`         | [`https://www.googleapis.com/auth/gmail.compose`](https://www.googleapis.com/auth/gmail.compose)         |
| `Mail.Send`          | [`https://www.googleapis.com/auth/gmail.send`](https://www.googleapis.com/auth/gmail.send)               |
| `Calendar.ReadOnly`  | [`https://www.googleapis.com/auth/calendar.readonly`](https://www.googleapis.com/auth/calendar.readonly) |
| `Calendar.ReadWrite` | [`https://www.googleapis.com/auth/calendar`](https://www.googleapis.com/auth/calendar)                   |
| `Contacts.ReadOnly`  | [`https://www.googleapis.com/auth/contacts.readonly`](https://www.googleapis.com/auth/contacts.readonly) |
| `Contacts.ReadWrite` | [`https://www.googleapis.com/auth/contacts`](https://www.googleapis.com/auth/contacts)                   |
| `Tasks.ReadOnly`     | [`https://www.googleapis.com/auth/tasks.readonly`](https://www.googleapis.com/auth/tasks.readonly)       |
| `Tasks.ReadWrite`    | [`https://www.googleapis.com/auth/tasks`](https://www.googleapis.com/auth/tasks)                         |

Then add all required Google scopes, i.e. gmai.modify, gmail.send, calendar, contacts, tasks.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e081d402c7d3a7e9ae59393/file-7EpfR1Bme9.jpg" alt=""><figcaption></figcaption></figure></div>

Finally, add your app's domain to the "Authorized domains" field.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e08203004286364bc934b03/file-inxsshQ2Al.jpg" alt=""><figcaption></figcaption></figure></div>

&#x20;Scroll down to the bottom of the page and click the blue "Save" button!

### **Create an OAuth credential**

***

Click **"Create credentials"** and select **"OAuth client ID"** from the drop-down menu.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0820da04286364bc934b05/file-oZZ7TxbCMk.jpg" alt=""><figcaption></figcaption></figure></div>

Fill out the form choosing the appropriate application type based on your application, and be sure to read the article regarding redirect URIs.

<div data-full-width="true"><figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dd72e4d2c7d3a7e9ae44753/images/5e0a55da04286364bc93532b/file-INUoKNGwIq.jpg" alt=""><figcaption></figcaption></figure></div>

Then click the blue "Create" button at the bottom of the screen.

You'll be presented with a page that shows your new OAuth client ID and Secret. Keep the page open, as you'll need the credentials in the next step.

### **Configure Aurinko to use your Google OAuth credentials**

***

Head on over to [Aurinko portal](https://app.aurinko.io/) and log in.

Select your app at the top, choose Settings menu and switch to the GOOGLE tab.&#x20;

<div data-full-width="true"><figure><img src="https://3933352743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0ua36KLVlbUN5bA2bgiq%2Fuploads%2FyI5TCDMgLq7ngDNlRJvb%2Fimage.png?alt=media&#x26;token=af8ea401-6186-4a23-b23f-dd6903ee522c" alt=""><figcaption></figcaption></figure></div>

Copy-paste your Google OAuth client ID and Secret from the Google Developer Console and click "Save".

**You are now all set to start connecting Google accounts to Aurinko!**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aurinko.io/authentication/google-oauth-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
