private AuthenticationConfigurationBuilder getMaybeSecurityBuilder(String username, String password, String realm) { ConfigurationBuilder b = new ConfigurationBuilder(); if (StringUtils.isNotEmpty(username)) { checkNotEmpty("password", password); checkNotEmpty("realm", realm); return b.security().authentication() .enable() .saslMechanism(SASL_MECHANISM) .callbackHandler(new LoginHandler(username, password.toCharArray(), realm)); } else { return b.security().authentication().disable(); } }
private AuthenticationConfigurationBuilder getMaybeSecurityBuilder(String username, String password, String realm) { ConfigurationBuilder b = new ConfigurationBuilder(); if (StringUtils.isNotEmpty(username)) { checkNotEmpty("password", password); checkNotEmpty("realm", realm); return b.security().authentication() .enable() .saslMechanism(SASL_MECHANISM) .callbackHandler(new LoginHandler(username, password.toCharArray(), realm)); } else { return b.security().authentication().disable(); } }
public SecurityConfigurationHelper withServerName(String serverName) { this.security().authentication().serverName(serverName); return this; } }
.addServers(securedHotRodEndpoint) .security() .authentication()
public SecurityConfigurationHelper withDefaultQop() { this.security().authentication().saslQop(SaslQop.AUTH_CONF) .saslStrength(SaslStrength.HIGH, SaslStrength.MEDIUM, SaslStrength.LOW); return this; }
public SecurityConfigurationHelper forExternalAuth() { this.security().authentication().callbackHandler(new VoidCallbackHandler()); return this; }
public SecurityConfigurationHelper forCredentials(String login, String password) { this.security().authentication().callbackHandler(new SimpleLoginHandler(login, password, DEFAULT_TEST_REALM)); return this; }
public SecurityConfigurationHelper forSubject(Subject subj) { this.security().authentication().clientSubject(subj).callbackHandler(new SimpleLoginHandler("", "")); //callback handle is required by ISPN config validation return this; }
throw new ResourceException(UTIL.getString("no_auth_server")); builder.security().authentication().enable().saslMechanism(saslMechanism).username(userName) .realm(authenticationRealm).password(password).serverName(authenticationServerName); } else if (saslMechanism != null && saslMechanism.equals("EXTERNAL")) { builder.security().authentication().enable().saslMechanism("EXTERNAL").callbackHandler(callback) .ssl().enable().keyStoreFileName(keyStoreFileName) .keyStorePassword(keyStorePassword.toCharArray()).trustStoreFileName(trustStoreFileName)
public SecurityConfigurationHelper forIspnServer(RemoteInfinispanServer ispnServer) { String hostname = ispnServer.getHotrodEndpoint().getInetAddress().getHostName(); this.addServer().host(hostname).port(ispnServer.getHotrodEndpoint().getPort()); this.security().authentication().saslMechanism(saslMech).enable(); return this; }