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] Azure AD B2C authentication fails on UWP

See original GitHub issue

Logs and network traces Without logs or traces, it is unlikely that the team can investigate your issue. Capturing logs and network traces is described in Logging wiki.

Which version of MSAL.NET are you using? 4.53.0

Platform UWP with Xamarin.Forms

What authentication flow has the issue?

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

Is this a new or existing app? The app is in production, I haven’t upgraded MSAL, but started seeing this issue.

Repro

  1. Clone the sample project
  2. Run and try to sign in

Expected behavior A successful login

Actual behavior First of all, we receive “We can’t connect to the service you need right now. Check your network connection or try this again later” error in the opened browser window. When open the Windows event log I see the following error

AuthHost encountered a navigation error at URL: <https://msoisalesstaging.b2clogin.com/tfp/msoisalesstaging.onmicrosoft.com/b2c_1_signin/oauth2/v2.0/authorize?scope=offline_access+openid+https%3A%2F%2Fmsoisalesstaging.onmicrosoft.com%2Fmsoisales%2Fmongodb-realm-sync+profile&response_type=code&client_id=a0789689-6dd6-4f8f-bacd-bef3bfbfcf4d&redirect_uri=ms-app%3A%2F%2Fs-1-15-2-1207448870-1919239748-1716570430-323877461-3067963371-1728433620-2282859050%2F&client-request-id=9de92785-4b16-4594-987b-caef9cb887aa&x-client-SKU=MSAL.UAP&x-client-Ver=4.49.1.0&x-client-CPU=x64&x-client-OS=Windows+10&x-client-DM=Blade+15+Advanced+Model+%28Early+2021%29+-+RZ09-036&prompt=select_account&code_challenge=3oVCkz54nCG7AOVClZOuAfrvNc-eegWjdgJlBSry9QY&code_challenge_method=S256&state=ca6fe89f-9c45-4879-828e-667e0700c9d67e5da2b1-f2d3-44e1-81f6-9f50c3337d11&client_info=1> with StatusCode: 0x800C000D.

Additional context / logs / screenshots / links to code

azure_ad_b2c_uwp_logs.zip

I have search for all of the possible suggested solutions about this issue such as

  1. Adding enterprise network capabilities
  2. Making sure the redirect URL is explicitly mentioned
  3. Making sure that we use recommended user flow

None of the above helped to solve the problem. The problem started happening in our production app without any changes, and currently, none of our users can log in, causing essentially global p1 for us. Also, the sample I shared is the official B2C sample for Xamarin.Forms and when I put our clientID and sign in process properties into the sample I see the same error. Probably something has changed that we are not aware.

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Reactions:2
  • Comments:26 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
bgavrilMScommented, Apr 21, 2023

Folks, there will be some official communication about this incident and the mitigation coming out soon, such as time details, addressed directly to the affected subscription admins. There should not be anything that needs doing from anyone on this thread or anyone using UWP + B2C.

2reactions
bgavrilMScommented, Apr 21, 2023

Update on this: currently, the rollback is happening on a tenant by tenant basis. @charlesroddie - your tenant is being reverted now, it’ll take time to propagate to all regions.

Will all tenants be rolled back eventually?

I will have an update on this shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin Forms UWP Azure B2C IdentityProvider Login failed
In my external app, sometimes its possible to login via the identity provider if I first login with local account ⇒ logout and...
Read more >
querystring is too long error in uwp b2c app · Issue #2984
While authenticating with our Azure AD SSO we get an error in the app which says "Requested query string too long".
Read more >
Azure AD authentication & authorization error codes
AuthenticationFailed - Authentication failed for one of the following reasons: The subject name of the signing certificate isn't authorized; A ...
Read more >
Azure AD authentication troubleshooting: Known problems ...
This error happens due to an undocumented design on Microsoft's part in combination with the UW configuration required to support Autopilot.
Read more >
Connect Your App to Microsoft Azure Active Directory
You may have accidentally registered your app in the wrong Azure AD directory (or not have created an Azure AD directory at all...
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