Last active
July 20, 2020 00:20
-
-
Save xximjasonxx/bdaf3834bbf51b9f9d494ff79aedee04 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
[HttpPost] | |
public IActionResult Login([FromForm]LoginFormViewModel viewModel) | |
{ | |
var authClient = new AuthenticationApiClient("<your domain>.auth0.com"); | |
var authUrl = authClient.BuildAuthorizationUrl() | |
.WithClient("<your client id>") | |
.WithResponseType(AuthorizationResponseType.Code) | |
.WithConnection("Username-Password-Authentication") | |
.WithRedirectUrl("https://localhost:5001/home/callback") | |
.WithScope("openid offline_access") | |
.WithState("1234567890") | |
.Build() | |
.ToString(); | |
return Redirect(authUrl); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment