Class VaadinSecurityConfigurer
java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<VaadinSecurityConfigurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
de.codecamp.vaadin.security.spring.config.VaadinSecurityConfigurer
- All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
public class VaadinSecurityConfigurer
extends org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<VaadinSecurityConfigurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
Configures a Spring Security filter chain for Vaadin.
- Disables CSRF support for Vaadin-related requests. Vaadin already handles this on its own.
- Only specific URLs
(
UI root URLand/VAADIN) and requests (frameworkandendpointrequests) will pass through the Spring Security filter chain. - Does NOT
restrict accessbased on URLs or requests. Access control is handled byRouteAccessControlon a per view-basis and byEndpointAccessCheckerper endpoint class or method. - If enabled, configures the form login and logout endpoints as needed for the standard
authentication provided by the
VaadinAuthenticationService.
HttpSecurity like this:
http.apply(new VaadinSecurityConfigurer());
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, withObjectPostProcessorMethods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
-
Constructor Details
-
VaadinSecurityConfigurer
public VaadinSecurityConfigurer()
-
-
Method Details
-
init
public void init(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception - Specified by:
initin interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Overrides:
initin classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Throws:
Exception
-
configure
public void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception - Specified by:
configurein interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Overrides:
configurein classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Throws:
Exception
-