Search in sources :

Example 1 with TokenCallbackHandler

use of org.infinispan.client.hotrod.security.TokenCallbackHandler in project infinispan by infinispan.

the class AuthenticationConfigurationBuilder method create.

@Override
public AuthenticationConfiguration create() {
    String mech = saslMechanism == null ? DEFAULT_MECHANISM : saslMechanism;
    CallbackHandler cbh = callbackHandler;
    if (cbh == null) {
        if (OAUTHBEARER_MECH.equals(mech)) {
            cbh = new TokenCallbackHandler(token);
        } else if (username != null) {
            cbh = new BasicCallbackHandler(username, realm != null ? realm : DEFAULT_REALM, password);
        } else if (EXTERNAL_MECH.equals(mech) || GSSAPI_MECH.equals(mech) || GS2_KRB5_MECH.equals(mech)) {
            cbh = new VoidCallbackHandler();
        }
    }
    return new AuthenticationConfiguration(cbh, clientSubject, enabled, mech, saslProperties, serverName != null ? serverName : DEFAULT_SERVER_NAME);
}
Also used : TokenCallbackHandler(org.infinispan.client.hotrod.security.TokenCallbackHandler) CallbackHandler(javax.security.auth.callback.CallbackHandler) BasicCallbackHandler(org.infinispan.client.hotrod.security.BasicCallbackHandler) TokenCallbackHandler(org.infinispan.client.hotrod.security.TokenCallbackHandler) VoidCallbackHandler(org.infinispan.client.hotrod.security.VoidCallbackHandler) BasicCallbackHandler(org.infinispan.client.hotrod.security.BasicCallbackHandler) VoidCallbackHandler(org.infinispan.client.hotrod.security.VoidCallbackHandler)

Aggregations

CallbackHandler (javax.security.auth.callback.CallbackHandler)1 BasicCallbackHandler (org.infinispan.client.hotrod.security.BasicCallbackHandler)1 TokenCallbackHandler (org.infinispan.client.hotrod.security.TokenCallbackHandler)1 VoidCallbackHandler (org.infinispan.client.hotrod.security.VoidCallbackHandler)1