Orchard Core GitHub Authentication
Enable OrchardCore.GitHub.Authentication; it depends on
OrchardCore.Users.ExternalAuthentication. Configure it at
Settings → Security → Authentication → GitHub.
The persisted GitHubAuthenticationSettings properties are ClientID,
ClientSecret, CallbackPath, and SaveTokens. The default callback path is
/signin-github. Register the tenant's full HTTPS callback URL with the
GitHub OAuth App.
Orchard Core 3.0 API changes
The GitHub integration uses the AspNet.Security.OAuth.GitHub package. The
old GithubDefault, GithubOptions, GithubHandler, and
IGithubAuthenticationService APIs are removed. Use the package's
GitHubAuthenticationDefaults, GitHubAuthenticationOptions, and
GitHubAuthenticationHandler types, or the Orchard Core settings and
registration APIs described below.
The GitHubAuthenticationSettings recipe step deliberately uses
ConsumerKey and ConsumerSecret, which the handler maps to the persisted
client ID and secret:
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.GitHub.Authentication"
]
},
{
"name": "GitHubAuthenticationSettings",
"ConsumerKey": "github-oauth-client-id",
"ConsumerSecret": "supply-from-a-secret-store",
"CallbackPath": "/signin-github"
}
]
}
Use ConfigureGitHubSettings() for host configuration overrides, and keep
client secrets out of committed configuration. Enable
OrchardCore.Users.Registration only when external visitors may create local
accounts. Authentication does not grant Orchard roles or permissions.