> ## Documentation Index
> Fetch the complete documentation index at: https://docs.droidoxy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Login

> Seamlessly integrate Google OAuth 2.0 authentication into your Pocket Script application, allowing users to log in with their Google accounts. This guide walks you through the setup process, from creating a Google API project to configuring Pocket Script for a smooth "Login with Google" experience.

## Overview

Integrating Google as an identity provider offers your users a convenient and secure way to access your Pocket Script application. This feature leverages Google's OAuth 2.0 protocol, ensuring a streamlined authentication process while maintaining high security standards.

<Note>
  Before you begin, ensure you have admin access to your Pocket Script application and a Google account for setting up the OAuth integration.
</Note>

## Getting Google Client ID and Secret

1. Go to  [https://console.developers.google.com/apis](https://console.developers.google.com/apis)

2. Navigate to the `Credentials` tab

   <img src="https://mintcdn.com/droidoxy/kDuiTUHelTKsROIH/images/web/google/google_console_1.png?fit=max&auto=format&n=kDuiTUHelTKsROIH&q=85&s=1a71358fe105525c9ed4f09292e05ef0" alt="Google Console 1" width="678" height="327" data-path="images/web/google/google_console_1.png" />

3. Click `Select a project --> New Project` and then click the button `Create` OR if you've created a Firebase project while setting up the **Pocket Android App**, then you can select the existing project and **skip to Step 6**

4. Navigate to the tab **OAuth consent screen**

   <img src="https://mintcdn.com/droidoxy/kDuiTUHelTKsROIH/images/web/google/google_console_2.png?fit=max&auto=format&n=kDuiTUHelTKsROIH&q=85&s=6d649d2bb49f1ce1279b4a9fd02ffcd1" alt="Google Console 2" width="678" height="327" data-path="images/web/google/google_console_2.png" />

5. Enter the **Application name**, **Authorized domains** and click the button **Save**

   <img src="https://mintcdn.com/droidoxy/pDOFAb0cUZTqq0s4/images/web/google/google_console_3.png?fit=max&auto=format&n=pDOFAb0cUZTqq0s4&q=85&s=80b8783c0dc6d253bb55390d0c9b62d2" alt="Google Console 3" width="678" height="327" data-path="images/web/google/google_console_3.png" />

6. Click the button `Create Credentials` and from the dropdown list select `OAuth client ID`

   <img src="https://mintcdn.com/droidoxy/pDOFAb0cUZTqq0s4/images/web/google/google_console_4.png?fit=max&auto=format&n=pDOFAb0cUZTqq0s4&q=85&s=eec4eb649e663bb566cfab0bbc99a9cd" alt="Google Console 4" width="678" height="327" data-path="images/web/google/google_console_4.png" />

7. From the **Application type**, select the `Web application`, enter **Authorized JavaScript origins** and click **Create** button

   1. Authorized JavaScript origins
      <Warning>Authorized JavaScript origins will be your website URL</Warning>
      * Whether you install the script in the main domain or a subfolder, the final URL here will be your main domain. Enter your URL as:
        ```
        https://example.com
        ```
      * In case of a subdomain, enter your URL as:
        ```
        https://subdomain.example.com
        ```

   2. Authorized redirect URIs
      <Warning>For Authorized redirect URIs, append `admin/controller/oauth.php` to your website URL</Warning>
      * For the main domain install at ***example.com***, enter your URL as:
        ```
        https://example.com/admin/controller/oauth.php
        ```
      * For sub-domain install at ***subdomain.example.com***, enter your URL as
        ```
        https://subdomain.example.com/controller/oauth.php
        ```
      * For subfolder install at ***example.com/subfolder***, enter your URL as
        ```
        https://example.com/subfolder/controller/oauth.php
        ```

   <img src="https://mintcdn.com/droidoxy/pDOFAb0cUZTqq0s4/images/web/google/google_console_5.png?fit=max&auto=format&n=pDOFAb0cUZTqq0s4&q=85&s=52740036bd418d079b40a278111baacb" alt="Google Console 5" width="678" height="327" data-path="images/web/google/google_console_5.png" />

8. Copy your `Client ID` and `Secret Key`

   <img src="https://mintcdn.com/droidoxy/pDOFAb0cUZTqq0s4/images/web/google/google_console_6.png?fit=max&auto=format&n=pDOFAb0cUZTqq0s4&q=85&s=69d02caed44553072c75a2e5e40764f5" alt="Google Console 6" width="3247" height="1896" data-path="images/web/google/google_console_6.png" />

## Final Steps

Paste the copied keys in your admin panel by following the steps below

* Log in to your Admin Interface (Pocket script instance)
* Navigate to `Settings -> Configuration -> Web App Configuration` from the admin sidebar
* Scroll down to the `Social Login` Section
* And paste the copied `Google Client Id` and `Google Secret Id`

​That’s it!

## Need Help?

If you need any help or assistance, we're here for you! Please [reach out to our support team](https://droidoxy.com/support/)
