Comments (14)
@jwtLearner You can either use the URL or the String variant of the UrlJwkProvider
constructor (or any other Url Provider). If you use the first one, you'll have to input the full URL. But with the second one you just input the domain. Typically, the jwks file is stored in the /.well-known/jwks.json path. (again, by using the URL constructor you can change that).
Similar to what @ryber said, to use it with Auth0 you'd pass your account's domain. Say I have an account called "mytenant" then the domain would be "mytenant.auth0.com" or "https://mytenant.auth0.com", either will do. By appending the well known path we form the https://mytenant.auth0.com/.well-known/jwks.json url. That's the file that it's downloaded/cached and checked when your provider seeks for a given "kid".
Cheers.
from jwks-rsa-java.
@lbalmaceda Thanks, my problem is solved!!
//**********************************************************************
String jwks=AQUI LA URL
URL url = new URL(jwks);
JwkProvider provider = new UrlJwkProvider(url);
//*************************************************************************
from jwks-rsa-java.
The method that takes a string is just used to find the domain and then builds a well known URI based on that. The resulting URI may or may not be valid. For example if you are using authorization servers in Okta your jwk_uri will actually be something like
https://yourdomain.okta.com/oauth2/{auth-server-id}/v1/keys
;
If you know (or can get) the exact proper URI you should use the constructor that takes a URI object
BTW, I agree that the string constructor being "helpful" is weird. I would have expected it just takes the full URI
from jwks-rsa-java.
I have a similar problem, though it used to work fine. The JwkProvider creates the right url (I can navigate to it without issue).
The issue seems to be with the SSL handshake:
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Any reason why my jdk wouldn't be able to find valid certificate to *.eu.auth0.com
?
from jwks-rsa-java.
@cesartl Sounds weird, but definitely not a problem on the SDK itself. You mentioned you could access the URL just fine so it might have been a temporary issue with the backend. If the issue persists, please don't hesitate on dropping a message in https://support.auth0.com/
from jwks-rsa-java.
I'm experiencing the same issue. Does anyone know if this has been resolved or what one needs to do to correct it in the method.
from jwks-rsa-java.
I also have the same issue!
from jwks-rsa-java.
Quick fix: In my case the solution was to reinstall openjdk. I installed the newest version with brew on mac: brew cask install adoptopenjdk13
.
from jwks-rsa-java.
Have the same issue when using custom domain
from jwks-rsa-java.
@BoTime For this library, the concept of "custom domain" is not important. The provider class you instantiate must be given a valid URL to where the JWKS file is hosted.
from jwks-rsa-java.
I think it would be helpful for folks if the String constructor checked if the string was already configured with a .well-known and if it was just said "cool" and took it. I've had to explain this a few times internally at the company I work at and it seems to be a regular issue here.
from jwks-rsa-java.
@ryber we had this discussion with the team in the past and we agreed that the Javadoc of the class is self-explanatory.
The URL provider has 2 constructor. One that accepts a "URL" instance (for you to create as you wish) and another that accepts a "Domain" string. So Domain != "full URL"
from jwks-rsa-java.
I am using URL and defined the provider. I am getting this error when provider.get(jwt.getKeyId())
Cannot obtain jwks from url https://localhost:31300/.well-known/openid-configuration/jwks
. But I can access it through postman and get correct response.
from jwks-rsa-java.
@jinyanghuang I imagine the "https" in the URL could be making the certificate to be validated. Postman has a setting to disable the SSL verification, this library doesn't.
from jwks-rsa-java.
Related Issues (20)
- Remove commons-codec dependency
- 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
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.