public abstract class SecretVerifier extends java.lang.Object implements Verifier
ChallengeResponse
. If the verification is
successful, it automatically adds a new User
for the given
identifier.RESULT_INVALID, RESULT_MISSING, RESULT_STALE, RESULT_UNKNOWN, RESULT_UNSUPPORTED, RESULT_VALID
Constructor and Description |
---|
SecretVerifier() |
Modifier and Type | Method and Description |
---|---|
static boolean |
compare(char[] secret1,
char[] secret2)
Compares that two secrets are equal and not null.
|
protected User |
createUser(java.lang.String identifier,
Request request,
Response response)
Called back to create a new user when valid credentials are provided.
|
protected java.lang.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 int |
verify(java.lang.String identifier,
char[] secret)
Verifies that the identifier/secret couple is valid.
|
public static boolean compare(char[] secret1, char[] secret2)
secret1
- The input secret.secret2
- The output secret.protected User createUser(java.lang.String identifier, Request request, Response response)
identifier
- The user identifier.request
- The request handled.response
- The response handled.User
instance created.protected java.lang.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.public abstract int verify(java.lang.String identifier, char[] secret)
identifier
- The user identifier to match.secret
- The provided secret to verify.Copyright © 2005-2024 Restlet.