Interface SaslClient

All Known Implementing Classes:
SaslExternal

public interface SaslClient
Performs SASL authentication as a client.

A protocol library such as one for LDAP gets an instance of this class in order to perform authentication defined by a specific SASL mechanism. Invoking methods on the SaslClient instance process challenges and create responses according to the SASL mechanism implemented by the SaslClient. As the authentication proceeds, the instance encapsulates the state of a SASL client's authentication exchange.

Here's an example of how an LDAP library might use a SaslClient. It first gets an instance of a SaslClient:

 SaslClient sc = Sasl.createSaslClient(mechanisms,
     authorizationId, protocol, serverName, props, callbackHandler);
It can then proceed to use the client for authentication. For example, an LDAP library might use the client as follows:


 Note that the call to createInitialResponse() is optional.
 Protocols such as IMAP4 do not invoke it but instead only use
 evaluateChallenge(), possibly with an empty challenge.
 It is the responsibility of the SaslClient implementation
 for a mechanism to take this into account so that it behaves properly
 regardless of whether createInitialResponse() is called.
See Also: