Giter VIP home page Giter VIP logo

Comments (8)

apgv avatar apgv commented on August 20, 2024 1

That's not completely correct. Notice the new URL() passed as parameter to UrlJwkProvider. I have used this for the same reason as you with Keycloak as a provider which has a different URL to the jwks. As the README states : "Also it can load jwks.json file from any given Url (even to a local file in your filesystem)."

from jwks-rsa-java.

onelapahead avatar onelapahead commented on August 20, 2024 1

Perfect! Thanks, that makes a lot more sense.

from jwks-rsa-java.

lbalmaceda avatar lbalmaceda commented on August 20, 2024

That's right. You need to use the builder class. To achieve the snippet that you posted above you would do this:

JwkProvider provider = new JwkProviderBuilder("https://samples.auth0.com/")
   .rateLimited(10, 1, TimeUnit.MINUTES)
   .build();

But if you want to specify a connect/read timeout (I think you forgot to demonstrate that on the snippet) you can't do it today. I'd add a method to the builder rather than changing the visibility of the bucket implementation. I'll leave this open to track it.

from jwks-rsa-java.

jmferland avatar jmferland commented on August 20, 2024

Even better. Sounds great, thank you!

from jwks-rsa-java.

onelapahead avatar onelapahead commented on August 20, 2024

So I wrote a simple JwkProvider for fetching our JWKS since the our OIDC provider's JWKS endpoint is not /.well-known/jwks.json. Since the builder does not have a constructor which takes in a JwkProvider, I was going to add the RateLimitJwkProvider and GuavaCachedJwkProvider manually like the README demonstrates.

Since that is not possible, I'll try to extend the JwkProviderBuilder class and override the build method to get around this but this is very annoying! Can the BucketImpl either be exposed, or should I request in a separate issue a new constructor be added to the builder?

from jwks-rsa-java.

apgv avatar apgv commented on August 20, 2024

@brix4dayz: You can do to this with UrlJwkProvider. Code copied from README:

JwkProvider provider = new UrlJwkProvider(new URL("https://samples.auth0.com/"));

from jwks-rsa-java.

onelapahead avatar onelapahead commented on August 20, 2024

Unfortunately not, the UrlJwkProvider only looks for JWKS at /.well-known/jwks.json (which I think should customizable as well). We're not using Auth0 as our OIDC provider but we thought your lib's were the nicest to use.

As a result, it was easier to write a custom JwkProvider that used our Feign client to retrieve the JWKS. I opened this PR to get the conversation around adding custom provider support to the builder started: #47

from jwks-rsa-java.

stale avatar stale commented on August 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

from jwks-rsa-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.