question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] App Gets stuck in "Client Request Loop" due to User.ReadBasic.All scope

See original GitHub issue

Logs and Network traces I will work on getting logs.

Which Version of MSAL are you using ? MSAL 4.18 works without issue, but upgrading beyond 4.18 causes this exception loop to occur.

Platform UWP

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)

Other? - please describe;

Is this a new or existing app? The app (Ink Calendar) is in production, I haven’t upgraded MSAL, but started seeing this issue when upgrading beyond 4.18

Repro


try
{
    authResult = await PublicClientApp.AcquireTokenSilent(scopes, firstAccount)
                                                     .ExecuteAsync();
}
catch (MsalUiRequiredException ex)
{
    Debug.WriteLine($"MsalUiRequiredException: {ex.Message}");

    // This is where the looping failure occurs: ↓
    authResult = await PublicClientApp.AcquireTokenInteractive(scopes)
                                                  .ExecuteAsync()
                                                  .ConfigureAwait(false);
}
return authResult.AccessToken;



Expected behavior I expect versions beyond 4.18 to work as well as 4.18 does.

Actual behavior When the app tries to upload the ink file which is being saved there is an exception thrown “the file is in use by another process” then stops and tries again later. When upgrading MSAL beyond 4.18 this exception throws the MS Graph identity into a loop which asks the user to login again, over and over and over. Closing the app is the only way to stop the loop.

Possible Solution Stay on 4.18

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
bgavrilMScommented, Jan 25, 2021

That makes sense. I don’t know the Graph API that well, but generally the delegated scopes that end in “.All” probably don’t work with Microsoft users. AAD will not issue you a token that allows you to read the basic info of all Microsoft users 😃

I’m just wondering how we can change MSAL to showcase this, the current experience, where you get looping errors, is bad - it’s bad for you because you only discover it late and is bad for AAD because you inadvertently hammer it with requests.

1reaction
bgavrilMScommented, Jan 21, 2021

@TheJoeFin - I added more logging to MSAL and produced a package. Please note that the package is signed by Microsoft.

Microsoft.Identity.Client.4.25.1-internal.nupkg.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can an app use User.ReadBasic.All scope to retrieve any ...
I am trying to write an app that retrieves any user info. allowed given ... All scope is available for Delegated (work or...
Read more >
User.ReadBasic.All scope not granted, v2
I'm trying to request the following 3 scopes for oauth from the v2 Azure directory: user. read, user. readbasic.
Read more >
MSGraphClient does not get approved scopes as ...
If I try the exact same in the Graph Explorer everything seems to be ok. Steps to Reproduce. const client: MSGraphClient = this.context....
Read more >
Fixing the "Loading Microsoft Teams" infinite loop
Solve the "Loading Microsoft Teams..." dialog that gets stuck in an infinite loop.
Read more >
Just what *is* the /.default scope in the Microsoft identity ...
If the user does allow those permissions, it means your application is going to have permission to read a user's files, even if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found