Package com.tailf.dp
Class DpAuthContext
Object
com.tailf.dp.DpAuthContext
Authentication context class. The DpAuthCallback.auth() callback method is
invoked with an instance of this class that provides information about the
result of the authentication so far.
-
Constructor Summary
ConstructorDescriptionDpAuthContext
(DpUserInfo uinfo, String method, boolean success, int ngroups, String[] groups, int logno, String reason, String errstr) -
Method Summary
Modifier and TypeMethodDescriptionerrstr is an extended error information that can be set using method setError() and is used in the response if the auth() callback returns false;String[]
If success is true, the AAA authentication succeeded, and groups is an array of length ngroups that gives the groups that will be assigned to the user at login.int
getLogNo()
If success is false, the AAA authentication failed (with logno set to CONFD_AUTH_LOGIN_FAIL).The method string gives the authentication method used, as follows:int
If success is true, the AAA authentication succeeded, ngroups is the number of groups that will be assigned to the user at login.If success is false, the AAA authentication failed, reason is a explanatory string reason.The uinfo contains an instance of DpUserInfo with details about the user logging in, specifically user name, password (if used), source IP address, context, and protocol.boolean
success is true if the user is accepted so far (before call of auth() callback) return boolean true if successvoid
-
Constructor Details
-
DpAuthContext
public DpAuthContext(DpUserInfo uinfo, String method, boolean success, int ngroups, String[] groups, int logno, String reason, String errstr)
-
-
Method Details
-
setError
-
getUserInfo
The uinfo contains an instance of DpUserInfo with details about the user logging in, specifically user name, password (if used), source IP address, context, and protocol. Note that the user session does not actually exist at this point, even if the AAA authentication was successful - it will only be created if the callback accepts the authentication, hence e.g. the usid element is always 0.- Returns:
- DpUserInfo userinfo
-
getMethod
The method string gives the authentication method used, as follows:"password" Password authentication. This generic term is used if the authentication failed. "local", "pam", "external" Password authentication. On successful authentication, the specific method that succeeded is given. See the AAA chapter in the User Guide for an explanation of these methods. "publickey" Public key authentication via the internal SSH server. Other Authentication with an unknown or unsupported method with this name was attempted via the internal SSH server.
- Returns:
- String method
-
isSuccess
public boolean isSuccess()success is true if the user is accepted so far (before call of auth() callback) return boolean true if success -
getNumGroups
public int getNumGroups()If success is true, the AAA authentication succeeded, ngroups is the number of groups that will be assigned to the user at login.- Returns:
- int number of groups
-
getGroups
If success is true, the AAA authentication succeeded, and groups is an array of length ngroups that gives the groups that will be assigned to the user at login. If the callback returns true the complete authentication succeeds and the user is logged in. If it returns false (or an invalid return value), the authentication fails.- Returns:
- String[] groups
-
getLogNo
public int getLogNo()If success is false, the AAA authentication failed (with logno set to CONFD_AUTH_LOGIN_FAIL). This invocation is only for informational purposes - the callback return value has no effect on the authentication, and should normally be true.- Returns:
- int logno
-
getReason
If success is false, the AAA authentication failed, reason is a explanatory string reason. This invocation is only for informational purposes - the callback return value has no effect on the authentication, and should normally be true.- Returns:
- String reason
-
getErrorString
errstr is an extended error information that can be set using method setError() and is used in the response if the auth() callback returns false;- Returns:
- String error string
-