Google Authentication
This guide will help you set up Google authentication for your Ctrlplane application.
Prerequisites
- A Google Cloud Platform (GCP) account
- A GCP project with the Google+ API enabled
Setup Steps
- Go to the Google Cloud Console.
- Select your project or create a new one.
- Navigate to “APIs & Services” > “Credentials”.
- Click “Create Credentials” and select “OAuth client ID”.
- Choose “Web application” as the application type.
- Set the authorized redirect URI to
https://your-domain.com/api/auth/callback/google
. - Click “Create” to generate your client ID and client secret.
Configuration
To enable Google authentication, you need to set the following environment variables:
AUTH_GOOGLE_CLIENT_ID
: Your Google OAuth client IDAUTH_GOOGLE_CLIENT_SECRET
: Your Google OAuth client secret
When these variables are set, Google authentication will be automatically enabled, and basic authentication will be disabled unless explicitly enabled.
Usage
Once configured, users will be able to sign in to your Ctrlplane application using their Google accounts. The authentication flow will redirect users to Google’s login page and then back to your application after successful authentication.