.authentication() .saslMechanism("DIGEST-MD5") // define SASL mechanism, in this example we use DIGEST with MD5 hash .callbackHandler(new LoginHandler(username, password.toCharArray(), realm)) // define login handler, implementation defined .enable()
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(); } }
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; }