Package org.wildfly.security.sasl.util
Class AbstractSaslClient
java.lang.Object
org.wildfly.security.sasl.util.AbstractSaslParticipant
org.wildfly.security.sasl.util.AbstractSaslClient
- All Implemented Interfaces:
SaslClient,SaslWrapper
- Direct Known Subclasses:
AnonymousSaslClient,LocalUserClient
A base class for SASL client implementations.
- Author:
- David M. Lloyd
-
Field Summary
Fields inherited from class org.wildfly.security.sasl.util.AbstractSaslParticipant
COMPLETE_STATE, FAILED_STATE, NO_BYTESFields inherited from interface org.wildfly.security.sasl.util.SaslWrapper
IDENTITY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSaslClient(String mechanismName, String protocol, String serverName, CallbackHandler callbackHandler, String authorizationId, boolean hasInitialResponse) Deprecated.protectedAbstractSaslClient(String mechanismName, String protocol, String serverName, CallbackHandler callbackHandler, String authorizationId, boolean hasInitialResponse, ElytronMessages log) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]evaluateChallenge(byte[] challenge) Evaluate an authentication challenge received from the server.protected StringGet the specified authorization ID.booleanDetermines whether this mechanism has an optional initial response.Methods inherited from class org.wildfly.security.sasl.util.AbstractSaslParticipant
assertComplete, dispose, evaluateMessage, evaluateMessage, getCallbackHandler, getIntProperty, getMechanismName, getNegotiatedProperty, getProtocol, getServerName, getStringProperty, getWrapper, handleCallbacks, init, isComplete, negotiationComplete, setNegotiationState, setWrapper, tryHandleCallbacks, unwrap, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.security.sasl.SaslClient
dispose, getMechanismName, getNegotiatedProperty, isComplete, unwrap, wrap
-
Constructor Details
-
AbstractSaslClient
protected AbstractSaslClient(String mechanismName, String protocol, String serverName, CallbackHandler callbackHandler, String authorizationId, boolean hasInitialResponse, ElytronMessages log) Construct a new instance.- Parameters:
mechanismName- the SASL mechanism nameprotocol- the protocolserverName- the server namecallbackHandler- the callback handler to use for authenticationauthorizationId- the possiblynullprotocol-dependent name used for authorizationhasInitialResponse-trueif the mechanism supports an initial response,falseotherwiselog- mechanism specific logger
-
AbstractSaslClient
@Deprecated protected AbstractSaslClient(String mechanismName, String protocol, String serverName, CallbackHandler callbackHandler, String authorizationId, boolean hasInitialResponse) Deprecated.Construct a new instance.- Parameters:
mechanismName- the SASL mechanism nameprotocol- the protocolserverName- the server namecallbackHandler- the callback handler to use for authenticationauthorizationId- the possiblynullprotocol-dependent name used for authorizationhasInitialResponse-trueif the mechanism supports an initial response,falseotherwise
-
-
Method Details
-
evaluateChallenge
Evaluate an authentication challenge received from the server.- Specified by:
evaluateChallengein interfaceSaslClient- Parameters:
challenge- the authentication challenge- Returns:
- the response to send to the server
- Throws:
SaslException- if there is an error processing the server message
-
hasInitialResponse
public boolean hasInitialResponse()Determines whether this mechanism has an optional initial response. If true, caller should callevaluateChallenge(byte[])with an empty array to get the initial response.- Specified by:
hasInitialResponsein interfaceSaslClient- Returns:
trueif this mechanism has an initial response
-
getAuthorizationId
Get the specified authorization ID.- Returns:
- the authorization ID
-