I am trying to understand this condition in IdentityServer4 quickstart:
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Login(LoginInputModel model, string button)
{
if (button != "login")
{
var context = await _interaction.GetAuthorizationContextAsync(model.ReturnUrl);
if (context != null)
{
await _interaction.GrantConsentAsync(context, ConsentResponse.Denied);
return Redirect(model.ReturnUrl);
}
else
{
return Redirect("~/");
}
}
As far as I understand, if login form is not submitted by pressing login button (<button type=submit value=login>) but by another post request (?) what exactly is going to happen?
What is GetAuthorizationContextAsync doing? I think it may extract some Authorization code from Query string and Authorize. Correct?
Thanks!