GitHub is the default connector for developer tools. The account is already open in the browser, the profile is rich, and sign-in doubles as proof that the user is a developer.
Copy the redirect URI
In the Authdog console, select the project and environment, open Authentication > Providers, find GitHub, and click Enable. Copy the redirect URI shown in the form:
https://identity.authdog.com/api/v1/callback/<connectionId>Create the OAuth app
- Open Developer settings > OAuth Apps.
- Select New OAuth App.
- Fill in:
- Application name: shown on the consent screen.
- Homepage URL: your site.
- Authorization callback URL: the redirect URI from Authdog.
- Register the application.
- Copy the Client ID, then select Generate a new client secret and copy the secret.
An OAuth App accepts exactly one callback URL, so each Authdog environment needs its own OAuth App. Name them distinctly (Acme (dev), Acme), the name is what users see when they authorize.
Create the app under an organization rather than a personal account if more than one person needs to manage it. Organization-owned apps may also need owner approval before members can authorize them.
Configure Authdog
| Field | Value |
|---|---|
| Client ID | From the OAuth App page |
| Client Secret | Shown once when generated |
Save, then toggle the connection active.
What GitHub returns
Authdog requests the user scope and reads the profile from https://api.github.com/user, login, name, avatar, and the numeric ID that identifies the account permanently. A user can rename their GitHub account; the numeric ID stays put, and that is what Authdog links on.
The profile endpoint returns the user's public email, which is frequently null, many developers keep their address private, and GitHub's noreply setting hides it by default. Expect a share of GitHub users with no email address and prompt for one after sign-up if your product needs it.
Test it
- Open your environment's hosted sign-in page, or link to
https://identity.authdog.com/api/v1/signin/<connectionId>. - Select Continue with GitHub and authorize.
- Confirm the user appears under Users with a GitHub identity linked.
- Revoke the authorization in GitHub's applications settings and sign in again to check the consent screen.
Troubleshooting
| Symptom | Cause |
|---|---|
The redirect_uri MUST match the registered callback URL |
The callback URL differs from Authdog's, or you are testing the wrong environment's connection |
Bad verify code |
Client secret mismatch, or a reused authorization code |
| No email on the user record | The account's email is private, expected behaviour |
| Members cannot authorize | The organization requires owner approval for OAuth Apps |
Related
| Read | To learn how to |
|---|---|
| Connectors | Set up any other social provider |
| GitLab | Offer the other developer identity most teams expect |
| Users | Collect a verified email after a first sign-in |