Skip to content
Snippets Groups Projects
Commit 326557f5 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4939 Added Configuration of resource server

parent 9240131e
Branches
Tags
No related merge requests found
......@@ -26,6 +26,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
......@@ -41,6 +42,8 @@ public class SecurityConfiguration {
SecurityFilterChain filterChain(HttpSecurity http, ServerProperties serverProperties, @Value("${permit-all:[]}") String[] permitAll)
throws Exception {
// Configure a resource server with JWT decoder
http.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()));
// State-less session (state in access-token only)
http.sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment