-
Notifications
You must be signed in to change notification settings - Fork 88
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
#241: JWT: added spring-boot starters and auto-config, added JUnit tests #247
Conversation
… over configuration)
Method I used is not available in JDK 1.8. |
@@ -21,6 +24,8 @@ | |||
* | |||
* @since 2020.04.001 | |||
*/ | |||
@Component | |||
@Order(SecurityProperties.BASIC_AUTH_ORDER - 1) |
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.
Nice ;-)
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.
Trade-off: to make spring-boot starter pluggable with convention over configuration I had to find a solution. Projects are free to depend on devon4j-security-jwt
instead of the starter and manually configure the beans (e.g. creating the filter with new
in WebSecurityConfigurer and add to filter chain in the desired place).
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.
Can we define @component here as in JwtAutoConfiguration we have defined it as Bean
@bean
public JwtAuthenticationFilter jwtAuthenticationFilter() {
return new JwtAuthenticationFilter();
}
Same for
@bean
public JwtConfigProperties jwtConfigProperties() {
return new JwtConfigProperties();
}
Getting error while running mtsj
The bean 'jwtConfigProperties', defined in class path resource [com/devonfw/module/security/jwt/common/impl/JwtAutoConfiguration.class], could not be registered. A bean with that name has already been defined in URL [jar:file:/D:/projects/devon/devon-ide-scripts-3.0.0-beta24/conf/.m2/repository/com/devonfw/java/modules/devon4j-security-jwt/2020.04.001-SNAPSHOT/devon4j-security-jwt-2020.04.001-SNAPSHOT.jar!/com/devonfw/module/security/jwt/common/impl/JwtConfigProperties.class] and overriding is disabled.
same error for JwtAuthenticationFilter
The bean 'jwtAuthenticationFilter', defined in class path resource [com/devonfw/module/security/jwt/common/impl/JwtAutoConfiguration.class], could not be registered. A bean with that name has already been defined in URL [jar:file:/D:/projects/devon/devon-ide-scripts-3.0.0-beta24/conf/.m2/repository/com/devonfw/java/modules/devon4j-security-jwt/2020.04.001-SNAPSHOT/devon4j-security-jwt-2020.04.001-SNAPSHOT.jar!/com/devonfw/module/security/jwt/common/base/JwtAuthenticationFilter.class] and overriding is disabled.
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.
Please change
Line 187 in 67e7aed
this.notBeforeDeplay = notBeforeDeplay; |
Please also fix this in https://github.com/vapadwal/devon4j/blob/update_jwt/documentation/guide-jwt.asciidoc#configuration
OMG stupid typo. That's what reviews are good for :) Thanks so much @maihacke |
Fix for #241: