# Google OAuth

Google OAuth allows users to log in to your application using their Google credentials. To enable Google OAuth in your SAAS template, you'll need to create a Google API project and obtain a Client ID and Client Secret. Follow the steps below to generate these credentials:

\
**Step 1: Sign in to Google Developers Console**

1\. Open your web browser and go to the \[Google Developers Console]\(<https://console.developers.google.com/>).

2\. Sign in using your Google account credentials.

\
**Step 2: Create a New Project**

1\. Once signed in, click on the "Select a project" dropdown menu at the top of the page.

2\. Click on the "+ New Project" button.

3\. Enter a name for your project and click on the "Create" button.

**Step 3: Enable APIs**

1\. In the sidebar menu, navigate to "APIs & Services" > "Dashboard".

2\. Click on the "+ Enable APIs and Services" button.

3\. Search for the API you want to use (e.g., Google Drive API, Gmail API) and click on it.

4\. Click on the "Enable" button to enable the API for your project.

\
**Step 4: Create OAuth Client ID**

1\. In the sidebar menu, navigate to "APIs & Services" > "Credentials".

2\. Click on the "Create credentials" dropdown menu and select "OAuth client ID".

3\. Choose the application type based on your use case:

* Web application: If your application runs on a web server.
* Android: If your application is an Android app.
* iOS: If your application is an iOS app.
* Desktop App: If your application is a desktop app.

4\. Fill in the required fields such as name and redirect URI.

* For web applications, the redirect URI is usually <http://localhost/oauth2callback>.

5\. Click on the "Create" button.

6\. Once created, you will see your Client ID and Client Secret.

**Step 5: Securely Store Client ID and Client Secret**

1\. Make sure to securely store your Client ID and Client Secret.

2\. Never expose your Client Secret in client-side code or public repositories.

3\. Use environment variables or a secure storage mechanism to access these credentials in your application.

**Step 6: Configure OAuth Consent Screen**

1\. In the Google Developers Console, navigate to "APIs & Services" > "OAuth consent screen".

2\. Fill in the required information such as application name, user support email, and developer contact information.

3\. Add scopes if necessary (permissions your application requests from users).

4\. Save your changes.

<br>

That's it! You've successfully created a Google Client ID and Client Secret for OAuth. Make sure to integrate these credentials into your application securely and adhere to Google's OAuth guidelines and best practices.


---

# 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.questera.ai/integrations/email/google-oauth.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.
