Klasse Ltpa2Configurer
java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<Ltpa2Configurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
de.sephirothj.spring.security.ltpa2.Ltpa2Configurer
- Alle implementierten Schnittstellen:
org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
public class Ltpa2Configurer
extends org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<Ltpa2Configurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
A convenient way to configure the pre-authentication filter.
How to use:
public class WebSecurityConfig extends WebSecurityConfigurerAdapter
{
@Override
protected void configure(HttpSecurity http) throws Exception
{
http
.authorizeRequests()
.antMatchers("/", "/home").permitAll()
.antMatchers("/hello").hasRole("DEVELOPERS")
.and()
.apply(new Ltpa2Configurer())
.sharedKey(sharedKey())
.signerKey(signerKey())
;
http.userDetailsService(userDetailsService());
}
}
A UserDetailsService is required! In case no instance is exposed, you have to provide one using AuthenticationManagerBuilder#userDetailsService.
- Autor:
- Sephiroth
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity builder) cookieName(String cookieName) configures the name of the cookie expected to contain the LTPA2 tokenheaderName(String headerName) configures the name of the header expected to contain the LTPA2 tokenVon Klasse geerbte Methoden org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, getSecurityContextHolderStrategy, withObjectPostProcessorVon Klasse geerbte Methoden org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, getBuilder, init, postProcess, setBuilder
-
Konstruktordetails
-
Ltpa2Configurer
public Ltpa2Configurer()
-
-
Methodendetails
-
configure
public void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity builder) throws Exception - Angegeben von:
configurein Schnittstelleorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Setzt außer Kraft:
configurein Klasseorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity> - Löst aus:
Exception
-
cookieName
configures the name of the cookie expected to contain the LTPA2 token- Parameter:
cookieName- the cookie name- Gibt zurück:
- this instance
- Löst aus:
IllegalArgumentException- ifcookieNameis empty
-
headerName
configures the name of the header expected to contain the LTPA2 token- Parameter:
headerName- the name of the header- Gibt zurück:
- this instance
- Löst aus:
IllegalArgumentException- ifheaderNameis empty
-