I configured my web application to use Azure Auth login. Everything is working fine, and users can log in if they are not already logged in to Azure.
My problem is that when a user is already logged into Azure of Office 365 and they are browsing my site, they get this error below. I understand what the error means, but I want to know if there is a way to redirect to another URL (on my site) if this problem occurs. Here is the error: 
This is my startup code to configure OpenId Auth:
app.UseOpenIdConnectAuthentication( new OpenIdConnectAuthenticationOptions { ClientId = Configuration.clientID, Authority = authenticationAuthority, PostLogoutRedirectUri = Configuration.logoutRedirectURL, Notifications = new OpenIdConnectAuthenticationNotifications { AuthenticationFailed = context => { context.HandleResponse(); context.Response.Redirect("/Unauthorised.aspx?message=" + context.Exception.Message); return Task.FromResult(0); } } });
openid azure azure-web-sites azure-active-directory
Fox
source share