Skip to content

Add Generic AuthenticationFilter #6506

@sbespalov

Description

@sbespalov

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:

  1. Expose Authentication from request (supply);
  2. If there is no supported Authentication provided then proceed filter chain;
  3. If there is supported Authentication then try to authenticate it with AuthenticationManager;
  4. If the authentication succeed then proceed filter chain with "authenticated" Authentication;
  5. 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.

Metadata

Metadata

Assignees

Labels

in: webAn issue in web modules (web, webmvc)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions