Setting Up Google Console
Follow these steps to set up OAuth credentials in Google Console:
1. Visit Google Cloud Console
Go to Google Cloud Console.
2. Open Console
Click on "Console" to access your Google Cloud Dashboard.
3. Create a New Project
- Navigate to "Select a Project" > "New Project".
- Enter a project name (e.g.,
DjangoGoogleAuth). - Click "Create".
4. Enable OAuth Consent Screen
- Go to APIs & Services > OAuth Consent Screen.
- Choose External for production use (Internal for testing within your organization).
- Fill in the required fields:
- App Name: E.g., My Django App
- User Support Email
- Developer Contact Information
- Authorized Domain: Add
localhost(for development) and production domains. - Click Save and Continue.
5. Create OAuth Credentials
- Go to APIs & Services > Credentials.
- Click on "Create Credentials" > OAuth Client ID.
- Choose Web Application.
Configure Authorized Redirect URIs:
- Development:
http://localhost:8000/auth/google/callback/ -
Production: Replace
localhostwith your domain (e.g.,https://api.example.com/auth/google/callback/). -
Click Create.
6. Copy Client ID and Secret
After creation, note down the Client ID and Client Secret.
7. Enable OAuth Scopes
- Go to APIs & Services > Library.
- Enable the Google+ API (or People API for user profile access).