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

getAccountByUsername returns null on IOS #5617

Closed
KennethBWSong opened this issue Jan 28, 2023 · 20 comments
Closed

getAccountByUsername returns null on IOS #5617

KennethBWSong opened this issue Jan 28, 2023 · 20 comments
Assignees
Labels
answered Question has received "first qualified response" bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package Needs: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@KennethBWSong
Copy link

KennethBWSong commented Jan 28, 2023

Core Library

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

Core Library Version

2.32.2

Wrapper Library

Not Applicable

Wrapper Library Version

None

Public or Confidential Client?

Public

Description

We have a Teams Tab app using msal-browser for SSO. When user first trigger SSO in this app, SSO works properly. If the user logout and login Teams, and we found user will be asked to login in popup login page again on Teams IOS to get user profile, while the same app on Windows can get user profile directly. When debugging, we found that the root cause should be getAccountByUsername returns null on IOS, while returns an account object on Windows.
You can find sample app here.
Related bug here.

Error Message

No response

Msal Logs

No response

MSAL Configuration

{
  auth: {
    clientId: clientId,
    authority: `https://login.microsoftonline.com/${tenantId}`,
    navigateToLoginRequestUrl: false
  },
  cache: {
    cacheLocation: "localStorage",
  },
}

Relevant Code Snippets

try {
  const account = msalInstance.getAccountByUsername(loginHint!);
  const scopesRequestForAcquireTokenSilent = {
    scopes: scopesArray,
    account: account,
    redirectUri: redirectUri,
  };
  tokenResponse = await this.msalInstance!.acquireTokenSilent(
    scopesRequestForAcquireTokenSilent
  );
} catch (error: any) {
  // error handling
}

Reproduction Steps

  1. Provision and deploy SSO Tab
  2. Open the app on Teams IOS, click on Authorization and login in pop-up page, you can get user profile now
  3. Logout and login Teams IOS, open the app again and you need to login again in pop-up page

Expected Behavior

Should have same behavior as on Windows which can directly get user profile when login again.

Identity Provider

Azure AD / MSA

Browsers Affected (Select all that apply)

Edge

Regression

No response

Source

Internal (Microsoft)

@KennethBWSong KennethBWSong added bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels Jan 28, 2023
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Jan 28, 2023
@github-actions github-actions bot added msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels Jan 28, 2023
@ghost ghost assigned sameerag Jan 28, 2023
@sameerag
Copy link
Member

@KennethBWSong Can you please provide the MSAL logs enabling the "verbose" mode? Instructions can be found 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 Jan 30, 2023
@KennethBWSong
Copy link
Author

@sameerag Do you have any idea how I can check the logs on IOS?

@ghost ghost added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels Jan 30, 2023
@sameerag
Copy link
Member

Teams has a unique auth process on mobile. Is this flow browser in iOS -> Teams app in iOS SSO?

@ghost ghost added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Jan 31, 2023
@KennethBWSong
Copy link
Author

It is in an Teams Tab app on IOS. Actually, this flow works on Teams client as well as Teams Web client, and only have this issue on Teams IOS client.

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

ghost commented Feb 5, 2023

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

@SLdragon
Copy link

@sameerag , any update?

@pjpraveenjayakumar
Copy link

pjpraveenjayakumar commented Feb 10, 2023

@SLdragon , @sameerag FYI, this issue is happening with both iOS and Android mobile platforms.

Version [iOS 16.2 Android 11]

@sameerag
Copy link
Member

@SLdragon @pjpraveenjayakumar The issue is still under investigation. We heard from a few other folks that mobile platforms have an issue with MSAL JS. We do not develop for mobile but expect the mobile browsers work as web browsers too.

As the other issue mentions, this could be something to do with webOS not allowing us to access the memory. Will keep you folks posted.

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

ghost commented Feb 16, 2023

@KennethBWSong This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has been resolved please let us know by closing the issue. If your issue has not been resolved please leave a comment to keep this open. It will be closed automatically in 7 days if it remains stale.

@ghost ghost added the no-issue-activity Issue author has not responded in 5 days label Feb 16, 2023
@SLdragon
Copy link

Thanks, if you have any update, please let we know.

@benjblack
Copy link

benjblack commented Feb 22, 2023

Having the same issue (#5667). This seems like a major bug / limitation on multiple mobile browsers, both iOS and Android (unless we are missing something configuration related).

@ghost ghost closed this as completed Mar 2, 2023
@KennethBWSong
Copy link
Author

@sameerag Please let us know in this thread if you have any update, thx!

@ghost ghost reopened this Mar 2, 2023
@ghost ghost added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed no-issue-activity Issue author has not responded in 5 days Needs: Author Feedback Awaiting response from issue author labels Mar 2, 2023
@SLdragon
Copy link

SLdragon commented Mar 6, 2023

@sameerag Any update?

@ghost
Copy link

ghost commented Mar 11, 2023

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

1 similar comment
@ghost
Copy link

ghost commented Mar 16, 2023

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

sameerag commented Mar 16, 2023

@SLdragon We officially do not support mobile browsers though MSAL JS is expected to work as long as they work as web browsers (in supporting popup vs redirect, browser storage etc). I would appreciate if anyone who can repro this issue can provide the network trace and verbose logs (instructions here) for me to check what may be happening.

Please also share the cache status in a working case vs non-working case.

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

ghost commented Mar 22, 2023

@KennethBWSong This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has been resolved please let us know by closing the issue. If your issue has not been resolved please leave a comment to keep this open. It will be closed automatically in 7 days if it remains stale.

@ghost ghost added the no-issue-activity Issue author has not responded in 5 days label Mar 22, 2023
@ghost ghost closed this as completed Mar 29, 2023
@andresgd7
Copy link

any news?

@ThomasPe
Copy link

ThomasPe commented Feb 3, 2024

this is not solved!

@keeth
Copy link

keeth commented Feb 8, 2024

This is affecting me too. It is hard to trace since it's happening inside the iOS Teams app, which doesn't provide DevTools / Remote Debugging support as far as I know.

I am able to login interactively, but nothing is stored to sessionStorage, so silent token acquisition always fails. Works fine on the Desktop Teams client and on web Teams.

This issue was closed.
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" bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package Needs: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days 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

8 participants