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
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    configure(org.springframework.security.config.annotation.web.builders.HttpSecurity builder)
     
    cookieName(String cookieName)
    configures the name of the cookie expected to contain the LTPA2 token
    headerName(String headerName)
    configures the name of the header expected to contain the LTPA2 token

    Von Klasse geerbte Methoden org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer

    disable, getSecurityContextHolderStrategy, withObjectPostProcessor

    Von Klasse geerbte Methoden org.springframework.security.config.annotation.SecurityConfigurerAdapter

    addObjectPostProcessor, and, getBuilder, init, postProcess, setBuilder

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • Ltpa2Configurer

      public Ltpa2Configurer()
  • Methodendetails

    • configure

      public void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity builder) throws Exception
      Angegeben von:
      configure in Schnittstelle org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
      Setzt außer Kraft:
      configure in Klasse org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
      Löst aus:
      Exception
    • cookieName

      public Ltpa2Configurer cookieName(@NonNull String 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 - if cookieName is empty
    • headerName

      public Ltpa2Configurer headerName(@NonNull String 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 - if headerName is empty