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.

Resource Server (Java) fails with missing bean org.springframework.security.oauth2.jwt.JwtDecoder

See original GitHub issue

if

okta:
  oauth2:
    issuer: https://dev-xxxx.okta.com/oauth2/default

is not defined in application.yml (or via mvn -Dokta.oauth2.issuer=https://{yourOktaDomain}/oauth2/default)

a cryptic error message is generated. Can you enhance to produce a better message?

This is the error that is generated:

Method springSecurityFilterChain in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a bean of type ‘org.springframework.security.oauth2.jwt.JwtDecoder’ that could not be found.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bdemerscommented, Jun 7, 2021

Hi @woldie!

This should be fixed in the next release. We added tests (and fixes) to make sure that both the okta.oauth2.* and standard spring.security.oauth2.* properties work. (Note: the okta.oauth2 properties are just alias to the Spring props)

cc: @arvindkrishnakumar-okta

0reactions
woldiecommented, Jun 9, 2021

lovely, thank you!

On Mon, Jun 7, 2021 at 10:17 AM Brian Demers @.***> wrote:

Hi @woldie https://github.com/woldie!

This should be fixed in the next release. We added tests (and fixes) to make sure that both the okta.oauth2.* and standard spring.security.oauth2.* properties work. (Note: the okta.oauth2 properties are just alias to the Spring props)

cc: @arvindkrishnakumar-okta https://github.com/arvindkrishnakumar-okta

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/okta/samples-java-spring/issues/77#issuecomment-856116495, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOGQYHYSWZ6WM5IFHN6553TRT5J7ANCNFSM4S2IBJZA .

Read more comments on GitHub >

github_iconTop Results From Across the Web

JwtDecoder bean is not injected automatically while setting a ...
I found out that there was a problem with the gradle config of project I am working on (updated the question). The spring...
Read more >
OAuth 2.0 Resource Server JWT :: Spring Security
Resource Server uses JwtTimestampValidator to verify a token's validity window, and it can be configured with a clockSkew to alleviate the above problem:...
Read more >
spring-projects/spring-security - Gitter
but fails because of No qualifying bean of type 'org.springframework.security.oauth2.jwt.JwtDecoder' available . The bean normally gets populated by
Read more >
JWS + JWK in a Spring Security OAuth2 Application - Baeldung
For instance, a Resource Server uses the kid (Key Id) field present in the JWT to find the correct key in the JWK...
Read more >
How to use organization level authorization server in OKTA ...
beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.jwt.JwtDecoder]: Factory method 'jwtDecoder' threw ...
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