Package coop.intergal.ui.security
Class SecurityConfiguration
- java.lang.Object
-
- org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-
- coop.intergal.ui.security.SecurityConfiguration
-
- All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<javax.servlet.Filter,org.springframework.security.config.annotation.web.builders.WebSecurity>,org.springframework.security.config.annotation.web.WebSecurityConfigurer<org.springframework.security.config.annotation.web.builders.WebSecurity>
@EnableWebSecurity @Configuration public class SecurityConfiguration extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapterConfigures spring security, doing the following:- Bypass security checks for static resources,
- Restrict access to the application, allowing only logged in users,
- Set up the login form,
- Configures the
UserDetailsServiceImpl.
-
-
Constructor Summary
Constructors Constructor Description SecurityConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder auth)Registers our UserDetailsService and the password encoder to be used on login attempts.protected voidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)Require login to access internal pages and configure login form.voidconfigure(org.springframework.security.config.annotation.web.builders.WebSecurity web)Allows access to static resources, bypassing Spring security.org.springframework.security.crypto.password.PasswordEncoderpasswordEncoder()The password encoder to use when encrypting passwords.-
Methods inherited from class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
authenticationManager, authenticationManagerBean, getApplicationContext, getHttp, init, setApplicationContext, setAuthenticationConfiguration, setContentNegotationStrategy, setObjectPostProcessor, setTrustResolver, userDetailsService, userDetailsServiceBean
-
-
-
-
Method Detail
-
passwordEncoder
@Bean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder()
The password encoder to use when encrypting passwords.
-
configure
protected void configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder auth) throws ExceptionRegisters our UserDetailsService and the password encoder to be used on login attempts.- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
Exception
-
configure
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws ExceptionRequire login to access internal pages and configure login form.- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
Exception
-
configure
public void configure(org.springframework.security.config.annotation.web.builders.WebSecurity web) throws ExceptionAllows access to static resources, bypassing Spring security.- Specified by:
configurein interfaceorg.springframework.security.config.annotation.SecurityConfigurer<javax.servlet.Filter,org.springframework.security.config.annotation.web.builders.WebSecurity>- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
Exception
-
-