This guide will help you set up Google OAuth authentication for your DataSpace application.
Create a Google Cloud Project
Section titled “Create a Google Cloud Project”- Go to the Google Cloud Console
- Create a new project or select an existing one
- Note down your project ID
Create OAuth 2.0 Credentials
Section titled “Create OAuth 2.0 Credentials”- Go to “APIs & Services” > “Credentials”
- Click “Create Credentials” > “OAuth 2.0 Client IDs”
- Choose “Web application” as the application type
- Configure the OAuth consent screen if prompted
Configure OAuth Client
Section titled “Configure OAuth Client”- Authorized redirect URIs:
- Add the backend URL (
BACKEND_BASE_URL) followed by/signin-google, e.g.,https://api.dataspace.acme.com/signin-google
- Add the backend URL (
Get Your Credentials
Section titled “Get Your Credentials”After creating the OAuth client, you’ll get:
- Client ID (looks like:
123456789-abcdefg.apps.googleusercontent.com) - Client Secret (looks like:
GOCSPX-abcdefghijklmnopqrstuvwxyz)
Configure DataSpace
Section titled “Configure DataSpace”Set the client ID in .env and write the client secret to secrets/google_client_secret. Then run ./start.sh so the backend picks them up.
GOOGLE_CLIENT_ID=your_google_client_id_hereAn empty client ID disables Google sign-in.
