2024-04-02 03:08:17 -04:00
|
|
|
---
|
|
|
|
|
title: Google
|
|
|
|
|
description: Learn how to configure LibreChat to use Google for user authentication.
|
|
|
|
|
weight: -9
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Google
|
|
|
|
|
|
|
|
|
|
## Create a Google Application
|
|
|
|
|
|
|
|
|
|
- Visit: **[Google Cloud Console](https://cloud.google.com)** and open the `Console`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Create a New Project and give it a name
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
## Google Application Configuration
|
|
|
|
|
|
|
|
|
|
- Select the project you just created and go to `APIs and Services`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Select `Credentials` and click `CONFIGURE CONSENT SCREEN`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Select `External` then click `CREATE`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Fill in your App information
|
|
|
|
|
|
|
|
|
|
> Note: You can get a logo from your LibreChat folder here: `docs\assets\favicon_package\android-chrome-192x192.png`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Configure your `App domain` and add your `Developer contact information` then click `SAVE AND CONTINUE`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Configure the `Sopes`
|
|
|
|
|
- Add `email`,`profile` and `openid`
|
|
|
|
|
- Click `UPDATE` and `SAVE AND CONTINUE`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Click `SAVE AND CONTINUE`
|
|
|
|
|
- Review your app and go back to dashboard
|
|
|
|
|
|
|
|
|
|
- Go back to the `Credentials` tab, click on `+ CREATE CREDENTIALS` and select `OAuth client ID`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Select `Web application` and give it a name
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Configure the `Authorized JavaScript origins`, you can add both your domain and localhost if you desire
|
|
|
|
|
- Example for localhost: `http://localhost:3080`
|
|
|
|
|
- Example for a domain: `https://example.com`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Add a valid `Authorized redirect URIs`
|
|
|
|
|
- Example for localhost: `http://localhost:3080/oauth/google/callback`
|
|
|
|
|
- Example for a domain: `https://example.com/oauth/google/callback`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
## .env Configuration
|
|
|
|
|
|
|
|
|
|
- Click `CREATE` and copy your `Client ID` and `Client secret`
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
- Add them to your `.env` file:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
DOMAIN_CLIENT=https://your-domain.com # use http://localhost:3080 if not using a custom domain
|
|
|
|
|
DOMAIN_SERVER=https://your-domain.com # use http://localhost:3080 if not using a custom domain
|
|
|
|
|
|
|
|
|
|
GOOGLE_CLIENT_ID=your_client_id
|
|
|
|
|
GOOGLE_CLIENT_SECRET=your_client_secret
|
2024-04-04 13:36:06 -04:00
|
|
|
GOOGLE_CALLBACK_URL=/oauth/google/callback
|
2024-04-02 03:08:17 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Save the `.env` file
|
|
|
|
|
|
|
|
|
|
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|