public class AuthenticationResult extends Object
Constructor and Description |
---|
AuthenticationResult(AuthStatus status)
Instantiates a new AuthenticationResult object.
|
Modifier and Type | Method and Description |
---|---|
void |
addResponseHeader(String key,
String value)
Adds a new response header to be sent along with the authentication response.
|
static AuthenticationResult |
Challenged(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.
|
String |
getRealm()
Returns the realm that the request has been authenticated with.
|
Map<String,List<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.
|
String |
getUsername()
Returns the username that the request has been authenticated with.
|
void |
setRealm(String realm)
Sets the realm that the request has been authenticated with.
|
void |
setResponseHeaders(Map<String,List<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(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(String username,
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 String getUsername()
public void setUsername(String username)
username
- The username that the request has been authenticated with.public String getRealm()
public void setRealm(String realm)
realm
- The realm that the request has been authenticated with.public Map<String,List<String>> getResponseHeaders()
public void setResponseHeaders(Map<String,List<String>> responseHeaders)
responseHeaders
- The map of HTTP headers to be sent along with the authentication response.public void addResponseHeader(String key, String value)
key
- The name of the header.value
- The value of the header.public static AuthenticationResult Challenged(String authenticateHeader)
authenticateHeader
- The value to include in the WWW-Authenticate response header.public static AuthenticationResult Success()
public static AuthenticationResult Success(String username, 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()