public class AuthenticationResult
extends java.lang.Object
Constructor and Description |
---|
AuthenticationResult(AuthStatus status)
Instantiates a new AuthenticationResult object.
|
Modifier and Type | Method and Description |
---|---|
void |
addResponseHeader(java.lang.String key,
java.lang.String value)
Adds a new response header to be sent along with the authentication response.
|
static AuthenticationResult |
Challenged(java.lang.String authenticateHeader)
Convenience method to create a new AuthenticationResult with the CHALLENGED status.
|
static AuthenticationResult |
Failure()
Convenience method to create a new AuthenticationResult with the FAILURE status.
|
java.lang.String |
getRealm()
Returns the realm that the request has been authenticated with.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getResponseHeaders()
Returns the map of HTTP headers to be sent along with the authentication response.
|
AuthStatus |
getStatus()
Returns the accept/reject status of the authentication attempt.
|
java.lang.String |
getUsername()
Returns the username that the request has been authenticated with.
|
void |
setRealm(java.lang.String realm)
Sets the realm that the request has been authenticated with.
|
void |
setResponseHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> responseHeaders)
Sets the map of HTTP headers to be sent along with the authentication response.
|
void |
setStatus(AuthStatus status)
Sets the accept/reject status of the authentication attempt.
|
void |
setUsername(java.lang.String username)
Sets the username that the request has been authenticated with.
|
static AuthenticationResult |
Success()
Convenience method to create a new AuthenticationResult with the SUCCESS status.
|
static AuthenticationResult |
Success(java.lang.String username,
java.lang.String realm)
Convenience method to create a new AuthenticationResult with the SUCCESS status.
|
public AuthenticationResult(AuthStatus status)
status
- The accept/reject status to use.public AuthStatus getStatus()
public void setStatus(AuthStatus status)
status
- The accept/reject status to use.public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- The username that the request has been authenticated with.public java.lang.String getRealm()
public void setRealm(java.lang.String realm)
realm
- The realm that the request has been authenticated with.public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getResponseHeaders()
public void setResponseHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> responseHeaders)
responseHeaders
- The map of HTTP headers to be sent along with the authentication response.public void addResponseHeader(java.lang.String key, java.lang.String value)
key
- The name of the header.value
- The value of the header.public static AuthenticationResult Challenged(java.lang.String authenticateHeader)
authenticateHeader
- The value to include in the WWW-Authenticate response header.public static AuthenticationResult Success()
public static AuthenticationResult Success(java.lang.String username, java.lang.String realm)
username
- The username that the request has been authenticated with.realm
- The realm that the request has been authenticated with.public static AuthenticationResult Failure()