Code example for CallbackHandler

Methods: handle

        NameCallback nameCallback = new NameCallback("prompt", "defaultName");
        PasswordCallback pwdCallback = new PasswordCallback("prompt", false);
        Callback[] callbacks = new Callback[]{nameCallback, pwdCallback};
        catch (Exception e)
            throw new SaslException("Error handling SASL callbacks: " + e, e);
        FieldTable table = FieldTableFactory.newFieldTable();
        table.setString("LOGIN", nameCallback.getName());
        table.setString("PASSWORD", new String(pwdCallback.getPassword()));
        return table.getDataAsBytes();
    public boolean isComplete() 
        return true; 
Connect your IDE to all the code out there  Get Codota for Java