Skip to content

GitHub OAuth

Tinyauth has built-in support for GitHub OAuth with just two environment variables. Most of the configuration happens on the GitHub side rather than Tinyauth.

  • A domain name (non-gTLDs are supported)
  • A GitHub account

Begin by creating a GitHub OAuth app. Navigate to the GitHub developer settings and click New OAuth App. Fill in the following details:

NameValue
Application nameCan be anything, e.g., Tinyauth.
Homepage URLCan be any URL, e.g., https://tinyauth.app.
Authorization Callback URLEnter the domain followed by /api/oauth/callback/github, e.g., https://tinyauth.example.com/api/oauth/callback/github.

GitHub new OAuth app

After entering the details, click Register Application.

Once the application is created, the following screen will appear:

GitHub OAuth app homepage

Note down the client ID. To generate the client secret, click Generate a new client secret. GitHub will prompt for login confirmation and then display the secret:

GitHub OAuth Client Secret

Note down the client ID and secret for later use.

Add the following environment variables to the Tinyauth Docker container:

services:
tinyauth:
environment:
- TINYAUTH_OAUTH_PROVIDERS_GITHUB_CLIENTID=your-github-client-id
- TINYAUTH_OAUTH_PROVIDERS_GITHUB_CLIENTSECRET=your-github-secret

Restart Tinyauth. Upon visiting the login screen, an additional option to log in with GitHub will appear.