GitHub OAuth support both web application flow and device flow, please continue reading to obtain OAuth credential.
First, please visit GitHub developer settings to register a new GitHub App.
Tricks: We recommend that you use GitHub Apps to replace the OAuth Apps, because GitHub Apps can add multiple redirect uri, which can bring convenience when deploying test and production environments. GitHub official also recommend using GitHub Apps instead of OAuth Apps.
Then fill the Github App name, Homepage URL, description and Callback URL.
In GitHub App config, the
Callback URL must be your Casdoor's callback url, and the
Redirect URL in Casdoor should be your application callback url
More details please read App config
After registering your GitHub App, you can generate your
Client Secret now!
Add a GitHub OAuth provider and fill the
Client ID and
Client Secret in your Casdoor
Now you can use GitHub as third party service to complete authentication.