Prototypische implementierug der UserService und Controller

This commit is contained in:
2025-12-02 22:25:27 +01:00
parent 6f7185236c
commit 07f709da7c
18 changed files with 342 additions and 48 deletions
@@ -27,6 +27,7 @@ import org.springframework.security.oauth2.jwt.NimbusJwtEncoder;
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter;
import org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.header.writers.XXssProtectionHeaderWriter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
@@ -99,7 +100,14 @@ public class SecurityConfiguration {
jwtConfigurer.jwtAuthenticationConverter(jwtAuthenticationConverter());
});
})
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
/* .headers(headers ->
headers.xssProtection(
xss -> xss.headerValue(XXssProtectionHeaderWriter.HeaderValue.ENABLED_MODE_BLOCK)
).contentSecurityPolicy(
cps -> cps.policyDirectives("script-src 'self'")
))*/;
return http.build();
}