Package org.jivesoftware.smack.sasl.core
Class ScramMechanism
- java.lang.Object
-
- org.jivesoftware.smack.sasl.SASLMechanism
-
- org.jivesoftware.smack.sasl.core.ScramMechanism
-
- All Implemented Interfaces:
Comparable<SASLMechanism>
- Direct Known Subclasses:
ScramPlusMechanism,SCRAMSHA1Mechanism
public abstract class ScramMechanism extends SASLMechanism
-
-
Field Summary
-
Fields inherited from class org.jivesoftware.smack.sasl.SASLMechanism
authenticationId, authorizationId, connection, connectionConfiguration, CRAMMD5, DIGESTMD5, EXTERNAL, GSSAPI, host, password, PLAIN, serviceName, sslSession
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedScramMechanism(ScramHmac scramHmac)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidauthenticateInternal(CallbackHandler cbh)booleanauthzidSupported()voidcheckIfSuccessfulOrThrow()protected byte[]evaluateChallenge(byte[] challenge)Evaluate the SASL challenge.protected byte[]getAuthenticationText()Should return the initial response of the SASL mechanism.protected byte[]getChannelBindingData()protected StringgetGs2CbindFlag()Get the SCRAM GSS-API Channel Binding Flag value.StringgetName()Returns the common name of the SASL mechanism.-
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
afterFinalSaslChallenge, authenticate, authenticate, authenticateInternal, challengeReceived, compareTo, getPriority, instanceForAuthentication, isAuthenticationSuccessful, isFinished, newInstance, requiresPassword, saslPrep, setException, throwExceptionIfRequired, toBytes, toString
-
-
-
-
Constructor Detail
-
ScramMechanism
protected ScramMechanism(ScramHmac scramHmac)
-
-
Method Detail
-
authenticateInternal
protected void authenticateInternal(CallbackHandler cbh)
- Specified by:
authenticateInternalin classSASLMechanism
-
getAuthenticationText
protected byte[] getAuthenticationText()
Description copied from class:SASLMechanismShould return the initial response of the SASL mechanism. The returned byte array will be send base64 encoded to the server. SASL mechanism are free to returnnullor an empty array here.- Specified by:
getAuthenticationTextin classSASLMechanism- Returns:
- the initial response or null
-
getName
public String getName()
Description copied from class:SASLMechanismReturns the common name of the SASL mechanism. E.g.: PLAIN, DIGEST-MD5 or GSSAPI.- Specified by:
getNamein classSASLMechanism- Returns:
- the common name of the SASL mechanism.
-
checkIfSuccessfulOrThrow
public void checkIfSuccessfulOrThrow() throws SmackException.SmackSaslException
- Specified by:
checkIfSuccessfulOrThrowin classSASLMechanism- Throws:
SmackException.SmackSaslException
-
authzidSupported
public boolean authzidSupported()
- Overrides:
authzidSupportedin classSASLMechanism
-
evaluateChallenge
protected byte[] evaluateChallenge(byte[] challenge) throws SmackException.SmackSaslException
Description copied from class:SASLMechanismEvaluate the SASL challenge.- Overrides:
evaluateChallengein classSASLMechanism- Parameters:
challenge- challenge to evaluate.- Returns:
- null.
- Throws:
SmackException.SmackSaslException- If a SASL related error occurs.
-
getGs2CbindFlag
protected String getGs2CbindFlag()
Get the SCRAM GSS-API Channel Binding Flag value.- Returns:
- the gs2-cbind-flag value.
- See Also:
- RFC 5802 ยง 6.
-
getChannelBindingData
protected byte[] getChannelBindingData() throws SmackException.SmackSaslException
- Returns:
- the Channel Binding data.
- Throws:
SmackException.SmackSaslException- if a SASL specific error occurred.
-
-