|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.noelios.restlet.authentication.AuthenticationHelper
public abstract class AuthenticationHelper
Base class for authentication helpers.
| Constructor Summary | |
|---|---|
AuthenticationHelper(ChallengeScheme challengeScheme,
boolean clientSide,
boolean serverSide)
Constructor. |
|
| Method Summary | |
|---|---|
int |
authenticate(ChallengeResponse cr,
Request request,
Guard guard)
Indicates if the call is properly authenticated. |
void |
challenge(Response response,
boolean stale,
Guard guard)
Challenges the client by adding a challenge request to the response and by setting the status to CLIENT_ERROR_UNAUTHORIZED. |
String |
format(ChallengeRequest request)
Formats a challenge request as a HTTP header value. |
String |
format(ChallengeResponse challenge,
Request request,
Series<Parameter> httpHeaders)
Formats a challenge response as raw credentials. |
abstract void |
formatCredentials(StringBuilder sb,
ChallengeResponse challenge,
Request request,
Series<Parameter> httpHeaders)
Formats a challenge response as raw credentials. |
void |
formatParameters(StringBuilder sb,
Series<Parameter> parameters,
ChallengeRequest request)
Formats the parameters of a challenge request, to be appended to the scheme technical name and realm. |
ChallengeScheme |
getChallengeScheme()
Returns the supported challenge scheme. |
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 cr,
String header)
Parses an authenticate header into a challenge request. |
void |
parseResponse(ChallengeResponse cr,
Request request)
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuthenticationHelper(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.| Method Detail |
|---|
public int authenticate(ChallengeResponse cr,
Request request,
Guard guard)
cr - The challenge response in the request.request - The request to authenticate.guard - The associated guard to callback.
Guard.checkSecret(Request, String, char[])
public void challenge(Response response,
boolean stale,
Guard guard)
response - The response to update.stale - Indicates if the new challenge is due to a stale response.guard - The associated guard to callback.public String format(ChallengeRequest request)
request - The challenge request to format.
public String format(ChallengeResponse challenge,
Request request,
Series<Parameter> httpHeaders)
challenge - The challenge response to format.request - The parent request.httpHeaders - The current request HTTP headers.
public abstract void formatCredentials(StringBuilder sb,
ChallengeResponse challenge,
Request request,
Series<Parameter> httpHeaders)
sb - The String builder to update.challenge - The challenge response to format.request - The parent request.httpHeaders - The current request HTTP headers.
public void formatParameters(StringBuilder sb,
Series<Parameter> parameters,
ChallengeRequest request)
sb - The string builder to update.parameters - The parameters to format.request - The challenger request.public ChallengeScheme getChallengeScheme()
public Logger getLogger()
public boolean isClientSide()
public boolean isServerSide()
public void parseRequest(ChallengeRequest cr,
String header)
header - The HTTP header value to parse.
public void parseResponse(ChallengeResponse cr,
Request request)
request - The request.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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||