Top Description Fields Constructors Methods
jakarta.security.enterprise.authentication.mechanism.http

public Class HttpAuthenticationMechanismWrapper

extends Object
implements HttpAuthenticationMechanism
Class Inheritance
All Implemented Interfaces
jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism
Imports
jakarta.security.enterprise.AuthenticationException, .AuthenticationStatus, jakarta.servlet.http.HttpServletRequest, .HttpServletResponse

This class is an implementation of the HttpAuthenticationMechanism interface that can be subclassed by developers wishing to provide extra or different functionality.

All methods default to calling the wrapped object.

Since
3.0

Field Summary

Modifier and TypeField and Description
private final HttpAuthenticationMechanism

Constructor Summary

AccessConstructor and Description
public
HttpAuthenticationMechanismWrapper()

This constructor is intended for proxy usuage only.

public
HttpAuthenticationMechanismWrapper(HttpAuthenticationMechanism
The wrapped object which all methods call.
httpAuthenticationMechanism
)

Constructs the wrapper with the object being delegated to.

Method Summary

Modifier and TypeMethod and Description
public void
cleanSubject(HttpServletRequest
contains the request the client has made
request
,
HttpServletResponse
contains the response that will be send to the client
response
,
HttpMessageContext
context for interacting with the container
httpMessageContext
)

Overrides default jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.cleanSubject.

Remove mechanism specific principals and credentials from the subject and any other state the mechanism might have used.

public HttpAuthenticationMechanism

Returns:

the object that's being wrapped.
getWrapped
()

Returns the object that's being wrapped.

public AuthenticationStatus
secureResponse(HttpServletRequest
contains the request the client has made
request
,
HttpServletResponse
contains the response that will be send to the client
response
,
HttpMessageContext
context for interacting with the container
httpMessageContext
)

Overrides default jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.secureResponse.

Secure the response, optionally.

public AuthenticationStatus
validateRequest(HttpServletRequest
contains the request the client has made
request
,
HttpServletResponse
contains the response that will be send to the client
response
,
HttpMessageContext
context for interacting with the container
httpMessageContext
)

Implements jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.validateRequest.

Authenticate an HTTP request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

httpAuthenticationMechanismback to summary
private final HttpAuthenticationMechanism httpAuthenticationMechanism

Constructor Detail

HttpAuthenticationMechanismWrapperback to summary
public HttpAuthenticationMechanismWrapper()

This constructor is intended for proxy usuage only.

HttpAuthenticationMechanismWrapperback to summary
public HttpAuthenticationMechanismWrapper(HttpAuthenticationMechanism httpAuthenticationMechanism)

Constructs the wrapper with the object being delegated to.

Parameters
httpAuthenticationMechanism:HttpAuthenticationMechanism

The wrapped object which all methods call.

Method Detail

cleanSubjectback to summary
public void cleanSubject(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext)

Overrides default jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.cleanSubject.

Doc from jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.cleanSubject.

Remove mechanism specific principals and credentials from the subject and any other state the mechanism might have used.

This method is called in response to HttpServletRequest#logout() and gives the authentication mechanism the option to remove any state associated with an earlier established authenticated identity. For example, an authentication mechanism that stores state within a cookie can send remove that cookie here.

Parameters
request:HttpServletRequest

contains the request the client has made

response:HttpServletResponse

contains the response that will be send to the client

httpMessageContext:HttpMessageContext

context for interacting with the container

Annotations
@Override
getWrappedback to summary
public HttpAuthenticationMechanism getWrapped()

Returns the object that's being wrapped.

Returns:HttpAuthenticationMechanism

the object that's being wrapped.

secureResponseback to summary
public AuthenticationStatus secureResponse(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthenticationException

Overrides default jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.secureResponse.

Doc from jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.secureResponse.

Secure the response, optionally.

This method is called to allow for any post processing to be done on the request, and is always invoked after any Filter or HttpServlet.

Note that this method is only called when a (Servlet) resource has indeed been invoked, i.e. if a previous call to validateRequest that was invoked before any Filter or HttpServlet returned SUCCESS.

Parameters
request:HttpServletRequest

contains the request the client has made

response:HttpServletResponse

contains the response that will be send to the client

httpMessageContext:HttpMessageContext

context for interacting with the container

Returns:AuthenticationStatus

the completion status of the processing performed by this method

Annotations
@Override
Exceptions
AuthenticationException:
when the processing failed
validateRequestback to summary
public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthenticationException

Implements jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.validateRequest.

Doc from jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism.validateRequest.

Authenticate an HTTP request.

This method is called in response to an HTTP client request for a resource, and is always invoked before any Filter or HttpServlet. Additionally this method is called in response to HttpServletRequest#authenticate(HttpServletResponse)

Note that by default this method is always called for every request, independent of whether the request is to a protected or non-protected resource, or whether a caller was successfully authenticated before within the same HTTP session or not.

A CDI/Interceptor spec interceptor can be used to prevent calls to this method if needed. See AutoApplySession and RememberMe for two examples.

Parameters
request:HttpServletRequest

contains the request the client has made

response:HttpServletResponse

contains the response that will be send to the client

httpMessageContext:HttpMessageContext

context for interacting with the container

Returns:AuthenticationStatus

the completion status of the processing performed by this method

Annotations
@Override
Exceptions
AuthenticationException:
when the processing failed