public abstract class AbstractUserAuth extends AbstractLoggingBean implements UserAuth
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
name |
private java.lang.String |
service |
private ServerSession |
session |
private java.lang.String |
username |
logBY_NAME_COMPARATOR, NAME_EXTRACTOR| Modifier | Constructor and Description |
|---|---|
protected |
AbstractUserAuth(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
auth(ServerSession session,
java.lang.String username,
java.lang.String service,
Buffer buffer)
Try to authenticate the user.
|
void |
destroy()
Free any system resources used by the module.
|
protected abstract java.lang.Boolean |
doAuth(Buffer buffer,
boolean init) |
java.lang.String |
getName() |
ServerSession |
getServerSession() |
java.lang.String |
getService() |
ServerSession |
getSession() |
java.lang.String |
getUsername() |
java.lang.Boolean |
next(Buffer buffer)
Handle another step in the authentication process.
|
java.lang.String |
toString() |
getSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindByName, getNameList, getNames, ofName, removeByNameprivate final java.lang.String name
private ServerSession session
private java.lang.String service
private java.lang.String username
public final java.lang.String getName()
getName in interface NamedResourcepublic java.lang.String getUsername()
getUsername in interface UsernameHoldernull/empty if holder
not yet initializedpublic java.lang.String getService()
public ServerSession getServerSession()
getServerSession in interface ServerSessionHolderServerSession usedpublic ServerSession getSession()
getSession in interface UserAuthInstance<ServerSession>null if the instance has not
been initialized yetpublic java.lang.Boolean auth(ServerSession session, java.lang.String username, java.lang.String service, Buffer buffer) throws java.lang.Exception
UserAuthnull
value indicating if the authentication succeeded. If the authentication is
still ongoing, a null value should be returned.auth in interface UserAuthsession - the current ServerSession sessionusername - the user trying to log inservice - the requested service namebuffer - the request buffer containing parameters specific to this requesttrue if the authentication succeeded, false if the authentication
failed and null if not finished yetAsyncAuthException - if the service is willing to perform an asynchronous authenticationjava.lang.Exception - if the authentication failspublic java.lang.Boolean next(Buffer buffer) throws java.lang.Exception
UserAuthnext in interface UserAuthbuffer - the request buffer containing parameters specific to this requesttrue if the authentication succeeded, false if the authentication
failed and null if not finished yetAsyncAuthException - if the service is willing to perform an asynchronous authenticationjava.lang.Exception - if the authentication failspublic void destroy()
UserAuthprotected abstract java.lang.Boolean doAuth(Buffer buffer, boolean init) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
toString in class java.lang.Object