|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.security.SecretVerifier
public abstract class SecretVerifier
Verifier of identifier/secret couples. By default, it extracts the identifier
and the secret from the ChallengeResponse
. If the verification is
successful, it automatically adds a new User
for the given
identifier.
Field Summary |
---|
Fields inherited from interface org.restlet.security.Verifier |
---|
RESULT_INVALID, RESULT_MISSING, RESULT_STALE, RESULT_UNKNOWN, RESULT_UNSUPPORTED, RESULT_VALID |
Constructor Summary | |
---|---|
SecretVerifier()
|
Method Summary | |
---|---|
static boolean |
compare(char[] secret1,
char[] secret2)
Compares that two secrets are equal. |
protected String |
getIdentifier(Request request,
Response response)
Returns the user identifier. |
protected char[] |
getSecret(Request request,
Response response)
Returns the secret provided by the user. |
int |
verify(Request request,
Response response)
Verifies that the proposed secret is correct for the specified request. |
abstract boolean |
verify(String identifier,
char[] secret)
Verifies that the identifier/secret couple is valid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SecretVerifier()
Method Detail |
---|
public static boolean compare(char[] secret1, char[] secret2)
secret1
- The input secret.secret2
- The output secret.
protected String getIdentifier(Request request, Response response)
request
- The request to inspect.response
- The response to inspect.
protected char[] getSecret(Request request, Response response)
request
- The request to inspect.response
- The response to inspect.
public int verify(Request request, Response response)
ChallengeResponse.getSecret()
method and sets the User
instance of the
request's ClientInfo
if successful.
verify
in interface Verifier
request
- The request to inspect.response
- The response to inspect.
public abstract boolean verify(String identifier, char[] secret) throws IllegalArgumentException
identifier
- The user identifier to match.secret
- The provided secret to verify.
IllegalArgumentException
- In case the identifier is unknown.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |