Hello,
I know that using openIdConnect you can do something like that to handle when the user that is connecting isn’t assigned to the application :
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
// Okta configuration...
Notifications = new OpenIdConnectAuthenticationNotifications
{
AuthenticationFailed = async n =>
{
if (string.Equals(n.ProtocolMessage.Error, "access_denied", StringComparison.Ordinal))
{
n.HandleResponse();
n.Response.Redirect("/Error/401");
}
}
},
});
How would I do something similar if my syntax uses UseOktaMvc instead of UseOpenIdConnectAuthentication
app.UseOktaMvc(new OktaMvcOptions()
{
OktaDomain = ConfigurationManager.AppSettings["okta:OktaDomain"],
ClientId = ConfigurationManager.AppSettings["okta:ClientId"],
ClientSecret = ConfigurationManager.AppSettings["okta:ClientSecret"],
RedirectUri = ConfigurationManager.AppSettings["okta:RedirectUri"],
PostLogoutRedirectUri = ConfigurationManager.AppSettings["okta:PostLogoutRedirectUri"],
Scope = new List<string> { "openid", "profile", "email" },
AuthorizationServerId = string.Empty,
LoginMode = LoginMode.OktaHosted
});
Thnak you very much,
Vincent