All methods default to calling the wrapped object.
Modifier and Type | Field and Description |
---|---|
private final HttpMessageContext |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | cleanClientSubject()
Implements jakarta. |
public AuthenticationStatus | doNothing()
Implements jakarta. |
public AuthenticationStatus | forward(String
a String specifying the pathname to the resource. path)Implements jakarta. |
public AuthenticationParameters | getAuthParameters()
Implements jakarta. |
public Principal | getCallerPrincipal()
Implements jakarta. |
public Subject | getClientSubject()
Implements jakarta. |
public Set | getGroups()
Implements jakarta. |
public CallbackHandler | getHandler()
Implements jakarta. HttpMessageContext , and which this context uses to communicate the authentication details to the runtime.
|
public MessageInfo | getMessageInfo()
Implements jakarta. |
public HttpServletRequest | getRequest()
Implements jakarta. |
public HttpServletResponse | getResponse()
Implements jakarta. |
public HttpMessageContext | |
public boolean | isAuthenticationRequest()
Implements jakarta. SecurityContext#authenticate(HttpServletRequest, HttpServletResponse, AuthenticationParameters)
If SecurityContext#authenticate was not called, the authentication mechanism may have been invoked by the container at the start of a request. |
public boolean | isProtected()
Implements jakarta. |
public boolean | isRegisterSession()
Implements jakarta. |
public AuthenticationStatus | notifyContainerAboutLogin(String
the caller name that will become the caller principal username, Set<String> the groups associated with the caller principal roles)Implements jakarta. SecurityContext#isCallerInRole(String) etc.
Note that after this call returned, the authenticated identity will not be immediately active. |
public AuthenticationStatus | notifyContainerAboutLogin(Principal
the Principal that will become the caller principal principal, Set<String> the groups associated with the caller principal roles)Implements jakarta. SecurityContext#isCallerInRole(String) etc.
Note that this call may result in the container establishing two caller principals to represent the caller's identity -- the Principal provided here as the principal parameter, and a second principal used as the container's representation of the caller identity. |
public AuthenticationStatus | notifyContainerAboutLogin(CredentialValidationResult
a CredentialValidationResult which is inspected for its status and from which the principal and groups
are taken. result)Implements jakarta. CredentialValidationResult result of an
identity store directly on to the container.
|
public AuthenticationStatus | redirect(String
the location to redirect to location)Implements jakarta.
As a convenience this method returns SEND_CONTINUE, so this method can be used in
one fluent return statement from an |
public AuthenticationStatus | responseNotFound()
Implements jakarta. |
public AuthenticationStatus | responseUnauthorized()
Implements jakarta. |
public void | setRegisterSession(String
the caller name for which authentication should be be remembered callerName, Set<String> the groups for which authentication should be remembered. groups)Implements jakarta. |
public void | setRequest(HttpServletRequest
the request object to be set request)Implements jakarta. |
public void | setResponse(HttpServletResponse
the response object to be set. response)Implements jakarta. |
public HttpMessageContext | withRequest(HttpServletRequest
the request object to be set. request)Implements jakarta. |
httpMessageContext | back to summary |
---|---|
private final HttpMessageContext httpMessageContext |
HttpMessageContextWrapper | back to summary |
---|---|
public HttpMessageContextWrapper(HttpMessageContext httpMessageContext) |
cleanClientSubject | back to summary |
---|---|
public void cleanClientSubject() Implements jakarta. Doc from jakarta. Convenience method to clean the subject associated with this context.
Cleaning this subject is done as defined by the Servlet Container Profile of Jakarta Authentication
for the ServerAuthModule#cleanSubject method and the
|
doNothing | back to summary |
---|---|
public AuthenticationStatus doNothing() Implements jakarta. Doc from jakarta. Instructs the container to "do nothing". When intending to do nothing, a Jakarta Security authentication mechanism has to indicate this explicitly via its return value.
As a convenience this method returns NOT_DONE, so this method can be used in
one fluent return statement from an
|
forward | back to summary |
---|---|
public AuthenticationStatus forward(String path) Implements jakarta. Doc from jakarta. Forwards to another resource (Jakarta Servlet, Jakarta Server Pages file, or HTML file) on the server.
As a convenience this method returns SEND_CONTINUE, so this method can be used in
one fluent return statement from an
|
getAuthParameters | back to summary |
---|---|
public AuthenticationParameters getAuthParameters() Implements jakarta. Doc from jakarta. Returns the parameters that were provided with the SecurityContext#authenticate(AuthParameters) call.
|
getCallerPrincipal | back to summary |
---|---|
public Principal getCallerPrincipal() Implements jakarta. Doc from jakarta. Gets the Principal set by a call to notifyContainerAboutLogin(). |
getClientSubject | back to summary |
---|---|
public Subject getClientSubject() Implements jakarta. Doc from jakarta. Returns the subject for which authentication is to take place. Note This is a low level object that most higher level code would not need to use directly. |
getGroups | back to summary |
---|---|
public Set Implements jakarta. Doc from jakarta. Gets the groups set by a call to notifyContainerAboutLogin(). |
getHandler | back to summary |
---|---|
public CallbackHandler getHandler() Implements jakarta. Doc from jakarta. Returns the low level Jakarta Authentication handler that the runtime provided when creating this
Note This is a low level object that most higher level code would not need to use directly.
|
getMessageInfo | back to summary |
---|---|
public MessageInfo getMessageInfo() Implements jakarta. Doc from jakarta. Returns the the low level Jakarta Authentication message info instance for the current request. Note This is a low level object that most higher level code would not need to use directly.
|
getRequest | back to summary |
---|---|
public HttpServletRequest getRequest() Implements jakarta. Doc from jakarta. Returns the request object associated with the current request.
|
getResponse | back to summary |
---|---|
public HttpServletResponse getResponse() Implements jakarta. Doc from jakarta. Returns the response object associated with the current request.
|
getWrapped | back to summary |
---|---|
public HttpMessageContext getWrapped() |
isAuthenticationRequest | back to summary |
---|---|
public boolean isAuthenticationRequest() Implements jakarta. Doc from jakarta. Checks if the current call to an authentication mechanism is the result from the
application calling If SecurityContext#authenticate was not called, the authentication mechanism may have been invoked by the container at the start of a request.
|
isProtected | back to summary |
---|---|
public boolean isProtected() Implements jakarta. Doc from jakarta. Checks if the currently requested resource is protected or not. A protected resource is a resource (e.g. a Jakarta
Servlet, Jakarta Faces page, Jakarta Server Pages page etc) for which a constraint has been defined in e.g.
|
isRegisterSession | back to summary |
---|---|
public boolean isRegisterSession() Implements jakarta. Doc from jakarta. Check if the runtime has been asked to register an authentication session duing the current request.
|
notifyContainerAboutLogin | back to summary |
---|---|
public AuthenticationStatus notifyContainerAboutLogin(String username, Set<String> roles) Implements jakarta. Asks the container to register the given caller name and groups in order to make
them available to the application for use with Note that after this call returned, the authenticated identity will not be immediately active. This will only take place (should no errors occur) after the authentication mechanism in which this call takes place returns control back to the container (runtime).
As a convenience this method returns SUCCESS, so this method can be used in
one fluent return statement from an
|
notifyContainerAboutLogin | back to summary |
---|---|
public AuthenticationStatus notifyContainerAboutLogin(Principal principal, Set<String> roles) Implements jakarta. Asks the container to register the given caller principal and groups in order to make
them available to the application for use with Note that this call may result in the container establishing two caller principals to represent the caller's identity -- the Principal provided here as the principal parameter, and a second principal used as the container's representation of the caller identity. A second principal is added only if the container uses a different Principal type to represent the caller. If the types are the same, only one Principal is added.
If a second principal is added, the value returned by
When two principals are added, the container's caller principal is returned from
Note that after this call returned, the authenticated identity will not be immediately active. This will only take place (should no errors occur) after the authentication mechanism in which this call takes place returns control back to the container (runtime).
As a convenience this method returns SUCCESS, so this method can be used in
one fluent return statement from an
|
notifyContainerAboutLogin | back to summary |
---|---|
public AuthenticationStatus notifyContainerAboutLogin(CredentialValidationResult result) Implements jakarta. Convenience method intended to pass the
If the outcome from the given
If the outcome from the given
|
redirect | back to summary |
---|---|
public AuthenticationStatus redirect(String location) Implements jakarta. Doc from jakarta. Sets the response status to SC_FOUND 302 (Found)
As a convenience this method returns SEND_CONTINUE, so this method can be used in
one fluent return statement from an
|
responseNotFound | back to summary |
---|---|
public AuthenticationStatus responseNotFound() Implements jakarta. Doc from jakarta. Sets the response status to 404 (not found).
As a convenience this method returns SEND_FAILURE, so this method can be used in
one fluent return statement from an
|
responseUnauthorized | back to summary |
---|---|
public AuthenticationStatus responseUnauthorized() Implements jakarta. Doc from jakarta. Sets the response status to 401 (unauthorized).
As a convenience this method returns SEND_FAILURE, so this method can be used in
one fluent return statement from an
|
setRegisterSession | back to summary |
---|---|
public void setRegisterSession(String callerName, Set<String> groups) Implements jakarta. Doc from jakarta. Asks the runtime to register an authentication session. This will automatically remember the logged-in status
as long as the current HTTP session remains valid. Without this being asked, a |
setRequest | back to summary |
---|---|
public void setRequest(HttpServletRequest request) Implements jakarta. Doc from jakarta. Sets the request object.
|
setResponse | back to summary |
---|---|
public void setResponse(HttpServletResponse response) Implements jakarta. Doc from jakarta. Set the response object.
|
withRequest | back to summary |
---|---|
public HttpMessageContext withRequest(HttpServletRequest request) Implements jakarta. Doc from jakarta. Sets the request object.
|