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. |
void |
handle(Exchange exchange)
Called to request the handler respond to the 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 void handle(Exchange exchange) throws HandlerException, IOException
Handler
A handler that doesn't hand-off an exchange to another handler downstream is responsible for creating the response in the exchange object.
Important note: If an existing response exists in the exchange object
and the handler intends to replace it with its own, it must first check to see if the
existing response has an entity, and if it does, must call its close
method in
order to signal that the processing of the response from a remote server is complete.
handle
in interface Handler
exchange
- the exchange containing the request to handle.HandlerException
- if an exception occurs that prevents handling of the request.IOException
- if an I/O exception occurs.protected abstract Response createResponse()
Response
with the appropriate status code and reason. This method is called each time the
handle(Exchange)
method is invoked.Response
instanceprotected void appendExtraAttributes(StringBuilder sb)
sb
- Challenge valueCopyright © 2014 ForgeRock AS. All rights reserved.