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

# Google

> Integrate Google Single Sign-On with Nile Auth

<Steps>
  <Step title="Setup Google Developer Console">
    1. Create a [Google Developer](https://console.developers.google.com/) account.
    2. Follow the documentation for [creating an OAuth 2.0 Client ID](https://developers.google.com/identity/protocols/oauth2) in Google.
    3. Obtain a **Client ID** and **Client Secret** from [Google OAuth](https://console.cloud.google.com/apis/credentials).
       Be sure to set the redirect URL to your application handling the Nile Auth requests.
       If you are running locally and used the routes generated by `@niledatabase/server`, the redirect URL is `http://localhost:3000/api/auth/callback/google`.

    <Accordion title="Google dashboard example">
      <img height="500" width="500" src="https://mintcdn.com/nile/6B-b9nH3DSiJ_Uwi/images/auth/googleexample.png?fit=max&auto=format&n=6B-b9nH3DSiJ_Uwi&q=85&s=c49fcaa86747557364e78a88a181106b" alt="Google SSO" data-path="images/auth/googleexample.png" />
    </Accordion>
  </Step>

  <Step title="Save Client ID and Client Secret in Nile">
    Save them to your database at `console.thenile.dev` under Google in **Tenants
    & Users -> Configuration** <img src="https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/singlesignon/google.png?fit=max&auto=format&n=ZhObK_CvFMgzM-yj&q=85&s=dedcb3b64eac743830a7b664fdc6524b" alt="Google configuration on
    console.thenile.dev" width="2024" height="1702" data-path="images/singlesignon/google.png" />
  </Step>

  <Step title="Add the `Google` button to your login page">
    The button will redirect the user to Google for authentication. Upon successful authentication, the user will be redirected back to your application.

    ```jsx theme={null}
    import { Google } from '@niledatabase/react';

    function App() {
      return (
        <div>
          <Google callbackUrl="/" />
        </div>
      );
    }
    ```
  </Step>
</Steps>

## Related Providers

* [GitHub SSO](/auth/singlesignon/github)
* [Microsoft SSO](/auth/singlesignon/microsoft)
* [Discord SSO](/auth/singlesignon/discord)
