Created
July 20, 2020 00:38
-
-
Save xximjasonxx/5ce93c70da24f9a8bb619833c160b09b to your computer and use it in GitHub Desktop.
This file contains 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
[HttpGet] | |
public async Task<IActionResult> Callback([FromQuery]string code) | |
{ | |
var authClient = new AuthenticationApiClient("<domain>.auth0.com"); | |
var tokenResponse = await authClient.GetTokenAsync(new AuthorizationCodeTokenRequest | |
{ | |
RedirectUri = "https://localhost:5001/home/auth_callbabck", | |
Code = code, | |
ClientId = "<your client id>", | |
ClientSecret = "<your client secret>" | |
}); | |
CustomContext.IdToken = tokenResponse.IdToken; | |
CustomContext.AccessToken = tokenResponse.AccessToken; | |
CustomContext.RefreshToken = tokenResponse.RefreshToken; | |
return Redirect("CodeView"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment