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

public abstract Class AbstractUserAuth

extends AbstractLoggingBean
implements UserAuth
Class Inheritance
All Implemented Interfaces
org.apache.sshd.server.auth.UserAuth, org.apache.sshd.common.auth.UsernameHolder, org.apache.sshd.common.auth.UserAuthInstance, org.apache.sshd.common.NamedResource, org.apache.sshd.server.session.ServerSessionHolder
Known Direct Subclasses
org.apache.sshd.server.auth.UserAuthNone, org.apache.sshd.server.auth.gss.UserAuthGSS, org.apache.sshd.server.auth.hostbased.UserAuthHostBased, org.apache.sshd.server.auth.keyboard.UserAuthKeyboardInteractive, org.apache.sshd.server.auth.password.UserAuthPassword, org.apache.sshd.server.auth.pubkey.UserAuthPublicKey
Imports
java.util.Objects, org.apache.sshd.common.util.ValidateUtils, org.apache.sshd.common.util.buffer.Buffer, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.server.session.ServerSession

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final String
private String
private ServerSession
private String
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public Boolean
auth(ServerSession
the current ServerSession session
session
,
String
the user trying to log in
username
,
String
the requested service name
service
,
Buffer
the request buffer containing parameters specific to this request
buffer
)

Implements org.apache.sshd.server.auth.UserAuth.auth.

Try to authenticate the user.

public void
destroy()

Implements org.apache.sshd.server.auth.UserAuth.destroy.

Free any system resources used by the module.

protected abstract Boolean
doAuth(Buffer buffer, boolean init)

public final String
public ServerSession
public String
public ServerSession
public String
public Boolean
next(Buffer
the request buffer containing parameters specific to this request
buffer
)

Implements org.apache.sshd.server.auth.UserAuth.next.

Handle another step in the authentication process.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

nameback to summary
private final String name
serviceback to summary
private String service
sessionback to summary
private ServerSession session
usernameback to summary
private String username

Constructor Detail

AbstractUserAuthback to summary
protected AbstractUserAuth(String name)

Method Detail

authback to summary
public Boolean auth(ServerSession session, String username, String service, Buffer buffer) throws Exception

Implements org.apache.sshd.server.auth.UserAuth.auth.

Doc from org.apache.sshd.server.auth.UserAuth.auth.

Try to authenticate the user. This methods should return a non null value indicating if the authentication succeeded. If the authentication is still ongoing, a null value should be returned.

Parameters
session:ServerSession

the current ServerSession session

username:String

the user trying to log in

service:String

the requested service name

buffer:Buffer

the request buffer containing parameters specific to this request

Returns:Boolean

true if the authentication succeeded, false if the authentication failed and null if not finished yet

Annotations
@Override
Exceptions
Exception:
if the authentication fails
destroyback to summary
public void destroy()

Implements org.apache.sshd.server.auth.UserAuth.destroy.

Doc from org.apache.sshd.server.auth.UserAuth.destroy.

Free any system resources used by the module.

Annotations
@Override
doAuthback to summary
protected abstract Boolean doAuth(Buffer buffer, boolean init) throws Exception
getNameback to summary
public final String getName()

Implements org.apache.sshd.common.NamedResource.getName.

Returns:String

Doc from org.apache.sshd.common.NamedResource.getName.

The resource name

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
getServiceback to summary
public String getService()
getSessionback to summary
public ServerSession getSession()

Implements org.apache.sshd.common.auth.UserAuthInstance.getSession.

Returns:ServerSession

Doc from org.apache.sshd.common.auth.UserAuthInstance.getSession.

The current session for which the authentication is being tracked

Note

may be null if the instance has not been initialized yet

Annotations
@Override
getUsernameback to summary
public String getUsername()

Implements org.apache.sshd.common.auth.UsernameHolder.getUsername.

Returns:String

Doc from org.apache.sshd.common.auth.UsernameHolder.getUsername.

The attached username - may be null/empty if holder not yet initialized

Annotations
@Override
nextback to summary
public Boolean next(Buffer buffer) throws Exception

Implements org.apache.sshd.server.auth.UserAuth.next.

Doc from org.apache.sshd.server.auth.UserAuth.next.

Handle another step in the authentication process.

Parameters
buffer:Buffer

the request buffer containing parameters specific to this request

Returns:Boolean

true if the authentication succeeded, false if the authentication failed and null if not finished yet

Annotations
@Override
Exceptions
Exception:
if the authentication fails
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override