io.github.carlosthe19916.webservices.factories.ServicePasswordCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sunat-web-services Show documentation
Show all versions of sunat-web-services Show documentation
Sunat Web Services Endpoints
package io.github.carlosthe19916.webservices.factories;
import org.apache.wss4j.common.ext.WSPasswordCallback;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class ServicePasswordCallback implements CallbackHandler {
protected static final Map PASSWORDS = new ConcurrentHashMap<>();
@Override
public void handle(Callback[] callbacks) {
WSPasswordCallback passwordCallback = (WSPasswordCallback) callbacks[0];
String user = passwordCallback.getIdentifier();
passwordCallback.setPassword(PASSWORDS.get(user));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy