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] MSAL on UWP not working with Http Proxy (WAB does not take OS proxy)

See original GitHub issue
  • Microsoft.Identity.Client v4.5.1 (MSAL)
  • UWP (Windows 10 & Windows IoT Core)

When routing traffic through a proxy server desktop/mobile interactive authentication is having the issue of our app that is currently in production.

Repro

  1. Install & Run a proxy server (CCProxy 8.0)
  2. Configure Windows to use CCProxy as the main proxy for the OS.
  3. Run application and attempt to login with the MSAL library.
_azureAdClientApplication = 
    PublicClientApplicationBuilder.Create(appConfig.AuthScheme.ApiKey)
    .WithAuthority(appConfig.AuthScheme.Authority)
    .Build();

var interactiveBuilder = _azureAdClientApplication.AcquireTokenInteractive(new[] { appConfig.AuthScheme.Scope });
var result = await interactiveBuilder.ExecuteAsync(default(CancellationToken));

Expected behavior When the call to ExecuteAsync is made, the user would see the first page in the Azure AD login workflow. This works when there is no proxy server.

Actual behavior With a proxy configured, the auth dialog display this message: “We can’t connect to the service you need right now. Check your network connection or try this again later.” The only option I have is to close it.

The exception I get has the following message: Web Authentication Broker (WAB) authentication failed. To collect WAB logs, please follow https://aka.ms/msal-net-wab-logs

Its inner exception is a FileNotFoundException.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
YAJeffcommented, Oct 29, 2019

Thanks for the recommendations.

  1. I’m not sure how this would work considering the IMsalHttpClientFactory is expecting the System.Net.Http.HttpClient type and won’t build if I use the one you suggested.

  2. I saw this same note for the WPF version of MSAL. If you could reach out, that would be appreciated.

0reactions
jmprieurcommented, Nov 13, 2019

Closing as an external issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Web Application Proxy
This section provides troubleshooting procedures for Web Application Proxy including event explanations and solutions. There are three ...
Read more >
Azure App Proxy and SPA application using MSAL causes ...
1 Answer. The error usually occurs if the application is not configured as SPA. If still the issue persists, make sure the application...
Read more >
Azure ad 401 unauthorized. xml with the same ID, but when ...
Azure ad 401 unauthorized. xml with the same ID, but when deploying the Maven task fails with 401 (Unauthorized). You can right-click on...
Read more >
How to set up Proxy for Windows Store apps in ...
Learn how to enable or configure Proxy Server for Store or UWP apps in Windows 11/10 using the Netsh command, Proxy settings or...
Read more >
May 24, 2023 Hosts can enable the Q&A feature in meetings ...
Zoom Rooms have proxy capability when Zoom Phone is enabled and configured within the web portal. Previously, only the extension was displayed.
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