Package org.apache.qpid.jms.sasl
Class GssapiMechanism
- java.lang.Object
-
- org.apache.qpid.jms.sasl.AbstractMechanism
-
- org.apache.qpid.jms.sasl.GssapiMechanism
-
public class GssapiMechanism extends AbstractMechanism
Implements the GSSAPI sasl authentication Mechanism.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.jms.sasl.Mechanism
Mechanism.PRIORITY
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
-
Fields inherited from class org.apache.qpid.jms.sasl.AbstractMechanism
EMPTY
-
-
Constructor Summary
Constructors Constructor Description GssapiMechanism()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getChallengeResponse(byte[] challenge)
Create a response based on a given challenge from the remote peer.java.lang.String
getConfigScope()
byte[]
getInitialResponse()
Create an initial response based on selected mechanism.java.lang.String
getName()
int
getPriority()
java.lang.String
getProtocol()
java.lang.String
getServerName()
void
init(java.util.Map<java.lang.String,java.lang.String> saslOptions)
Perform any configuration initiation required by the mechanism.boolean
isApplicable(java.lang.String username, java.lang.String password, java.security.Principal localPrincipal)
Allows the mechanism to determine if it can be used given the authentication provided.boolean
isEnabledByDefault()
Allows the mechanism to indicate if it is enabled by default, or only when explicitly enabled through configuring the permitted sasl mechanisms.void
setConfigScope(java.lang.String configScope)
void
setProtocol(java.lang.String protocol)
void
setServerName(java.lang.String serverName)
void
verifyCompletion()
Verifies that the SASL exchange has completed successfully.-
Methods inherited from class org.apache.qpid.jms.sasl.AbstractMechanism
compareTo, getPassword, getUsername, setPassword, setUsername, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.jms.sasl.Mechanism
getAdditionalFailureInformation
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPriority
public int getPriority()
- Returns:
- return the relative priority of this SASL mechanism.
-
getName
public java.lang.String getName()
- Returns:
- the well known name of this SASL mechanism.
-
isEnabledByDefault
public boolean isEnabledByDefault()
Description copied from interface:Mechanism
Allows the mechanism to indicate if it is enabled by default, or only when explicitly enabled through configuring the permitted sasl mechanisms.- Specified by:
isEnabledByDefault
in interfaceMechanism
- Overrides:
isEnabledByDefault
in classAbstractMechanism
- Returns:
- true if this Mechanism is enabled by default.
-
init
public void init(java.util.Map<java.lang.String,java.lang.String> saslOptions)
Description copied from interface:Mechanism
Perform any configuration initiation required by the mechanism.- Specified by:
init
in interfaceMechanism
- Overrides:
init
in classAbstractMechanism
- Parameters:
saslOptions
- An immutable map of sasl options. Will always be non-null.
-
getInitialResponse
public byte[] getInitialResponse() throws javax.security.sasl.SaslException
Description copied from interface:Mechanism
Create an initial response based on selected mechanism. May be null if there is no initial response.- Returns:
- the initial response, or null if there isn't one.
- Throws:
javax.security.sasl.SaslException
- if an error occurs computing the response.
-
getChallengeResponse
public byte[] getChallengeResponse(byte[] challenge) throws javax.security.sasl.SaslException
Description copied from interface:Mechanism
Create a response based on a given challenge from the remote peer.- Parameters:
challenge
- the challenge that this Mechanism should response to.- Returns:
- the response that answers the given challenge.
- Throws:
javax.security.sasl.SaslException
- if an error occurs computing the response.
-
verifyCompletion
public void verifyCompletion() throws javax.security.sasl.SaslException
Description copied from interface:Mechanism
Verifies that the SASL exchange has completed successfully. This is an opportunity for the mechanism to ensure that all mandatory steps have been completed successfully and to cleanup and resources that are held by this Mechanism.- Specified by:
verifyCompletion
in interfaceMechanism
- Overrides:
verifyCompletion
in classAbstractMechanism
- Throws:
javax.security.sasl.SaslException
- if the outcome of the SASL exchange is not valid for this Mechanism
-
isApplicable
public boolean isApplicable(java.lang.String username, java.lang.String password, java.security.Principal localPrincipal)
Description copied from interface:Mechanism
Allows the mechanism to determine if it can be used given the authentication provided.- Parameters:
username
- The user name given to the client for authentication.password
- The password given to the client for authentication.localPrincipal
- The local Principal configured for the client for authentication.- Returns:
- if this Mechanism is able to validate using the given credentials.
-
getProtocol
public java.lang.String getProtocol()
-
setProtocol
public void setProtocol(java.lang.String protocol)
-
getServerName
public java.lang.String getServerName()
-
setServerName
public void setServerName(java.lang.String serverName)
-
getConfigScope
public java.lang.String getConfigScope()
-
setConfigScope
public void setConfigScope(java.lang.String configScope)
-
-