Add proxy support to the ResourceRetriever

Issue #325 resolved
Artun Subasi created an issue

Problem description

Currently, if the Remote-JWK-Set URL (RemoteJWKSet) must be accessed using a (http/https) proxy, the proxy configuration is possible by

  1. using JVM-wide properties such as https.proxyHost.
  2. creating a custom ResourceRetriever, for example by extending the DefaultResourceRetriever

The first option is often not possible because this effects also other calls which are not supposed to be changed. The second option works but only by coping code from the DefaultResourceRetriever because the method com.nimbusds.jose.util.DefaultResourceRetriever#retrieveResource is not designed for extension. This produces redundant code.

Enhancement

  1. Refactor the com.nimbusds.jose.util.DefaultResourceRetriever#retrieveResourcemethod so that it is possible to override parts of it, particularly the part where the URL connection is opened.
  2. Either create a new concrete ResourceRetriever with proxy support, or add an optional proxy support to the DefaultResourceRetriever.

I would offer to create corresponding pull requests if you agree with the enhancements.

Comments (3)

  1. Log in to comment