Class ClientUserAuthService
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,ClientSessionHolder,Closeable,PropertyResolver,Service,SessionContextHolder,SessionHolder<Session>
ssh-auth service.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<UserAuthFactory> protected final AtomicReference<AuthFuture> The AuthFuture that is being used by the current auth request.protected final ClientSessionImplprivate intprivate Runnableprivate final Objectprivate Stringprivate booleanprivate UserAuthFields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, stateFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprotected AuthFuturecreateAuthFuture(ClientSession session, String service) A map of properties that can be used to configure the SSH server or client.protected voidpreClose()preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.voidService the request.protected voidprocessUserAuth(int cmd, Buffer buffer, AuthFuture authFuture) Execute one step in user authentication.protected IoWriteFuturesendInitialAuthRequest(ClientSession session, String service) voidstart()protected voidtryNext(int cmd, AuthFuture authFuture) protected AuthFutureupdateCurrentAuthFuture(ClientSession session, String service) Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, removeCloseFutureListenerMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListenerMethods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmptyMethods inherited from interface org.apache.sshd.common.Service
getParentPropertyResolverMethods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
Field Details
-
authFutureHolder
The AuthFuture that is being used by the current auth request. It is set while an authentication is ongoing. -
clientSession
-
authFactories
-
clientMethods
-
serverMethods
-
properties
-
service
-
userAuth
-
currentMethod
private int currentMethod -
initLock
-
started
private boolean started -
initialRequestSender
-
-
Constructor Details
-
ClientUserAuthService
-
-
Method Details
-
getSession
- Specified by:
getSessionin interfaceSessionHolder<Session>
-
getClientSession
- Specified by:
getClientSessionin interfaceClientSessionHolder- Returns:
- The underlying
ClientSessionused
-
getProperties
Description copied from interface:PropertyResolverA map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the expected configuration value type -
Long, Integer, Boolean, String, etc.... If it doesn't, thetoString()result of the mapped value is used to convert it to the required type. E.g., if the mapped value is the string "1234" and the expected value is alongthen it will be parsed into one. Also, if the mapped value is anIntegerbut alongis expected, then it will be converted into one.- Specified by:
getPropertiesin interfacePropertyResolver- Returns:
- a valid
Mapcontaining configuration values, nevernull. Note: may be immutable.
-
start
public void start() -
getCurrentServiceName
-
auth
- Throws:
IOException
-
updateCurrentAuthFuture
protected AuthFuture updateCurrentAuthFuture(ClientSession session, String service) throws IOException - Throws:
IOException
-
createAuthFuture
- Throws:
IOException
-
sendInitialAuthRequest
protected IoWriteFuture sendInitialAuthRequest(ClientSession session, String service) throws IOException - Throws:
IOException
-
process
Description copied from interface:ServiceService the request. -
processUserAuth
Execute one step in user authentication.- Parameters:
cmd- the commandbuffer- the inputBuffer, with the reading position after the command byteauthFuture- theAuthFuture- Throws:
Exception- If failed to process
-
tryNext
- Throws:
Exception
-
clearUserAuth
private void clearUserAuth() -
preClose
protected void preClose()Description copied from class:AbstractCloseablepreClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true- Overrides:
preClosein classAbstractCloseable
-