Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No proxy configuration to get MetadataLocation #1220

Open
apondman opened this issue Jun 28, 2020 · 3 comments
Open

No proxy configuration to get MetadataLocation #1220

apondman opened this issue Jun 28, 2020 · 3 comments

Comments

@apondman
Copy link

Information

  1. What nuget packages are you using

Sustainsys.Saml2.AspNetCore2, version 2.7.0

  1. What is the expected behaviour

Connect to the given MetadataLocation and retrieve the metadata for an idp.

  1. What happens instead. In the case of an exception, this includes the exception typ, complete exception message (personal information may be redacted) and a stack trace.

it's not possible to setup a proxy - on certain environments we can't directly connect to the metadata location because we need to use a proxy. Looking a the codebase the request is done using WebClient with no possible hook to setup additional proxy information.

@apondman apondman added the bug label Jun 28, 2020
@spaasis
Copy link

spaasis commented Dec 14, 2020

We got bit by this as well. @apondman did you manage to work around this?

@apondman
Copy link
Author

No unfortunately.. I think we had some sort of metadata mirror setup for a while and I was about to fork and do some changes myself but "luckily" our project switched to an environment where it was no longer necessary to connect via proxy.

@spaasis
Copy link

spaasis commented Dec 15, 2020

I figured out a workaround for our situation at least.
The WebClient Proxy needs to be manually set:
ClientServiceWebClient:

        public ClientCertificateWebClient(IEnumerable<X509Certificate2> certificates) {
            Proxy = new WebProxy("your.proxy", 25);
...

MetadataLoader:

        private static MetadataBase Load(
            string metadataLocation,
...
            using (WebClient client = new WebClient() { Proxy = new WebProxy("your.proxy", 25) })
...

For some reason the environment default proxy did not get set automatically, though apparently it should, so we have to manually set it.

This worked for our case, YMMV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants