This guide explains how to configure GitHub as an OAuth 2.0 provider for SnackBase.
Prerequisites
- A GitHub account
- SnackBase installed and running
Step 1: Register a New OAuth Application
- Go to your GitHub account Settings
- Navigate to Developer settings > OAuth Apps
- Click New OAuth App
- Fill in the application details:
- Application name: SnackBase
- Homepage URL:
https://<your-domain>
- Authorization callback URL:
https://<your-domain>/api/v1/auth/oauth/github/callback
- For local development:
http://localhost:8000/api/v1/auth/oauth/github/callback
Step 2: Generate Client Secret
- After creating the app, you will see the Client ID
- Click Generate a new client secret
- Copy the Client Secret
In SnackBase, configure the GitHub provider:
| Field | Value |
|---|
client_id | Your GitHub Client ID |
client_secret | Your GitHub Client Secret |
redirect_uri | The Authorization callback URL from Step 1 |
scopes | user:email read:user (default) |
Testing
- Save your configuration
- Attempt to sign in via the GitHub button on the login page
Troubleshooting
The client secret is only shown once. Make sure to copy it immediately after generating.
Common Issues:
- redirect_uri_mismatch: Ensure the callback URL exactly matches what you configured
- Application suspended: GitHub may suspend apps that violate their terms of service