(Cheat Sheet by Michelle Ferreirae)
Authentication (or “access control”) is a process to verify the identity of a particular user.
AuthenticationManager:public interface AuthenticationManager {
Authentication authenticate(Authentication authentication)
throws AuthenticationException;
}
and an implemented ProviderManager and a series of AuthenticationProvider instances:
public interface AuthenticationProvider {
Authentication authenticate(Authentication authentication)
throws AuthenticationException;
boolean supports(Class<?> authentication);
}
ProviderManagers can have children which in turn have their own respective AuthenticationProviders.
AuthenticationManagerBuilder class is used for quickly setting up authentication features, and uses the @Autowired annotation to build AuthenticationManagers.AccessDecisionManager may handle multiple instances of AccessDecisionVoterFilters are @Beans that have systems of prioritizing their order (by the DEFAULT_ORDER property).
FilterRegistrationBeans or else not be made @Beans.FilterChainProxy) but has several layers of sub-filters in alternate alternate chains internally.
FilterChainProxy to cover common routes (like /error or /images/**) as well as a wildcard route (/**) for other cases.HttpSecurity further controls authorization.@EnableGlobalMethodSecurity(securedEnables = true)) by annotating particular methods. The following example is from the Spring guide on authorization:@Service
public class MyService {
@Secured("ROLE_USER")
public String secure() {
return "Hello Security";
}
}