2

We use the ItFoxtec library for SAML authentication to Azure Active Directory with an application written in C# and the .Net Core 6 framework. The library works very well, and we have had no problems.

In production, we have to access the server for IdPMetadata and SingleSignOnDestination via a proxy.

We cannot change the server settings and only have to act on the application.

We tried adding this proxy configuration in appsettings.json

"ProxySettings": { "Address": "server address:port", "BypassOnLocal": true, "UseDefaultCredentials": false },

but it doesn't work. We can configure the HttpClient service in startup.cs using ConfigurePrimaryHttpMessageHandler() but this is available only for named clients.

How can we configure such a proxy so the library can use it?

Thanks

Planti
  • 21
  • 3

1 Answers1

1

You can configure a HttpClient name like this:

entityDescriptor.ReadIdPSsoDescriptorFromUrlAsync(httpClientFactory, new Uri(Configuration["Saml2:IdPMetadata"]), httpClientName: "my-http-client-name").GetAwaiter().GetResult();

Code from the sample: https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/master/test/TestWebAppCore/Startup.cs#L43C81-L43C81

Anders Revsgaard
  • 3,636
  • 1
  • 9
  • 25