Object writeReplace() { return DigestPassword.createRaw(algorithm, username, realm, digest); }
Object writeReplace() { return DigestPassword.createRaw(algorithm, username, realm, digest); }
Object writeReplace() { return DigestPassword.createRaw(algorithm, username, realm, digest); }
Object writeReplace() { return DigestPassword.createRaw(algorithm, username, realm, digest); }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (Callback callback : callbacks) { if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(credential.toCharArray()); } else if (callback instanceof NameCallback) { ((NameCallback) callback).setName(name); } else if (callback instanceof RealmCallback) { ((RealmCallback) callback).setText(realm); } else if (callback instanceof CredentialCallback) { CredentialCallback cb = (CredentialCallback) callback; Password password; switch (cb.getAlgorithm()) { case ALGORITHM_CLEAR: password = ClearPassword.createRaw(ALGORITHM_CLEAR, credential.toCharArray()); break; case ALGORITHM_DIGEST_MD5: byte[] decodedDigest = ByteIterator.ofBytes(credential.getBytes(StandardCharsets.UTF_8)).hexDecode().drain(); password = DigestPassword.createRaw(ALGORITHM_DIGEST_MD5, name, realm, decodedDigest); break; default: continue; } cb.setCredential(cb.getCredentialType().cast(new PasswordCredential(password))); } } }
} else if ((algorithmName == null || ALGORITHM_DIGEST_MD5.equals(algorithmName)) && plainText == false) { byte[] hashed = ByteIterator.ofBytes(((String) users.get(userName)).getBytes(StandardCharsets.UTF_8)).asUtf8String().hexDecode().drain(); password = DigestPassword.createRaw(ALGORITHM_DIGEST_MD5, userName, realm, hashed); } else { continue;
} else if ((algorithmName == null || ALGORITHM_DIGEST_MD5.equals(algorithmName)) && plainText == false) { byte[] hashed = ByteIterator.ofBytes(((String) users.get(userName)).getBytes(StandardCharsets.UTF_8)).asUtf8String().hexDecode().drain(); password = DigestPassword.createRaw(ALGORITHM_DIGEST_MD5, userName, realm, hashed); } else { continue;
cc.setCredential(new PasswordCredential(DigestPassword.createRaw(DigestPassword.ALGORITHM_DIGEST_MD5, username, realm, bytes))); } else if (cc.isCredentialTypeSupported(BearerTokenCredential.class)) { AuthenticationContext context = AuthenticationContext.captureCurrent();
cc.setCredential(new PasswordCredential(DigestPassword.createRaw(DigestPassword.ALGORITHM_DIGEST_MD5, username, realm, bytes))); } else if (cc.isCredentialTypeSupported(BearerTokenCredential.class)) { AuthenticationContext context = AuthenticationContext.captureCurrent();