Google Authentication
Velero UI supports authentication via Google using OAuth 2.0. This guide explains how to configure and enable Google authentication using environment variables.
Environment Variables
To enable Google authentication, set the following environment variables:
Variable | Description |
---|---|
GOOGLE_AUTH_ENABLED | Set to true to enable Google authentication. Default is false . |
GOOGLE_CLIENT_ID | The client ID from your Google Developer Console. |
GOOGLE_CLIENT_SECRET | The client secret from your Google Developer Console. |
GOOGLE_OAUTH_SCOPE | The scope of OAuth access. Default: openid email profile . |
GOOGLE_REDIRECT_URI | The redirect URI after authentication. Default: http://localhost:4200/login . |
Steps to Configure Google Authentication
-
Create a Google OAuth App
- Go to the Google Cloud Console.
- Navigate to APIs & Services > Credentials.
- Click Create Credentials and select OAuth Client ID.
- Choose Web Application as the application type.
- Set the Authorized redirect URIs to
http://localhost:4200/login
(or your production URL). - Copy the Client ID and Client Secret.
-
Set Environment Variables
- Update your environment variables with the values from Google.
- Example:
GOOGLE_AUTH_ENABLED=true
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_OAUTH_SCOPE="openid email profile"
GOOGLE_REDIRECT_URI=http://localhost:4200/login
-
Restart Your Application
- Restart the Velero UI to apply the changes.
Troubleshooting
- Ensure that the redirect URI set in Google Cloud matches
GOOGLE_REDIRECT_URI
. - Check if
GOOGLE_AUTH_ENABLED
is set totrue
. - Inspect logs for authentication errors.
- Verify that your Google OAuth credentials are correct.
Conclusion
Once configured, users will be able to sign in to Velero UI using their Google accounts via OAuth 2.0 authentication.