final Credential credential = config.getCredentialSource().getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null && credentialCallback.isCredentialSupported(credential)) { credentialCallback.setCredential(credential);
String requestedRealm = stateRef.get().getMechanismRealmConfiguration().getRealmName(); final Credential credential = getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null) { if (credential instanceof PasswordCredential) {
@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))); } } }
if (PasswordCredential.class.isAssignableFrom(cc.getCredentialType())) { String algorithmName = cc.getAlgorithm(); final Password password; continue; cc.setCredential(cc.getCredentialType().cast(new PasswordCredential(password)));
if (PasswordCredential.class.isAssignableFrom(cc.getCredentialType())) { String algorithmName = cc.getAlgorithm(); final Password password; continue; cc.setCredential(cc.getCredentialType().cast(new PasswordCredential(password)));
final Credential credential = config.getCredentialSource().getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null && credentialCallback.isCredentialSupported(credential)) { credentialCallback.setCredential(credential);
if (org.wildfly.security.credential.PasswordCredential.class.isAssignableFrom(credentialCallback.getCredentialType()) == false) { throw new UnsupportedCallbackException(current); credentialCallback.setCredential(credentialCallback.getCredentialType() .cast(new org.wildfly.security.credential.PasswordCredential( passwordFactory.generatePassword(passwordSpec))));
if (org.wildfly.security.credential.PasswordCredential.class.isAssignableFrom(credentialCallback.getCredentialType()) == false) { throw new UnsupportedCallbackException(current); credentialCallback.setCredential(credentialCallback.getCredentialType() .cast(new org.wildfly.security.credential.PasswordCredential( passwordFactory.generatePassword(passwordSpec))));
final Credential credential = config.getCredentialSource().getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null && credentialCallback.isCredentialSupported(credential)) { credentialCallback.setCredential(credential);
final Credential credential = config.getCredentialSource().getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null && credentialCallback.isCredentialSupported(credential)) { credentialCallback.setCredential(credential);
String requestedRealm = stateRef.get().getMechanismRealmConfiguration().getRealmName(); final Credential credential = getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null) { if (credential instanceof PasswordCredential) {
String requestedRealm = stateRef.get().getMechanismRealmConfiguration().getRealmName(); final Credential credential = getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null) { if (credential instanceof PasswordCredential) {
String requestedRealm = stateRef.get().getMechanismRealmConfiguration().getRealmName(); final Credential credential = getCredential(credentialCallback.getCredentialType(), credentialCallback.getAlgorithm(), credentialCallback.getParameterSpec()); if (credential != null) { if (credential instanceof PasswordCredential) {