Skip to content

Commit cc60e87

Browse files
committed
Added info log output for server and login modes #3598
1 parent 379025d commit cc60e87

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sechub-commons-security-spring/src/main/java/com/mercedesbenz/sechub/spring/security/AbstractSecurityConfiguration.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ SecurityFilterChain securityFilterChainLogin(HttpSecurity httpSecurity,
161161
/* Make the application stateless */
162162
.sessionManagement(httpSecuritySessionManagementConfigurer -> httpSecuritySessionManagementConfigurer
163163
.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
164-
164+
165+
LOG.info("Configure login mode: classic={}, oauth2={}", loginProperties.isClassicModeEnabled(), loginProperties.isOAuth2ModeEnabled());
166+
165167
if (!loginProperties.isOAuth2ModeEnabled() && !loginProperties.isClassicModeEnabled()) {
166168
String exMsg = "At least one of 'classic' or 'oauth2' mode must be enabled by setting the '%s.%s' property".formatted(
167169
SecHubSecurityProperties.LoginProperties.PREFIX,
@@ -233,6 +235,8 @@ private static void configureResourceServerMode(HttpSecurity httpSecurity,
233235
LOG.warn("No resource server configuration detected. All requests to protected paths will be rejected.");
234236
return;
235237
}
238+
239+
LOG.info("Configure resource server mode: classic={}, oauth2={}", resourceServerProperties.isClassicModeEnabled(), resourceServerProperties.isOAuth2ModeEnabled());
236240

237241
if (!resourceServerProperties.isClassicModeEnabled() && !resourceServerProperties.isOAuth2ModeEnabled()) {
238242
String exMsg = "At least one of 'classic' or 'oauth2' mode must be enabled by setting the '%s.%s' property".formatted(
@@ -271,7 +275,9 @@ private static void configureResourceServerOAuth2Mode(HttpSecurity httpSecurity,
271275
AES256Encryption aes256Encryption,
272276
JwtDecoder jwtDecoder,
273277
RestTemplate restTemplate) throws Exception {
274-
278+
279+
LOG.info("Configure oAuth2 mode: jwt={}, opaqueToken={}", oAuth2Properties.isJwtModeEnabled(), oAuth2Properties.isOpaqueTokenModeEnabled());
280+
275281
if (oAuth2Properties.isJwtModeEnabled() == oAuth2Properties.isOpaqueTokenModeEnabled()) {
276282
String exMsg = "Either 'jwt' or opaque token mode must be enabled by setting the '%s.%s' property to either '%s' or '%s'".formatted(
277283
SecHubSecurityProperties.ResourceServerProperties.OAuth2Properties.PREFIX,
@@ -298,7 +304,6 @@ private static void configureResourceServerOAuth2JwtMode(HttpSecurity httpSecuri
298304
UserDetailsService userDetailsService,
299305
JwtDecoder jwtDecoder,
300306
AES256Encryption aes256Encryption) throws Exception {
301-
302307
if (userDetailsService == null) {
303308
throw new NoSuchBeanDefinitionException(UserDetailsService.class);
304309
}

0 commit comments

Comments
 (0)