question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Builder for JwtDecoder

See original GitHub issue

It would be nice to be able to specify validators, converters, etc. without needing to downcast to the implementation.

Current Behavior

To configure any of these, I first use a factory method, and then I need to downcast to NimbusJwtDecoder to call its setters:

JwtDecoder decoder = JwtDecoders.fromOidcIssuerLocation(issuer);
((NimbusJwtDecoder) decoder).setJwtValidator(validator);
...

Expected Behavior

For now, this ticket is just to get the conversation started. But something like JwtDecoderBuilder might be nice:

JwtDecoder decoder = JwtDecoders
    .withOidcIssuerLocation(issuer).jwtValidator(validator).build();

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jzheauxcommented, Dec 7, 2018

@izeye no worries! Your help is always appreciated.

0reactions
jzheauxcommented, Apr 17, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

OAuth 2.0 Resource Server JWT :: Spring Security
For greater power, though, we can use a builder that ships with NimbusReactiveJwtDecoder : Java. Kotlin. @Bean ReactiveJwtDecoder jwtDecoder() { return ...
Read more >
Allow customization of restOperations for JwtDecoder built ...
JwkSetUriJwtDecoderBuilder allows customizing the restOperations that is used to make calls to the authorization server.
Read more >
Confused about Spring Security Jwt token builder - why do I ...
JwtDecoder . In my case, I have a duel security config setup that accepts tokens from Cognito and my own JWT provider which...
Read more >
org.springframework.security.oauth2.jwt java code examples
@Bean NimbusJwtDecoder jwtDecoder() { JWTProcessor<SecurityContext> jwtProcessor = JwtProcessors.withJwkSetUri("https://example.org/.well-known/jwks.json") ...
Read more >
JSON Web Tokens - jwt.io
JSON Web Token (JWT) is a compact URL-safe means of representing claims to be transferred between two parties. The claims in a JWT...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found