This project has moved. For the latest updates, please go here.

Redirect on authentication failed

Oct 11, 2014 at 5:54 PM
Edited Oct 11, 2014 at 6:05 PM
I'm using the WsFederationAuthentication with Azure AD to authenticate my users and need to redirect the user to my own "unauthorized" page. Currently if the user is already logged in with a different set of credentials (with their Live ID for example, instead of my issued ID) they get stuck at the default WAAD "not authorized" page with no way to sign out or return to where they were initially.

I'm assuming this can be handled via AuthenticationFailed notification, but could not locate any documentation for it. Am I correct in my approach? Is there any sample code/documentation available?

Basically I'm trying to handle this message:
AADSTS50020: User account '<account removed>' from external identity provider '' is not supported for application '<application name removed>'. Please sign out and sign in again with an Azure Active Directory user account.
Jan 3, 2015 at 8:01 PM
I have the same question.
After logging in with credentials from another Tenant, user gets stuck at the default WAAD "not authorized" page. And after opening the application one more time user still gets to this page.
I've already tried AuthenticationFailed notification, no result.
Feb 11, 2015 at 4:11 PM
Edited Feb 11, 2015 at 4:17 PM
This issue went away once I switched to OpenID (on top of WAAD) instead of WsFederation.