Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[HttpPost]
public IActionResult Login([FromForm]LoginFormViewModel viewModel)
{
var authClient = new AuthenticationApiClient("<domain>.auth0.com");
var authUrl = authClient.BuildAuthorizationUrl()
.WithClient("<client id>")
.WithResponseType(AuthorizationResponseType.Code)
.WithConnection("Username-Password-Authentication")
.WithRedirectUrl("https://localhost:5001/home/callback")
.WithScope("openid offline_access")
.WithState("1234567890")
.WithAudience("<api identifier>")
.Build()
.ToString();
return Redirect(authUrl);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.