The proposal is to have generic Authentication filter which will be able to provide single authentication strategy regardless of authentication type.
The Servlet API based authentication process commonly consist of following stages:
- Expose
Authentication from request (supply);
- If there is no supported
Authentication provided then proceed filter chain;
- If there is supported
Authentication then try to authenticate it with AuthenticationManager;
- If the authentication succeed then proceed filter chain with "authenticated"
Authentication;
- If the authentication failed then provide appropriate response with
AuthenticationEntryPoint;
The first stage, from above, can be done with AuthenticationSupplier interface:
public interface AuthenticationSupplier<T extends Authentication> extends AuthenticationEntryPoint {
T supply(HttpServletRequest request) throws AuthenticationException;
AuthenticationType getAuthenticationType();
}
This issue targets to clarify proper implementation previously suggested within PR #6496.
The proposal is to have generic Authentication filter which will be able to provide single authentication strategy regardless of authentication type.
The Servlet API based authentication process commonly consist of following stages:
Authenticationfrom request (supply);Authenticationprovided then proceed filter chain;Authenticationthen try to authenticate it withAuthenticationManager;Authentication;AuthenticationEntryPoint;The first stage, from above, can be done with
AuthenticationSupplierinterface:This issue targets to clarify proper implementation previously suggested within PR #6496.