powered by Jive Software

Add/register new custom SASLJavaXMechanism

Hi there!
I’m trying to register a new custom authentication mechanism.

For instance for available mechanisms request I get:

PLAIN

Mechanisms being a list it allows multiple mechanisms.
I want a custom one (let’s call it CUSTOM) with a higher priority.
I see there is a SASLAuthentication.registerSASLMechanism(new CustomMechanism()); method.
How and when should I call it in order to add it in an elegant manner.

Not sure about the ‘how’ part, but you would usually register SASL mechanisms in a static initialisier block.

Thanks for your reply!
I’ll leave my solution:
SASLAuthentication.registerSASLMechanism(new MyCustomMechanism() [extends SASLMechanism]);

Also I had to enable the new mechanism using addEnabledSaslMechanism() into ConnectionConfiguration.Builder