-
Bug
-
Resolution: Done
-
Major
-
8.2.0.Alpha1
-
None
Currently this code is required to authenticate with the C# client:
AuthenticationStringCallback cbUser = new AuthenticationStringCallback(user); AuthenticationStringCallback cbPass = new AuthenticationStringCallback(password); AuthenticationStringCallback cbRealm = new AuthenticationStringCallback(REALM); IDictionary<int, AuthenticationStringCallback> cbMap = new Dictionary<int, AuthenticationStringCallback>(); cbMap.Add((int)SaslCallbackId.SASL_CB_USER, cbUser); cbMap.Add((int)SaslCallbackId.SASL_CB_PASS, cbPass); cbMap.Add((int)SaslCallbackId.SASL_CB_GETREALM, cbRealm); conf.Security().Authentication() .Enable() .SaslMechanism(GetMech()) .SetupCallback(cbMap);
Whereas, the Java client requires something like this:
clientConfigurationBuilder.security() .authentication() .enable() .saslMechanism("CRAM-MD5") .callbackHandler(new TestCallbackHandler("user", "realm", "password".toCharArray()));
Which is a lot simpler. Is there any way to improve the usability of this API? Could the CallBackHandler deal with some of this complexity instead?