public interface Mechanism extends Comparable<Mechanism>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Mechanism.PRIORITY
Relative priority values used to arrange the found SASL
mechanisms in a preferred order where the level of security
generally defines the preference.
|
| Modifier and Type | Method and Description |
|---|---|
default String |
getAdditionalFailureInformation()
Allows a mechanism to report additional information on the reason for
authentication failure (e.g.
|
byte[] |
getChallengeResponse(byte[] challenge)
Create a response based on a given challenge from the remote peer.
|
byte[] |
getInitialResponse()
Create an initial response based on selected mechanism.
|
String |
getName() |
String |
getPassword()
Returns the configured password value for this Mechanism.
|
int |
getPriority() |
String |
getUsername()
Returns the configured user name value for this Mechanism.
|
void |
init(Map<String,String> options)
Perform any configuration initiation required by the mechanism.
|
boolean |
isApplicable(String username,
String password,
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 |
setPassword(String username)
Sets the password value for this Mechanism.
|
void |
setUsername(String username)
Sets the user name value for this Mechanism.
|
void |
verifyCompletion()
Verifies that the SASL exchange has completed successfully.
|
compareToint getPriority()
String getName()
void init(Map<String,String> options)
options - An immutable map of sasl options. Will always be non-null.byte[] getInitialResponse()
throws SaslException
SaslException - if an error occurs computing the response.byte[] getChallengeResponse(byte[] challenge)
throws SaslException
challenge - the challenge that this Mechanism should response to.SaslException - if an error occurs computing the response.void verifyCompletion()
throws SaslException
SaslException - if the outcome of the SASL exchange is not valid for this Mechanismvoid setUsername(String username)
username - The user name given.String getUsername()
void setPassword(String username)
username - The user name given.String getPassword()
boolean isApplicable(String username, String password, Principal localPrincipal)
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.boolean isEnabledByDefault()
default String getAdditionalFailureInformation()
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.