Skip to main content

GitHub OAuth

GitHub OAuth supports both the web application flow and the device flow. Use a GitHub App (not a legacy OAuth App) so you can configure multiple redirect URIs for test and production. See GitHub: Migrating OAuth Apps to GitHub Apps.

Register a GitHub App

  1. Go to GitHub Developer Settings and create a new GitHub App.
  2. Set GitHub App name, Homepage URL, Description, and Callback URL.

GitHub

info

In the GitHub App, Callback URL must be Casdoor’s callback URL. In Casdoor, the application Redirect URL is your app’s callback URL. See Application config.

  1. After creating the app, generate the Client secret (under the app settings).

GitHub Client ID

Add the provider in Casdoor

Create an OAuth provider, set Type to GitHub, and enter the Client ID and Client Secret from the GitHub App.

Github Provider

githubapps