Class BaseUserSession
- Direct Known Subclasses:
PseudoUserSession
,UserSession
BaseUserSession class implements APIs common to UserSession and PseudoUserSession. BaseUserSession is internal to the implementation of this Access SDK and should not be used or extended by the end application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all information pertaining to actions that was retrieved as part of previous authentication or authorization operation.Returns action corresponding to the action name and type specified.getActions<wbr>(String actionType)
Returns hashtable containing actions in the form of name/value pairs of String type for specified actionType.String[]
Returns string array of all the action types returned by the OAM server as part of authentication or authorization.Returns plugin error code sent by the custom pluginError
int
getError()
Returns error number determined by the most recent authentication or authorization.Returns detailed error message pertaining to authentication or authorization failure.int
getLevel()
Returns authentication scheme level at which user is authenticated.Returns the IP address of the client as specified by the application while creating the session.int
getNumberOfActions<wbr>(String actionType)
Returns number of actions of the specified type that are returned by OAM server as part of authentication or authorization.int
Provides integer value representing the current status of the session.Returns the DN of the user's profile entry in the user directory.boolean
isAuthorized<wbr>(ResourceRequest res)
To check whether the user is authorized to access the resourceboolean
isAuthorized<wbr>(ResourceRequest res, Hashtable parameters)
To check whether the user is authorized to access the resourcevoid
setLocation<wbr>(String sLocation)
Sets the IP address of the client as provided by the application.
-
Field Details
-
OK
public static final int OK- See Also:
-
ERR_UNKNOWN
public static final int ERR_UNKNOWN- See Also:
-
ERR_NO_USER
public static final int ERR_NO_USER- See Also:
-
ERR_USER_REVOKED
public static final int ERR_USER_REVOKED- See Also:
-
ERR_WRONG_PASSWORD
public static final int ERR_WRONG_PASSWORD- See Also:
-
ERR_INVALID_CERTIFICATE
public static final int ERR_INVALID_CERTIFICATE- See Also:
-
ERR_AUTHN_PLUGIN_DENIED
public static final int ERR_AUTHN_PLUGIN_DENIED- See Also:
-
ERR_INSUFFICIENT_LEVEL
public static final int ERR_INSUFFICIENT_LEVEL- See Also:
-
ERR_NOT_LOGGED_IN
public static final int ERR_NOT_LOGGED_IN- See Also:
-
ERR_SESSION_TIMEOUT
public static final int ERR_SESSION_TIMEOUT- See Also:
-
ERR_IDLE_TIMEOUT
public static final int ERR_IDLE_TIMEOUT- See Also:
-
ERR_DENY
public static final int ERR_DENY- See Also:
-
ERR_PASSWORD_EXPIRED
public static final int ERR_PASSWORD_EXPIRED- See Also:
-
ERR_PASSWORD_CHANGE_ON_RESET
public static final int ERR_PASSWORD_CHANGE_ON_RESET- See Also:
-
ERR_USER_LOCKED_OUT
public static final int ERR_USER_LOCKED_OUT- See Also:
-
ERR_NEED_MORE_DATA
public static final int ERR_NEED_MORE_DATA- See Also:
-
ERR_INCONCLUSIVE
public static final int ERR_INCONCLUSIVE- See Also:
-
ERR_MOD_USER_FAILED
public static final int ERR_MOD_USER_FAILED- See Also:
-
ERR_AUTHN_TOKEN_EXPIRED
public static final int ERR_AUTHN_TOKEN_EXPIRED- See Also:
-
AWAITINGLOGIN
public static final int AWAITINGLOGIN- See Also:
-
LOGGEDIN
public static final int LOGGEDIN- See Also:
-
LOGGEDOUT
public static final int LOGGEDOUT- See Also:
-
LOGINFAILED
public static final int LOGINFAILED- See Also:
-
EXPIRED
public static final int EXPIRED- See Also:
-
LOGGED_OUT_SESSION_TOKEN
- See Also:
-
-
Method Details
-
getLevel
Returns authentication scheme level at which user is authenticated.- Returns:
- Authentication scheme level
- Throws:
AccessException
- If error occurs during operation
-
getUserIdentity
Returns the DN of the user's profile entry in the user directory.- Returns:
- DN of the user's profile entry
- Throws:
AccessException
- If error occurs during operation
-
getLocation
Returns the IP address of the client as specified by the application while creating the session.- Returns:
- IP address of the client
- Throws:
AccessException
- If error occurs during operation
-
getAction
Returns action corresponding to the action name and type specified. The actions are the responses that OAM server returns after authentication and authorization. The actions that are returned during authentication or authorization depends on policies configured in the OAM server.Each resource type defines the following set of action types: cookie, headervar and redirecturl for http resources. The redirecturl action type indicates the url where the user should be redirected to for successful or failed authentication or authorization. To retrieve the redirection url set action type to "redirecturl" and name to "HTTP_REDIRECT".
- Parameters:
actionType
- type of action to be retrieved. If this is left NULL, the default is headervar.name
- name of the action to be retrieved.- Returns:
- Action corresponding to the action name and type specified.
-
getActions
Returns hashtable containing actions in the form of name/value pairs of String type for specified actionType. The actions are the responses that OAM server returns after authentication and authorization. The actions that are returned during authentication or authorization depends on policies configured in the OAM server.Each resource type defines the following set of action types: cookie, headervar and redirecturl for http resources. The redirecturl action type indicates the url where the user should be redirected to for successful or failed authentication or authorization. To retrieve the redirection url set action type to "redirecturl".
- Parameters:
actionType
- type of action to be retrieved. If this is left NULL, the default is "headervar".- Returns:
- Hashtable containing actions in the form of name/value pairs of String type.
-
getNumberOfActions
Returns number of actions of the specified type that are returned by OAM server as part of authentication or authorization. The actions are the responses that OAM server returns after authentication and authorization. The actions that are returned during authentication or authorization depends on policies configured in the OAM server.Each resource type defines the following set of action types: cookie, headervar and redirecturl for http resources.
- Parameters:
actionType
- type of action to be retrieved. If this is left NULL, the default is headervar.- Returns:
- Number of actions of the specified type that are associated with the specified user session.
-
getActionTypes
Returns string array of all the action types returned by the OAM server as part of authentication or authorization. The actions are the responses that OAM server returns after authentication and authorization. The actions that are returned during authentication or authorization depends on policies configured in the OAM server.Each resource type defines the following set of action types: cookie, headervar and redirecturl for http resources.
- Returns:
- String array of all the action types returned by the OAM server as part of authentication or authorization.
-
clearActions
public void clearActions()Clears all information pertaining to actions that was retrieved as part of previous authentication or authorization operation. The actions are the responses that OAM server returns after authentication and authorization. The actions that are returned during authentication or authorization depends on policies configured in the OAM server. -
getStatus
Provides integer value representing the current status of the session. The return value of this function can be checked against below constants exposed by this class.- 0 for AWAITINGLOGIN
- 1 for LOGGEDIN
- 2 for LOGGEDOUT
- 3 for LOGINFAILED
- 4 for EXPIRED
- Returns:
- Status information of this user session
- Throws:
AccessException
- If error occurs during operation
-
getError
public int getError()Returns error number determined by the most recent authentication or authorization.Error
- Returns:
- Error number for error condition
-
getCustomError
Returns plugin error code sent by the custom pluginError
- Returns:
- plugin error code
-
getErrorMessage
Returns detailed error message pertaining to authentication or authorization failure. The text of this message is derived by the AccessClient and is not intended to be changed by the user.- Returns:
- Error message describing error condition
-
isAuthorized
To check whether the user is authorized to access the resource- Parameters:
res
- object representing a requested resource whose authorization is to be checked.parameters
- Hashtable of name-value pairs of String type required by These parameters are required if the authorization policy requires additional information to perform authorization. The parameters that are required for authorization can be obtained by using getAuthorizationParameters method ofResourceRequest
- Returns:
- Boolean true if the user is authorized to request an operation for a particular resource else returns false
- Throws:
AccessException
- In case a failure occurs during the operation
-
isAuthorized
To check whether the user is authorized to access the resource- Parameters:
res
- object representing a requested resource whose authorization is to be checked.- Returns:
- Boolean true if the user is authorized to request an operation for a particular resource else returns false
- Throws:
AccessException
- In case a failure occurs during the operation
-
setLocation
Sets the IP address of the client as provided by the application.- Parameters:
sLocation
- IP address of the client- Throws:
AccessException
- In case if it fails to validate Ip address
-