I have this problem:
*************************** APPLICATION FAILED TO START
Description:
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.
Action:
Consider defining a bean of type 'org.springframework.security.oauth2.jwt.JwtDecoder' in your configuration.
If I add this to my spring boot project, everything works as intended:
@Value("${spring.security.oauth2.keycloak.jwt.issuer-uri}")
private String issuerUri;
@Bean
public JwtDecoder jwtDecoder() {
return JwtDecoders.fromOidcIssuerLocation(issuerUri);
}
My application.properties:
spring.security.oauth2.keycloak.jwt.issuer-uri=http://localhost:8180/auth/realms/dev
Is it possible to somehow remove the @Bean method and still make it work? Somehow make the project to create that bean for itself?