Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle AADSTS50105 and other login failures on client #5320

Closed
agrahamwize opened this issue Oct 20, 2022 · 8 comments
Closed

Handle AADSTS50105 and other login failures on client #5320

agrahamwize opened this issue Oct 20, 2022 · 8 comments
Assignees
Labels
answered Question has received "first qualified response" msal-browser Related to msal-browser package msal-react Related to @azure/msal-react public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@agrahamwize
Copy link

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

2.28.3

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

1.4.7

Public or Confidential Client?

Public

Description

Hi there,

At times, we have users receive the AADSTS50105 error message for their login request because the client they are logging into does not contain any role assignments and we are blocking logins with no role assignments. However, this message by default provides sensitive information to the end user and our government client would prefer the message/functionality be far more general so as not to expose client ids, etc.

It does not appear that there is a corresponding callback event to intercept this message via addEventCallback or handleRedirectPromise. I need to identify a way to intercept this error and avoid presenting the default message.

Any guidance would be appreciated.

Thanks!
Adam.g

MSAL Configuration

auth: {
        authority: "tenantId",
        clientId: "clientId",
        redirectUri: document.getElementById('root').baseURI
    },
    cache: {
        cacheLocation: "localStorage"
    }

Relevant Code Snippets

No response

Identity Provider

Azure AD / MSA

Source

External (Customer)

@agrahamwize agrahamwize added the question Customer is asking for a clarification, use case or information. label Oct 20, 2022
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Oct 20, 2022
@github-actions github-actions bot added msal-browser Related to msal-browser package msal-react Related to @azure/msal-react public-client Issues regarding PublicClientApplications labels Oct 20, 2022
@ghost ghost assigned sameerag Oct 20, 2022
@sameerag
Copy link
Member

@agrahamwize Can you please share a screenshot of the error you are seeing? You can grey out the confidential parts if needed or email me here.

@ghost ghost added answered Question has received "first qualified response" Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Oct 21, 2022
@agrahamwize
Copy link
Author

Hey, absolutely. Included is the more full text and display for the error when it is encountered.

Screenshot (1)

@ghost ghost added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels Oct 21, 2022
@ghost
Copy link

ghost commented Oct 26, 2022

This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @sameerag please follow up.

@sameerag
Copy link
Member

@agrahamwize AAD adds this error and they do not relay that to msal to handle the message. This has to be handled by the service teams. Can you please file an issue with developer support (here)[https://learn.microsoft.com/en-us/azure/active-directory/develop/developer-support-help-options)?

I will ping the internal service teams to track this too, however we cannot fix this from MSAL.

If the support channel does not help, please reach out to me (my email is in my profile) and I can redirect to them as needed.

Closing this.

@ghost ghost removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Oct 27, 2022
@agrahamwize
Copy link
Author

Thanks @sameerag. I have a support ticket logged with them, 2211170040004474. I will let you know if there are issues working with them, per your guidance.

Thanks again!
Adam.g

@jlcCognizant
Copy link

Hi @agrahamwize. I would like to know if there ever has been a solution Microsoft gave you that works (aside from configuring it in Azure itself which is not really my use case as I need to redirect a user to another page if this error appears).

@agrahamwize
Copy link
Author

Hi @agrahamwize. I would like to know if there ever has been a solution Microsoft gave you that works (aside from configuring it in Azure itself which is not really my use case as I need to redirect a user to another page if this error appears).

Unfortunately not. Sounds like this happens internally in their system and is both, a) not a callback sort of notification condition and, b) not something that is returned to the client in the overall oauth response.

I reckon its primary function is to make it easy to fully block apps that Azure is doing SSO for versus handling role-based authorization for custom apps. I guess the expectation is for the developer to handle that on their end instead.

In your case, that would look like, 1) turning off the role assignment requirement, 2) Checking the roles returned in a successful authentication, and 3) if no roles (or maybe default access role?), redirect on the client side.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Aug 22, 2023
@agrahamwize
Copy link
Author

MS confirmed, no current capability and no plan for implementing.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Question has received "first qualified response" msal-browser Related to msal-browser package msal-react Related to @azure/msal-react public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

3 participants