public abstract class AuthenticateChallengeHandler extends Object implements Handler
Modifier and Type | Field and Description |
---|---|
static String |
WWW_AUTHENTICATE
Authorization HTTP Header name.
|
Modifier | Constructor and Description |
---|---|
protected |
AuthenticateChallengeHandler(String realm,
String error,
String description,
String uri)
Creates a new AuthenticateChallengeHandler.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendExtraAttributes(StringBuilder sb)
Permits sub-classes to append extra attributes to the challenge.
|
protected abstract Response |
createResponse()
Creates a
Response with the appropriate status code and reason. |
Promise<Response,NeverThrowsException> |
handle(Context context,
Request request)
|
public static final String WWW_AUTHENTICATE
protected AuthenticateChallengeHandler(String realm, String error, String description, String uri)
realm
- mandatory realm value.error
- error code (will be omitted if null)description
- error description (will be omitted if null)uri
- error uri page (will be omitted if null)public Promise<Response,NeverThrowsException> handle(Context context, Request request)
Handler
Promise
representing the asynchronous Response
of the given request
.
If any (asynchronous) processing goes wrong, the promise still contains a Response
(probably from the
4xx or 5xx status code family).
A handler that doesn't hand-off the processing to another downstream handler is responsible for creating the response.
The returned Promise
contains the response returned from the server as-is.
This is responsibility of the handler to produce the appropriate error response (404,
500, ...) in case of processing error.
Note: As of Promise 2.0 implementation, it is not permitted to throw any runtime exception here. Doing so produce unexpected behaviour (most likely a server-side hang of the processing thread).
protected abstract Response createResponse()
Response
with the appropriate status code and reason. This method is called each time the
handle(Context, Request)
method is invoked.Response
instanceprotected void appendExtraAttributes(StringBuilder sb)
sb
- Challenge valueCopyright 2011-2015 ForgeRock AS.