Package edu.ucsb.cs156.frontiers.config
Class SecurityConfig
java.lang.Object
edu.ucsb.cs156.frontiers.config.SecurityConfig
The `SecurityConfig` class in Java configures web security with OAuth2 login, CSRF protection,
and role-based authorization based on user email addresses.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.web.SecurityFilterChain
filterChain
(org.springframework.security.config.annotation.web.builders.HttpSecurity http) The `filterChain` method in this Java code configures various security settings for an HTTP request, including authorization, exception handling, OAuth2 login, CSRF protection, and logout behavior.org.springframework.security.oauth2.client.oidc.authentication.OidcIdTokenDecoderFactory
static org.springframework.security.access.hierarchicalroles.RoleHierarchy
org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer
The `webSecurityCustomizer` method is used to configure web security in Java, specifically ignoring requests to the "/h2-console/**" path.
-
Constructor Details
-
SecurityConfig
public SecurityConfig()
-
-
Method Details
-
filterChain
@Bean public org.springframework.security.web.SecurityFilterChain filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception The `filterChain` method in this Java code configures various security settings for an HTTP request, including authorization, exception handling, OAuth2 login, CSRF protection, and logout behavior.- Parameters:
http
- injected HttpSecurity object (injected by Spring framework) //- Throws:
Exception
-
webSecurityCustomizer
@Bean public org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer webSecurityCustomizer()The `webSecurityCustomizer` method is used to configure web security in Java, specifically ignoring requests to the "/h2-console/**" path. -
roleHierarchy
@Bean public static org.springframework.security.access.hierarchicalroles.RoleHierarchy roleHierarchy() -
idTokenDecoderFactory
@Bean @Profile("microsoft") public org.springframework.security.oauth2.client.oidc.authentication.OidcIdTokenDecoderFactory idTokenDecoderFactory()
-