24 Aralık 2018 Pazartesi

SpringSecurity HttpSecurity Sınıfı Filtre Metodları

addFilter - javax.servlet.Filter
Örnek ver

addFilterAfter - javax.servlet.Filter + java.lang.Class<? extends javax.servlet.Filter>
Şöyle yaparız.
protected void configure (HttpSecurity http) throws Exception
{
  http.addFilterAfter(new CustomerInfoFilter(customerInfoDao),
    BasicAuthenticationFilter.class);
  // Some logic
}
addFilterAt - javax.servlet.Filter + java.lang.Class<? extends javax.servlet.Filter>
Belirtilen filtreyi replace eder. Şöyle yaparız
@Override
protected void configure(HttpSecurity http) throws Exception {
  //Use our custom security filter instead 
  // of username/password authentication:
  http.addFilterAt(
    new CustomAuthorizationFilter(), 
    UsernamePasswordAuthenticationFilter.class);
}
addFilterBefore - javax.servlet.Filter filter + java.lang.Class<? extends javax.servlet.Filter>
Örnek ver


Hiç yorum yok:

Yorum Gönder