OAuth Setup
CleverThis supports Google and GitHub OAuth for user sign-in. Each provider requires creating an OAuth application in the provider's developer console and configuring the resulting credentials as environment variables.
Google OAuth
- Go to Google Cloud Console → APIs & Services → Credentials.
- Click Create Credentials → OAuth client ID.
- Choose Web application.
- Set Authorized JavaScript origins to your webapp URL:
https://app.your-domain.com. - Set Authorized redirect URIs to:
https://app.your-domain.com/api/auth/callback/google - Click Create. Copy the Client ID and Client secret.
Set environment variables:
GOOGLE_CLIENT_ID=<your-client-id>
GOOGLE_CLIENT_SECRET=<your-client-secret>
GitHub OAuth
- Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App.
- Set Application name to anything (e.g. "CleverThis").
- Set Homepage URL to
https://app.your-domain.com. - Set Authorization callback URL to:
https://app.your-domain.com/api/auth/callback/github - Click Register application. On the next page, click Generate a new client secret.
- Copy the Client ID and the generated Client secret.
Set environment variables:
GITHUB_CLIENT_ID=<your-client-id>
GITHUB_CLIENT_SECRET=<your-client-secret>
Enabling / disabling providers
If only one provider's environment variables are set, only that provider's OAuth button appears on the sign-in page. To disable OAuth entirely (email/password only), omit both sets of variables.
Testing OAuth locally
For local development, set the redirect URL to http://localhost:3000/api/auth/callback/google (or /github). Most providers allow multiple redirect URIs on the same OAuth app.
Coming soon
SAML/SSO for enterprise organization workspaces is on the roadmap.