Google

This guide will help you set up Google OAuth authentication for your DataSpace application.

Prerequisites

  • A Google Cloud Platform account

  • Access to the Google Cloud Console

Step 1: Create a Google Cloud Project

  1. Create a new project or select an existing one

  2. Note down your project ID

Step 2: Enable Google+ API

  1. In the Google Cloud Console, go to "APIs & Services" > "Library"

  2. Search for "Google+ API" and enable it

  3. Alternatively, you can use the newer Google Identity API

Step 3: Create OAuth 2.0 Credentials

  1. Go to "APIs & Services" > "Credentials"

  2. Click "Create Credentials" > "OAuth 2.0 Client IDs"

  3. Choose "Web application" as the application type

  4. Configure the OAuth consent screen if prompted

Step 4: Configure OAuth Client

  1. Authorized JavaScript origins:

    • Add your frontend URL (e.g., https://yourdomain.com)

  2. Authorized redirect URIs:

    • Add your backend callback URL: https://yourdomain.com/api/auth/google-callback

Step 5: Get Your Credentials

  1. After creating the OAuth client, you'll get:

    • Client ID (looks like: 123456789-abcdefg.apps.googleusercontent.com)

    • Client Secret (looks like: GOCSPX-abcdefghijklmnopqrstuvwxyz)

Step 6: Configure Environment Variables

Add the following environment variables to your application:

GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here

Additional Resources

Last updated