Top Fields Constructors Methods
org.apache.sshd.server.session

public Class ServerUserAuthService

extends AbstractCloseable
implements Service, ServerSessionHolder
Class Inheritance
All Implemented Interfaces
org.apache.sshd.server.session.ServerSessionHolder, org.apache.sshd.common.Service, org.apache.sshd.common.Closeable, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable, org.apache.sshd.common.PropertyResolver, org.apache.sshd.common.session.SessionHolder, org.apache.sshd.common.session.SessionContextHolder
Imports
java.io.File, .IOException, .InputStream, java.net.MalformedURLException, .URI, .URISyntaxException, .URL, java.nio.charset.Charset, java.nio.file.Files, .Path, .Paths, java.util.ArrayList, .Arrays, .Collections, .List, .Map, .Objects, java.util.concurrent.ConcurrentHashMap, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, java.util.stream.Collectors, org.apache.sshd.common.NamedResource, .Service, .SshConstants, .SshException, org.apache.sshd.common.config.keys.KeyRandomArt, org.apache.sshd.common.io.IoWriteFuture, org.apache.sshd.common.session.Session, .SessionDisconnectHandler, org.apache.sshd.common.util.GenericUtils, .NumberUtils, .ValidateUtils, org.apache.sshd.common.util.buffer.Buffer, org.apache.sshd.common.util.closeable.AbstractCloseable, org.apache.sshd.common.util.io.IoUtils, org.apache.sshd.core.CoreModuleProperties, org.apache.sshd.server.ServerFactoryManager, org.apache.sshd.server.auth.AsyncAuthException, .UserAuth, .UserAuthFactory, .UserAuthNoneFactory, .WelcomeBannerPhase

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private String
private List<List<String>>
private String
private String
private UserAuth
private int
private int
private final Map<String, Object>
private final ServerSession
private List<UserAuthFactory>
private final WelcomeBannerPhase
private final AtomicBoolean
Inherited from org.apache.sshd.common.util.closeable.AbstractCloseable:
closeFuturefutureLockstate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected synchronized void
asyncAuth(int cmd, Buffer buffer, boolean authed)

public ServerFactoryManager
public Map<String, Object>
getProperties()

Implements org.apache.sshd.common.PropertyResolver.getProperties.

A map of properties that can be used to configure the SSH server or client.

public ServerSession
public ServerSession
public WelcomeBannerPhase
protected void
protected void
protected void
protected boolean
protected String
public synchronized void
process(int
The incoming command type
cmd
,
Buffer
The Buffer containing optional command parameters
buffer
)

Implements org.apache.sshd.common.Service.process.

Service the request.

protected String
public IoWriteFuture

Returns:

The sent welcome banner IoWriteFuture - null if none sent
sendWelcomeBanner
(ServerSession
The ServerSession to send the welcome banner to
session
)

Sends the welcome banner (if any configured) and if not already invoked

public void
Inherited from org.apache.sshd.common.util.closeable.AbstractCloseable:
addCloseFutureListenerbuilderclosedoCloseGracefullydoCloseImmediatelygetFutureLockisClosedisClosingpreCloseremoveCloseFutureListener

Field Detail

authMethodback to summary
private String authMethod
authMethodsback to summary
private List<List<String>> authMethods
authServiceback to summary
private String authService
authUserNameback to summary
private String authUserName
currentAuthback to summary
private UserAuth currentAuth
maxAuthRequestsback to summary
private int maxAuthRequests
nbAuthRequestsback to summary
private int nbAuthRequests
propertiesback to summary
private final Map<String, Object> properties
serverSessionback to summary
private final ServerSession serverSession
userAuthFactoriesback to summary
private List<UserAuthFactory> userAuthFactories
welcomePhaseback to summary
private final WelcomeBannerPhase welcomePhase
welcomeSentback to summary
private final AtomicBoolean welcomeSent

Constructor Detail

ServerUserAuthServiceback to summary
public ServerUserAuthService(Session s) throws IOException

Method Detail

asyncAuthback to summary
protected synchronized void asyncAuth(int cmd, Buffer buffer, boolean authed)
getFactoryManagerback to summary
public ServerFactoryManager getFactoryManager()
getPropertiesback to summary
public Map<String, Object> getProperties()

Implements org.apache.sshd.common.PropertyResolver.getProperties.

Doc from org.apache.sshd.common.PropertyResolver.getProperties.

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, the toString() 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 a long then it will be parsed into one. Also, if the mapped value is an Integer but a long is expected, then it will be converted into one.

Returns:Map<String, Object>

a valid Map containing configuration values, never null

Note

may be immutable.

Annotations
@Override
getServerSessionback to summary
public ServerSession getServerSession()

Implements org.apache.sshd.server.session.ServerSessionHolder.getServerSession.

Returns:ServerSession

Doc from org.apache.sshd.server.session.ServerSessionHolder.getServerSession.

The underlying ServerSession used

Annotations
@Override
getSessionback to summary
public ServerSession getSession()

Implements org.apache.sshd.common.session.SessionHolder.getSession.

Annotations
@Override
getWelcomePhaseback to summary
public WelcomeBannerPhase getWelcomePhase()
handleAuthenticationFailureback to summary
protected void handleAuthenticationFailure(int cmd, Buffer buffer) throws Exception
handleAuthenticationInProgressback to summary
protected void handleAuthenticationInProgress(int cmd, Buffer buffer) throws Exception
handleAuthenticationSuccessback to summary
protected void handleAuthenticationSuccess(int cmd, Buffer buffer) throws Exception
handleUserAuthRequestMessageback to summary
protected boolean handleUserAuthRequestMessage(ServerSession session, Buffer buffer, AtomicReference<Boolean> authHolder) throws Exception
loadWelcomeBannerback to summary
protected String loadWelcomeBanner(ServerSession session, URL url, Charset cs) throws IOException
processback to summary
public synchronized void process(int cmd, Buffer buffer) throws Exception

Implements org.apache.sshd.common.Service.process.

Doc from org.apache.sshd.common.Service.process.

Service the request.

Parameters
cmd:int

The incoming command type

buffer:Buffer

The Buffer containing optional command parameters

Annotations
@Override
Exceptions
Exception:
If failed to process the command
resolveWelcomeBannerback to summary
protected String resolveWelcomeBanner(ServerSession session) throws IOException
sendWelcomeBannerback to summary
public IoWriteFuture sendWelcomeBanner(ServerSession session) throws IOException

Sends the welcome banner (if any configured) and if not already invoked

Parameters
session:ServerSession

The ServerSession to send the welcome banner to

Returns:IoWriteFuture

The sent welcome banner IoWriteFuture - null if none sent

Exceptions
IOException:
If failed to send the banner
startback to summary
public void start()

Implements org.apache.sshd.common.Service.start.

Annotations
@Override