This guide will help you set up Google OAuth for your AI Chat Assistant app.
- Go to the Google API Console
- Create a new project or select an existing one
- Navigate to "Credentials" in the left sidebar
- Click "Create Credentials" and select "OAuth client ID"
- Select "Web application" as the application type
- Give your OAuth client a name (e.g., "AI Chat Assistant")
Add the URLs where your application will be hosted:
- For local development:
http://localhost:8000 - For production: Add your actual domain (e.g.,
https://yourdomain.com)
- After creating the OAuth client, you'll see your Client ID
- Copy this Client ID (it will look like
123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com) - Open the
landing.htmlfile in your project - Replace
PASTE_YOUR_CLIENT_ID_HERE.apps.googleusercontent.comwith your actual Client ID
- Go to "OAuth consent screen" in the left sidebar
- Select "External" as the user type (unless you're using Google Workspace)
- Fill in the required application information:
- App name
- User support email
- Developer contact information
- Add the scopes needed for your application:
openidemailprofile
- Add test users if you're in testing mode
- When you're ready to make your app available to all users, go back to the OAuth consent screen
- Submit your app for verification if you're using sensitive or restricted scopes
- Once approved, you can change the status from "Testing" to "Production"
- "Error: invalid_client": Ensure your client ID is correctly copied to
landing.html - "Error: redirect_uri_mismatch": Make sure the domain where your app is hosted is listed in the Authorized JavaScript Origins
- "Error: idpiframe_initialization_failed": Check that your OAuth consent screen is properly configured