-
Notifications
You must be signed in to change notification settings - Fork 0
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
JWKS demo #63
JWKS demo #63
Conversation
JaCoCo code coverage report - scala:2.12.17
|
Does it support JWKS refresh out of the box? If yes, how often does it do that? |
Excellent question! It is refreshed every 5 mins, see https://bitbucket.org/connect2id/nimbus-jose-jwt/src/9.24.4/src/main/java/com/nimbusds/jose/jwk/source/DefaultJWKSetCache.java I've just tried it out myself |
I looked it over and I agree that it would be useful to have as an addition. I don't mind the Nimbus JOSE JWT library that much, considering we are hopefully looking forward to replacing it eventually. I have created a small update on @kevinwallimann's work in #64 I have tried it to the point that the new endpoint at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, checked out, ran tests this time.
service/src/test/scala/za/co/absa/loginsvc/rest/service/JWTServiceTest.scala
Outdated
Show resolved
Hide resolved
…viceTest.scala Co-authored-by: Daniel K <[email protected]>
* jwks: kid added * jwks: kid test added * jwks: kid changed to be a public rsakey thumprint
Closes #62
This is just a draft to demonstrate the JWKS endpoint for the public key. JWKS is a standard defined in https://datatracker.ietf.org/doc/html/rfc7517 and is implemented e.g. by
org.springframework.boot:spring-boot-starter-oauth2-resource-server
. Resource servers can just add this dependency instead of implementing fetching and parsing the endpoint themselves. Instead, it's just one line of application configuration, i.e.spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://localhost:9090/token/public-key-jwks
and a few lines in the security configuration (which you need for any JWT security)
Problems
The following issues need to be discussed before merging