This class is responsible authenticating the user using SASL, binding the resource to the connection and establishing a session with the server.
Once TLS has been negotiated (i.e. the connection has been secured) it is possible to register with the server, authenticate using Non-SASL or authenticate using SASL. If the server supports SASL then Smack will first try to authenticate using SASL. But if that fails then Non-SASL will be tried.
The server may support many SASL mechanisms to use for authenticating. Out of the box Smack provides several SASL mechanisms, but it is possible to register new SASL Mechanisms. Use {@link #registerSASLMechanism(String,Class)} to register a new mechanisms. A registeredmechanism wont be used until {@link #supportSASLMechanism(String,int)} is called. By default,the list of supported SASL mechanisms is determined from the {@link SmackConfiguration}.
Once the user has been authenticated with SASL, it is necessary to bind a resource for the connection. If no resource is passed in {@link #authenticate(String,String,String)}then the server will assign a resource for the connection. In case a resource is passed then the server will receive the desired resource but may assign a modified resource for the connection.
Once a resource has been binded and if the server supports sessions then Smack will establish a session so that instant messaging and presence functionalities may be used.
@see org.jivesoftware.smack.sasl.SASLMechanism @author Gaston Dombiak @author Jay Kline
|
|