|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.smack.sasl.SASLMechanism
public abstract class SASLMechanism
Base class for SASL mechanisms. Subclasses must implement three methods:
getName() -- returns the common name of the SASL mechanism.getAuthenticationText(String, String, String) -- authentication text to include
in the initial auth stanza.getChallengeResponse(byte[]) -- to respond challenges made by the server.
| Constructor Summary | |
|---|---|
SASLMechanism(SASLAuthentication saslAuthentication)
|
|
| Method Summary | |
|---|---|
void |
authenticate(String username,
String host,
String password)
Builds and sends the auth stanza to the server. |
void |
challengeReceived(String challenge)
The server is challenging the SASL mechanism for the stanza he just sent. |
protected abstract String |
getAuthenticationText(String username,
String host,
String password)
Returns the authentication text to include in the initial auth stanza or null if nothing should be added. |
protected abstract String |
getChallengeResponse(byte[] bytes)
Returns the response text to send answering the challenge sent by the server. |
protected abstract String |
getName()
Returns the common name of the SASL mechanism. |
protected SASLAuthentication |
getSASLAuthentication()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SASLMechanism(SASLAuthentication saslAuthentication)
| Method Detail |
|---|
public void authenticate(String username,
String host,
String password)
throws IOException
username - the username of the user being authenticated.host - the hostname where the user account resides.password - the password of the user.
IOException - If a network error occures while authenticating.
public void challengeReceived(String challenge)
throws IOException
challenge - a base64 encoded string representing the challenge.
IOExceptionprotected abstract String getChallengeResponse(byte[] bytes)
bytes - the challenge sent by the server.
protected abstract String getName()
protected abstract String getAuthenticationText(String username,
String host,
String password)
username - the username of the user being authenticated.host - the hostname where the user account resides.password - the password of the user.
protected SASLAuthentication getSASLAuthentication()
|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||