Created
April 26, 2016 13:23
-
-
Save MisterJames/746331337329ca50556cbff19a0ba176 to your computer and use it in GitHub Desktop.
GitHubOptions for Auth in ASP.NET Core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private OAuthOptions GitHubOptions => | |
| new OAuthOptions | |
| { | |
| AuthenticationScheme = "GitHub", | |
| DisplayName = "GitHub", | |
| ClientId = Configuration["GitHub:ClientId"], | |
| ClientSecret = Configuration["GitHub:ClientSecret"], | |
| CallbackPath = new PathString("/signin-github"), | |
| AuthorizationEndpoint = "https://github.com/login/oauth/authorize", | |
| TokenEndpoint = "https://github.com/login/oauth/access_token", | |
| UserInformationEndpoint = "https://api.github.com/user", | |
| ClaimsIssuer = "OAuth2-Github", | |
| SaveTokensAsClaims = true, | |
| // Retrieving user information is unique to each provider. | |
| Events = new OAuthEvents | |
| { | |
| OnCreatingTicket = async context => { await CreateGitHubAuthTicket(context); } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment