Spring provides a Filter implementation named DelegatingFilterProxy that allows bridging between the Servlet container’s lifecycle and Spring’s ApplicationContext.
FilterChainProxy
Spring Security’s Servlet support is contained within FilterChainProxy. FilterChainProxy is a special Filter provided by Spring Security that allows delegating to many Filter instances through SecurityFilterChain. Since FilterChainProxy is a Bean, it is typically wrapped in a DelegatingFilterProxy.
The Authentication serves two main purposes within Spring Security:
An input to AuthenticationManager to provide the credentials a user has provided to authenticate. When used in this scenario, isAuthenticated() returns false.
Represents the currently authenticated user. The current Authentication can be obtained from the SecurityContext.
The Authentication contains:
principal - identifies the user. When authenticating with a username/password this is often an instance of UserDetails.
credentials - Often a password. In many cases this will be cleared after the user is authenticated to ensure it is not leaked.
authorities - the GrantedAuthoritys are high level permissions the user is granted. A few examples are roles or scopes.
SecurityConfigurer<O, B extends SecurityBuilder<O>>
configuring a {@link SecurityBuilder}.
作用:配置一个 builder
SecurityConfigurerAdapter
public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>> implements SecurityConfigurer<O, B>
作用:配置一个 builder* @param <O> The Object being built by B* @param <B> The Builder that is building O and is configured by {@link SecurityConfigurerAdapter}
AbstractHttpConfigurer
public abstract class AbstractHttpConfigurer<T extends AbstractHttpConfigurer<T, B>, B extends HttpSecurityBuilder<B>>
extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, B>
Adds a convenient base class for {@link SecurityConfigurer} instances that operate on {@link HttpSecurity}.