I have two login methods, OpenIDConnect and Cookie based Authentication.
I provide a button for the user to choose, and I have this code that then handles the request.
using Microsoft.AspNetCore.Hosting;
using Microsoft.Identity.Web.UI;
[HttpPost]
[ValidateAntiForgeryToken]
[AllowAnonymous]
public async Task<IActionResult> LogIn(LogInModel model, string actionType)
{
if (actionType.Equals("AzureLogin")) {
return RedirectToAction("SignIn", "AccountController", new { Area = "MicrosoftIdentity" });
}
// default Cookie Auth follows.
}
When I redirect I am getting:
Status Code: 404; Not Found
.
How can I invoke the provided SignIn Action. .NET Docs mention this, but I would prefer not
to use the asp-controller
property.
<li class="nav-item">
<a class="nav-link text-dark" asp-area="MicrosoftIdentity" asp-controller="Account" asp-action="SignIn">Sign in</a>
</li>
question from:
https://stackoverflow.com/questions/65949146/asp-net-core-3-1-how-can-i-redirect-to-the-signin-action-contained-in-the-accoun 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…