Configuration of Google SSO Authentication Service
NextAuth (Auth.js) has been fully removed from LobeHub. The NEXT_AUTH_SSO_PROVIDERS and AUTH_URL variables shown below will now cause the deployment to fail at build/startup. This page is kept for historical reference only — use the Better Auth provider guides and the NextAuth to Better Auth migration guide instead.
Create a Google Cloud OAuth 2.0 Client
In your Google Cloud Console, navigate to APIs & Services > Credentials.
Click on Create Credentials and select OAuth client ID.
If you haven't already set up a consent screen, you will be prompted to do so. Complete the OAuth consent screen setup (specify app name, support email, and add authorized users if needed).
Select Web application as the application type.
In the Authorized redirect URIs section, enter:
- You can add or modify redirect URIs after registration, but make sure the URL matches your deployed LobeHub instance.
- Replace "your-domain" with your actual domain.
Click Create.
After creation, copy the Client ID and Client Secret.

Add Users (Optional for Internal Use Only)
If your application is in Testing or Internal publishing status, add user emails in the OAuth consent screen under Test users. Users not added here will not be able to authenticate.
Configure Environment Variables
When deploying LobeHub, configure the following environment variables:
| Environment Variable | Type | Description |
|---|---|---|
NEXT_AUTH_SECRET | Required | Key to encrypt Auth.js session tokens. Generate using: openssl rand -base64 32 |
NEXT_AUTH_SSO_PROVIDERS | Required | Select the single sign-on provider for LobeHub. Use google for Google SSO. |
AUTH_GOOGLE_ID | Required | Client ID from Google Cloud OAuth. |
AUTH_GOOGLE_SECRET | Required | Client Secret from Google Cloud OAuth. |
AUTH_URL | Required | Specifies the callback address for Auth.js when performing OAuth authentication. E.g. https://your-domain/api/auth |
See 📘 environment variables for more details on these variables.
After successful deployment, users can sign in to LobeHub using their Google accounts (those added as Test Users, if not in production).
Advanced Configuration
See the Google Identity Platform Documentation for advanced options, scopes, and consent screen configuration.