use of org.wildfly.extension.undertow.security.digest.DigestCredential in project wildfly by wildfly.
the class JAASIdentityManagerImpl method verify.
@Override
public Account verify(String id, Credential credential) {
AccountImpl account = getAccount(id);
if (credential instanceof DigestCredential) {
DigestCredential digestCredential = (DigestCredential) credential;
DigestCallbackHandler handler = new DigestCallbackHandler(id, digestCredential.getNonce(), digestCredential.getNonceCount(), digestCredential.getClientNonce(), digestCredential.getQop(), digestCredential.getRealm(), digestCredential.getHA2());
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
return verifyCredential(account, digestCredential.getClientDigest());
} else if (credential instanceof PasswordCredential) {
final char[] password = ((PasswordCredential) credential).getPassword();
// The original array may be cleared, this integration relies on it being cached for use later.
final char[] duplicate = Arrays.copyOf(password, password.length);
return verifyCredential(account, duplicate);
} else {
return verifyCredential(account, credential);
}
}
Aggregations