use of org.jgroups.auth.sasl.SaslClientCallbackHandler in project JGroups by belaban.
the class SASL method init.
@Override
public void init() throws Exception {
super.init();
saslServerFactory = SaslUtils.getSaslServerFactory(mech, sasl_props);
saslClientFactory = SaslUtils.getSaslClientFactory(mech, sasl_props);
char[] client_password_chars = client_password == null ? new char[] {} : client_password.toCharArray();
if (client_callback_handler == null) {
client_callback_handler = client_password == null ? Void -> {
} : new SaslClientCallbackHandler(client_name, client_password_chars);
}
if (server_callback_handler == null) {
server_callback_handler = Void -> {
};
}
if (server_subject == null && login_module_name != null) {
LoginContext lc = new LoginContext(login_module_name);
lc.login();
server_subject = lc.getSubject();
}
if (client_subject == null && login_module_name != null) {
LoginContext lc = new LoginContext(login_module_name, new SaslClientCallbackHandler(client_name, client_password_chars));
lc.login();
client_subject = lc.getSubject();
}
}
Aggregations