KestrunHostAuthnExtensions.AddGitHubOAuthAuthentication method
Adds GitHub OAuth (Authorization Code) authentication with optional email enrichment. Creates three schemes: scheme, scheme.Cookies, scheme.Policy.
public static KestrunHost AddGitHubOAuthAuthentication(this KestrunHost host, string scheme,
string? displayName, string[]? documentationId, string? description, string clientId,
string clientSecret, string callbackPath)
| parameter | description |
|---|---|
| host | The Kestrun host instance. |
| scheme | Base scheme name (e.g. “GitHub”). |
| displayName | The display name for the authentication scheme. |
| documentationId | Documentation IDs for the authentication scheme. |
| description | A description of the authentication scheme. |
| clientId | GitHub OAuth App Client ID. |
| clientSecret | GitHub OAuth App Client Secret. |
| callbackPath | The callback path for OAuth redirection (e.g. “/signin-github”). |
Return Value
The configured KestrunHost.
See Also
- class KestrunHost
- class KestrunHostAuthnExtensions
- namespace Kestrun.Hosting