Class LocalUserServer
- java.lang.Object
-
- org.wildfly.security.sasl.util.AbstractSaslParticipant
-
- org.wildfly.security.sasl.util.AbstractSaslServer
-
- org.wildfly.security.sasl.localuser.LocalUserServer
-
- All Implemented Interfaces:
SaslServer
,SaslWrapper
final class LocalUserServer extends AbstractSaslServer implements SaslServer
- Author:
- David M. Lloyd, Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description private String
authorizationId
private File
basePath
private byte[]
challengeBytes
private File
challengeFile
static String
DEFAULT_USER
private String
defaultUser
private static int
INITIAL_CHALLENGE_STATE
static String
LEGACY_DEFAULT_USER
static String
LEGACY_LOCAL_USER_CHALLENGE_PATH
static String
LEGACY_LOCAL_USER_USE_SECURE_RANDOM
static String
LOCAL_USER_CHALLENGE_PATH
static String
LOCAL_USER_USE_SECURE_RANDOM
private static int
PROCESS_RESPONSE_STATE
private boolean
useSecureRandom
private static byte
UTF8NUL
-
Fields inherited from class org.wildfly.security.sasl.util.AbstractSaslParticipant
COMPLETE_STATE, FAILED_STATE, NO_BYTES
-
Fields inherited from interface org.wildfly.security.sasl.util.SaslWrapper
IDENTITY
-
-
Constructor Summary
Constructors Constructor Description LocalUserServer(String protocol, String serverName, Map<String,?> props, CallbackHandler callbackHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
deleteChallenge()
void
dispose()
Dispose of this participant.private static <T> T
doPrivileged(PrivilegedAction<T> action)
protected byte[]
evaluateMessage(int state, byte[] message)
String
getAuthorizationID()
private static String
getProperty(String name)
private Random
getRandom()
void
init()
-
Methods inherited from class org.wildfly.security.sasl.util.AbstractSaslServer
evaluateResponse
-
Methods inherited from class org.wildfly.security.sasl.util.AbstractSaslParticipant
assertComplete, evaluateMessage, getCallbackHandler, getIntProperty, getMechanismName, getNegotiatedProperty, getProtocol, getServerName, getStringProperty, getWrapper, handleCallbacks, isComplete, negotiationComplete, setNegotiationState, setWrapper, tryHandleCallbacks, unwrap, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.security.sasl.SaslServer
evaluateResponse, getMechanismName, getNegotiatedProperty, isComplete, unwrap, wrap
-
-
-
-
Field Detail
-
LOCAL_USER_USE_SECURE_RANDOM
public static final String LOCAL_USER_USE_SECURE_RANDOM
- See Also:
- Constant Field Values
-
LEGACY_LOCAL_USER_USE_SECURE_RANDOM
public static final String LEGACY_LOCAL_USER_USE_SECURE_RANDOM
- See Also:
- Constant Field Values
-
LOCAL_USER_CHALLENGE_PATH
public static final String LOCAL_USER_CHALLENGE_PATH
- See Also:
- Constant Field Values
-
LEGACY_LOCAL_USER_CHALLENGE_PATH
public static final String LEGACY_LOCAL_USER_CHALLENGE_PATH
- See Also:
- Constant Field Values
-
DEFAULT_USER
public static final String DEFAULT_USER
- See Also:
- Constant Field Values
-
LEGACY_DEFAULT_USER
public static final String LEGACY_DEFAULT_USER
- See Also:
- Constant Field Values
-
UTF8NUL
private static final byte UTF8NUL
- See Also:
- Constant Field Values
-
INITIAL_CHALLENGE_STATE
private static final int INITIAL_CHALLENGE_STATE
- See Also:
- Constant Field Values
-
PROCESS_RESPONSE_STATE
private static final int PROCESS_RESPONSE_STATE
- See Also:
- Constant Field Values
-
authorizationId
private volatile String authorizationId
-
challengeFile
private volatile File challengeFile
-
challengeBytes
private volatile byte[] challengeBytes
-
basePath
private final File basePath
-
defaultUser
private final String defaultUser
-
useSecureRandom
private final boolean useSecureRandom
-
-
Constructor Detail
-
LocalUserServer
LocalUserServer(String protocol, String serverName, Map<String,?> props, CallbackHandler callbackHandler)
-
-
Method Detail
-
doPrivileged
private static <T> T doPrivileged(PrivilegedAction<T> action)
-
getRandom
private Random getRandom()
-
init
public void init()
- Overrides:
init
in classAbstractSaslParticipant
-
getAuthorizationID
public String getAuthorizationID()
- Specified by:
getAuthorizationID
in interfaceSaslServer
-
deleteChallenge
private void deleteChallenge()
-
dispose
public void dispose() throws SaslException
Description copied from class:AbstractSaslParticipant
Dispose of this participant.- Specified by:
dispose
in interfaceSaslServer
- Overrides:
dispose
in classAbstractSaslParticipant
- Throws:
SaslException
- if disposal failed
-
evaluateMessage
protected byte[] evaluateMessage(int state, byte[] message) throws SaslException
- Specified by:
evaluateMessage
in classAbstractSaslParticipant
- Throws:
SaslException
-
-