All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.carlosthe19916.webservices.factories.ServicePasswordCallback Maven / Gradle / Ivy

There is a newer version: 1.3.4.Final
Show newest version
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