如何在 OpenID-Connect OWIN MVC 中重定向之前执行操作



我尝试了几天,但无法弄清楚,如果有人可以帮助我,将不胜感激。

public void SignIn()
{
// Send an OpenID Connect sign-in request.
if (!Request.IsAuthenticated)
{
//Perform some action if user is successfully authenticated??
HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = "https://localhost:44309/DummyController/DummyAction" }, OpenIdConnectAuthenticationDefaults.AuthenticationType);
}
}

实现操作 RedirectToIdentityProvider

Notifications = new OpenIdConnectAuthenticationNotifications
{
RedirectToIdentityProvider = OnRedirectToIdentityProvider
}
private Task OnRedirectToIdentityProvider(RedirectToIdentityProviderNotification<OpenIdConnectMessage, 
OpenIdConnectAuthenticationOptions> arg)
{
throw new NotImplementedException();
}

最新更新