Class ServerUserAuthService
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,Closeable
,PropertyResolver
,Service
,SessionContextHolder
,SessionHolder<Session>
,ServerSessionHolder
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
private String
private UserAuth
private int
private int
private final ServerSession
private List
<UserAuthFactory> private final WelcomeBannerPhase
private final AtomicBoolean
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
Fields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
A map of properties that can be used to configure the SSH server or client.protected void
handleAuthenticationFailure
(int cmd, Buffer buffer) protected void
handleAuthenticationInProgress
(int cmd, Buffer buffer) protected void
handleAuthenticationSuccess
(int cmd, Buffer buffer) protected boolean
handleUserAuthRequestMessage
(ServerSession session, Buffer buffer, AtomicReference<Boolean> authHolder) protected String
loadWelcomeBanner
(ServerSession session, URL url, Charset cs) void
Service the request.protected String
resolveWelcomeBanner
(ServerSession session) sendWelcomeBanner
(ServerSession session) Sends the welcome banner (if any configured) and if not already invokedvoid
start()
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListener
Methods 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, warn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
Methods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmpty
Methods inherited from interface org.apache.sshd.common.Service
getParentPropertyResolver
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
Field Details
-
welcomeSent
-
properties
-
serverSession
-
welcomePhase
-
userAuthFactories
-
authMethods
-
authUserName
-
authMethod
-
authService
-
currentAuth
-
maxAuthRequests
private int maxAuthRequests -
nbAuthRequests
private int nbAuthRequests
-
-
Constructor Details
-
ServerUserAuthService
- Throws:
IOException
-
-
Method Details
-
getWelcomePhase
-
start
public void start() -
getSession
- Specified by:
getSession
in interfaceSessionHolder<Session>
-
getServerSession
- Specified by:
getServerSession
in interfaceServerSessionHolder
- Returns:
- The underlying
ServerSession
used
-
getProperties
Description copied from interface:PropertyResolver
A 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 along
then it will be parsed into one. Also, if the mapped value is anInteger
but along
is expected, then it will be converted into one.- Specified by:
getProperties
in interfacePropertyResolver
- Returns:
- a valid
Map
containing configuration values, nevernull
. Note: may be immutable.
-
process
Description copied from interface:Service
Service the request. -
handleUserAuthRequestMessage
protected boolean handleUserAuthRequestMessage(ServerSession session, Buffer buffer, AtomicReference<Boolean> authHolder) throws Exception - Throws:
Exception
-
asyncAuth
-
handleAuthenticationInProgress
- Throws:
Exception
-
handleAuthenticationSuccess
- Throws:
Exception
-
handleAuthenticationFailure
- Throws:
Exception
-
sendWelcomeBanner
Sends the welcome banner (if any configured) and if not already invoked- Parameters:
session
- TheServerSession
to send the welcome banner to- Returns:
- The sent welcome banner
IoWriteFuture
-null
if none sent - Throws:
IOException
- If failed to send the banner
-
resolveWelcomeBanner
- Throws:
IOException
-
loadWelcomeBanner
- Throws:
IOException
-
getFactoryManager
-