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);
}
Aggregations