Skip to content

Commit

Permalink
Merge pull request #23218 from qmonmert/sonarjwt
Browse files Browse the repository at this point in the history
Sonar: Remove this call to a deprecated method, it has been marked for removal
  • Loading branch information
DanielFran authored Aug 20, 2023
2 parents 7a9a174 + b43fc2c commit 1fc505a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import tech.jhipster.config.JHipsterConstants;
<%_ } _%>
<%_ if (authenticationTypeJwt) { _%>
import org.springframework.http.HttpMethod;
import org.springframework.security.config.Customizer;
<%_ } _%>
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
Expand Down Expand Up @@ -248,7 +249,7 @@ public class SecurityConfiguration {
.exceptionHandling((exceptions) -> exceptions
.authenticationEntryPoint(new BearerTokenAuthenticationEntryPoint())
.accessDeniedHandler(new BearerTokenAccessDeniedHandler()))
.oauth2ResourceServer(oauth2 -> oauth2.jwt());
.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()));
<%_ } else if (authenticationTypeOauth2) { _%>
<%_ if (applicationTypeMonolith) { _%>
.oauth2Login(withDefaults())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ import org.springframework.core.convert.converter.Converter;
import org.springframework.core.ParameterizedTypeReference;
<%_ } _%>
<%_ } _%>
<%_ if (authenticationTypeJwt) { _%>
import org.springframework.security.config.Customizer;
<%_ } _%>
import org.springframework.security.config.annotation.method.configuration.EnableReactiveMethodSecurity;
import org.springframework.security.config.web.server.SecurityWebFiltersOrder;
import org.springframework.security.config.web.server.ServerHttpSecurity;
Expand Down Expand Up @@ -293,7 +296,7 @@ public class SecurityConfiguration {
.jwtAuthenticationConverter(jwtAuthenticationConverter())));
<%_ } else if (authenticationTypeJwt) { _%>
.httpBasic(basic -> basic.disable())
.oauth2ResourceServer(oauth2 -> oauth2.jwt());
.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()));
<%_ } else { _%>;<%_ } _%>
return http.build();
}
Expand Down

0 comments on commit 1fc505a

Please sign in to comment.