Comments (8)
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.
Perfect! Thanks, that makes a lot more sense.
from jwks-rsa-java.
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.
Even better. Sounds great, thank you!
from jwks-rsa-java.
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.
@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.
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.
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)
- Get rid of guava HOT 5
- Breaking changes HOT 4
- Add possibility to configure jwks endpoint path. HOT 2
- Base 64 decoder changed HOT 2
- Add connect and read timeout to JwkProviderBuilder
- Outdated Guava causing binary incompatibility HOT 4
- UrlJwkProvider failed to load keys and throws ssl handshake exception HOT 1
- Retrieval of Jwk token is blocking HOT 3
- EC key invalid decoding HOT 5
- com.auth0.jwk.Jwk#getPublicKey recreates PublicKey object on every access HOT 7
- com.auth0.jwk.NetworkException: Cannot obtain jwks from url HOT 8
- NetworkException not being thrown when using cached JwkProviderBuilder instead of directly UrlJwkProvider HOT 3
- To support higher TLS Version HOT 2
- Bad design of jwks cache HOT 1
- Readme.md improvement HOT 2
- Ability to drop cache HOT 2
- Why isn't there a constructor that takes a jwt token as a parameter? HOT 3
- Allow URL request without well-know suffix HOT 2
- com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.14.3 requires Jackson Databind version >= 2.14.0 and < 2.15.0 - Found jackson-databind version 2.15.0 HOT 1
- Implement support for outbound HTTP Proxy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwks-rsa-java.