Share via

Configure redirect for failed silent SAML login in Azure AD

Artu Sa 26 Reputation points
2022-10-10T07:38:57.497+00:00

When a silent SAML auth request against Azure Active Directory fails, the result is bad requests. The error is "AADSTS50058: A silent sign-in request was sent but no user is signed in".

We were migrating from ADFS to Azure AD. With ADFS, instead of bad request, we received back a SAML response (with response status urn:oasis:names:tc:SAML:2.0:status:NoPassive).

My question is, can we achieve something similar with Azure AD? Even if we cannot have a SAML response, how could we configure a redirect URI when AADSTS50058 error occurs?

Thanks in advance.

Microsoft Security | Active Directory Federation Services
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,396 Reputation points Microsoft Employee Moderator
    2022-10-10T23:55:42.353+00:00

    Hi @Artu Sa ,

    Yes, you can catch this error by making an acquireToken call, checking for the error code in the callback, and then redirecting the user to log back in again if you catch that error. So you would handle the acquireToken failure and invoke the acquireTokenRedirect. There is an example of this implementation here. There is also an iframe implementation example added here using a message handler to respond to window messages.

    Note also that this error can occur if third party cookies have been disabled in your browser, and you can re-enable third party cookies in your browser to prevent this error from occurring in the first place. If you are using Chrome in incognito mode, the default settings it block third-party cookies.

    Additional reference: AADSTS50058 error in Javascript.

    Let me know if you have further questions.

    -

    If the information helped you, please Accept the answer. This will help us and other community members as well.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.