public abstract class AuthenticatorHelper extends Helper
| Constructor and Description |
|---|
AuthenticatorHelper(ChallengeScheme challengeScheme,
boolean clientSide,
boolean serverSide)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
formatRequest(ChallengeWriter cw,
ChallengeRequest challenge,
Response response,
Series<Header> httpHeaders)
Formats a challenge request as raw credentials.
|
void |
formatResponse(ChallengeWriter cw,
ChallengeResponse challenge,
Request request,
Series<Header> httpHeaders)
Formats a challenge response as raw credentials.
|
ChallengeScheme |
getChallengeScheme()
Returns the supported challenge scheme.
|
java.util.logging.Logger |
getLogger()
Returns the context's logger.
|
boolean |
isClientSide()
Indicates if client side authentication is supported.
|
boolean |
isServerSide()
Indicates if server side authentication is supported.
|
void |
parseRequest(ChallengeRequest challenge,
Response response,
Series<Header> httpHeaders)
Parses an authenticate header into a challenge request.
|
void |
parseResponse(ChallengeResponse challenge,
Request request,
Series<Header> httpHeaders)
Parses an authorization header into a challenge response.
|
void |
setChallengeScheme(ChallengeScheme challengeScheme)
Sets the supported challenge scheme.
|
void |
setClientSide(boolean clientSide)
Indicates if client side authentication is supported.
|
void |
setServerSide(boolean serverSide)
Indicates if server side authentication is supported.
|
Reference |
updateReference(Reference resourceRef,
ChallengeResponse challengeResponse,
Request request)
Optionally updates the request with a challenge response before sending
it.
|
public AuthenticatorHelper(ChallengeScheme challengeScheme, boolean clientSide, boolean serverSide)
challengeScheme - The supported challenge scheme.clientSide - Indicates if client side authentication is supported.serverSide - Indicates if server side authentication is supported.public void formatRequest(ChallengeWriter cw, ChallengeRequest challenge, Response response, Series<Header> httpHeaders) throws java.io.IOException
cw - The header writer to update.challenge - The challenge request to format.response - The parent response.httpHeaders - The current request HTTP headers.java.io.IOExceptionpublic void formatResponse(ChallengeWriter cw, ChallengeResponse challenge, Request request, Series<Header> httpHeaders)
cw - The header writer to update.challenge - The challenge response to format.request - The parent request.httpHeaders - The current request HTTP headers.public ChallengeScheme getChallengeScheme()
public java.util.logging.Logger getLogger()
public boolean isClientSide()
public boolean isServerSide()
public void parseRequest(ChallengeRequest challenge, Response response, Series<Header> httpHeaders)
HeaderConstants.HEADER_WWW_AUTHENTICATE.challenge - The challenge request to update.response - The parent response.httpHeaders - The current response HTTP headers.public void parseResponse(ChallengeResponse challenge, Request request, Series<Header> httpHeaders)
HeaderConstants.HEADER_AUTHORIZATION.challenge - The challenge response to update.request - The parent request.httpHeaders - The current request HTTP headers.public void setChallengeScheme(ChallengeScheme challengeScheme)
challengeScheme - The supported challenge scheme.public void setClientSide(boolean clientSide)
clientSide - True if client side authentication is supported.public void setServerSide(boolean serverSide)
serverSide - True if server side authentication is supported.public Reference updateReference(Reference resourceRef, ChallengeResponse challengeResponse, Request request)
resourceRef - The resource URI reference to update.challengeResponse - The challenge response provided.request - The request to update.Copyright © 2005-2024 Restlet.