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.

"AADSTS50155: Device is not authenticated" after ~3 months with "phone sign-in"

See original GitHub issue

Which Version of MSAL are you using ? Microsoft.Identity.Client 3.0.8

Platform UWP

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)
  • Web App
    • Authorization code
    • OBO
  • Web API
    • OBO

Is this a new or existing app? Existing. I’ve come across this error in February, and resolved it by entering a password. I’m unsure if this falls in the MSAL bucket or AzureAD bucket. I don’t know who to complain to. https://stackoverflow.com/questions/54730227/aadsts50155-device-is-not-authenticated

Repro

try
{
    msalar = await pca.AcquireTokenSilent(scopes, user)
                  .WithAuthority(authority)
                  .ExecuteAsync();
}
catch (MsalUiRequiredException)
{
    msalar = await pca.AcquireTokenInteractive(scopes)
                  .WithAuthority(authority)
                  .WithAccount(user)
                  .WithExtraScopesToConsent(graphscopes)
                  .ExecuteAsync();
}

Expected behavior Code should work with AzureAD passwordless (phone sign-in). (https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-authentication-phone-sign-in)

Actual behavior Roughly 3 months after signing in with a password then just using my iPhone for phone sign-in, I get a AADSTS50155 error. Possible Solution Prompt user to use a password if AADSTS50155 is encountered.

    msalar = await pca.AcquireTokenInteractive(scopes)
                .WithAuthority(authority)
                .WithAccount(user)
                .WithExtraScopesToConsent(graphscopes)
                //I think this is not encouraged, but does this prompt password?
                .WithPrompt(Prompt.ForceLogin)
                .ExecuteAsync();

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmprieurcommented, Jun 4, 2019

@myokeeh It was a bug on our side (service), this error code should never have been surfaced in this scenario and there is nothing you could do in you app to fix the issue on you end.

1reaction
jmprieurcommented, May 30, 2019

@myokeeh There is an issue on the Azure AD (service) side, which is being fixed. We’ll update you when we know more about the ETA for deployment publicly

Read more comments on GitHub >

github_iconTop Results From Across the Web

User can't sign in to device - error 50155
It's possible to log in to the device with another account, but receive the "Device authentication failed" when using a different user.
Read more >
Azure AD: 50155 Device authentication failed
1 Answer. If it is an Hybrid Azure AD join then Verify that the device is synced from cloud to on-premises or is...
Read more >
AAD Join Type : r/Intune
Hello. We have a test device that is currently marked as non-compliant for a newly created compliance policy. Even though it is not...
Read more >
Device authentication failed for this user azure
We only use the apps in azure (office 365 etc) and do not have a hybrid Device authentication failed for this user. Error...
Read more >
Azure AD authentication troubleshooting: Known problems ...
You may be experiencing sign in or access issues related to Office 365 or other applications that leverage the UW Azure Active Directory ......
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