public abstract class BaseUserSession
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
AGID |
static int |
AWAITINGLOGIN |
static int |
ERR_AUTHN_PLUGIN_DENIED |
static int |
ERR_AUTHN_TOKEN_EXPIRED |
static int |
ERR_DENY |
static int |
ERR_IDLE_TIMEOUT |
static int |
ERR_INCONCLUSIVE |
static int |
ERR_INSUFFICIENT_LEVEL |
static int |
ERR_INVALID_CERTIFICATE |
static int |
ERR_MOD_USER_FAILED |
static int |
ERR_NEED_MORE_DATA |
static int |
ERR_NO_USER |
static int |
ERR_NOT_LOGGED_IN |
static int |
ERR_PASSWORD_CHANGE_ON_RESET |
static int |
ERR_PASSWORD_EXPIRED |
static int |
ERR_SESSION_TIMEOUT |
static int |
ERR_UNKNOWN |
static int |
ERR_USER_LOCKED_OUT |
static int |
ERR_USER_REVOKED |
static int |
ERR_WRONG_PASSWORD |
static int |
EXPIRED |
static java.lang.String |
LOGGED_OUT_SESSION_TOKEN |
static int |
LOGGEDIN |
static int |
LOGGEDOUT |
static int |
LOGINFAILED |
protected AccessClient |
m_accessClient |
protected java.util.HashMap<java.lang.String,java.util.Hashtable> |
m_actionsArray |
protected java.util.Vector<java.lang.String> |
m_actionTypes |
protected ObAuthUser |
m_authUser |
protected int |
m_error |
protected java.lang.String |
m_errString |
protected java.lang.String[] |
m_getActionTypeReturn |
protected int |
m_lastUseTime |
protected boolean |
m_lazyload |
protected int |
m_level |
protected LocalAccessClient |
m_localAccessClient |
protected java.lang.String |
m_location |
protected java.util.logging.Logger |
m_logger |
protected java.lang.String |
m_sessionId |
protected boolean |
m_sessionValid |
protected int |
m_startTime |
protected int |
m_status |
protected int |
m_tokenLongestIdleTime |
protected int |
m_tokenMaxIdleTime |
protected java.lang.String |
m_userIdentity |
static int |
OK |
protected java.lang.String |
p_error |
Modifier | Constructor and Description |
---|---|
protected |
BaseUserSession()
Default Constructor for BaseUserSesion Object
|
protected |
BaseUserSession(AccessClient aClient)
Constructor for BaseUserSesion Object which takes a reference to an
AccessClient object.
|
protected |
BaseUserSession(LocalAccessClient aClient)
Constructor for BaseUserSesion Object which takes a reference to an
LocalAccessClient object.
|
Modifier and Type | Method and Description |
---|---|
void |
clearActions()
Clears all information pertaining to actions that was retrieved as part
of previous authentication or authorization operation.
|
java.lang.String |
getAction(java.lang.String actionType,
java.lang.String name)
Returns action corresponding to the action name and type specified.
|
java.util.Hashtable |
getActions(java.lang.String actionType)
Returns hashtable containing actions in the form of name/value
pairs of String type for specified actionType.
|
java.lang.String[] |
getActionTypes()
Returns string array of all the action types returned by the OAM server
as part of authentication or authorization.
|
java.lang.String |
getCustomError()
Returns plugin error code sent by the custom plugin
Error |
int |
getError()
Returns error number determined by the most recent
authentication or authorization.
|
java.lang.String |
getErrorMessage()
Returns detailed error message pertaining to authentication or
authorization failure.
|
int |
getLevel()
Returns authentication scheme level at which user
is authenticated.
|
java.lang.String |
getLocation()
Returns the IP address of the client as specified by the application
while creating the session.
|
int |
getNumberOfActions(java.lang.String actionType)
Returns number of actions of the specified type that are returned by OAM
server as part of authentication or authorization.
|
int |
getStatus()
Provides integer value representing the current status of the session.
|
java.lang.String |
getUserIdentity()
Returns the DN of the user's profile entry in the user directory.
|
boolean |
isAuthorized(ResourceRequest res)
To check whether the user is authorized to access the resource
|
boolean |
isAuthorized(ResourceRequest res,
java.util.Hashtable parameters)
To check whether the user is authorized to access the resource
|
protected boolean |
isAuthorized(ResourceRequest res,
ValNameList pRActions,
boolean allrActions,
ObAAAStatus opStatus) |
protected void |
setActions(ObKeyValMap actions)
To set the actions.
|
void |
setLocation(java.lang.String sLocation)
Sets the IP address of the client as provided by the application.
|
protected java.lang.String |
validateIPAddress(java.lang.String ip)
Validates the IP address
|
public static final int OK
public static final int ERR_UNKNOWN
public static final int ERR_NO_USER
public static final int ERR_USER_REVOKED
public static final int ERR_WRONG_PASSWORD
public static final int ERR_INVALID_CERTIFICATE
public static final int ERR_AUTHN_PLUGIN_DENIED
public static final int ERR_INSUFFICIENT_LEVEL
public static final int ERR_NOT_LOGGED_IN
public static final int ERR_SESSION_TIMEOUT
public static final int ERR_IDLE_TIMEOUT
public static final int ERR_DENY
public static final int ERR_PASSWORD_EXPIRED
public static final int ERR_PASSWORD_CHANGE_ON_RESET
public static final int ERR_USER_LOCKED_OUT
public static final int ERR_NEED_MORE_DATA
public static final int ERR_INCONCLUSIVE
public static final int ERR_MOD_USER_FAILED
public static final int ERR_AUTHN_TOKEN_EXPIRED
public static final int AWAITINGLOGIN
public static final int LOGGEDIN
public static final int LOGGEDOUT
public static final int LOGINFAILED
public static final int EXPIRED
public static final java.lang.String LOGGED_OUT_SESSION_TOKEN
protected static final java.lang.String AGID
protected java.lang.String m_errString
protected int m_error
protected int m_status
protected java.lang.String p_error
protected java.lang.String m_location
protected java.lang.String m_sessionId
protected int m_tokenMaxIdleTime
protected int m_startTime
protected int m_tokenLongestIdleTime
protected int m_level
protected java.lang.String m_userIdentity
protected int m_lastUseTime
protected boolean m_sessionValid
protected boolean m_lazyload
protected ObAuthUser m_authUser
protected java.lang.String[] m_getActionTypeReturn
protected java.util.HashMap<java.lang.String,java.util.Hashtable> m_actionsArray
protected java.util.Vector<java.lang.String> m_actionTypes
protected java.util.logging.Logger m_logger
protected AccessClient m_accessClient
protected LocalAccessClient m_localAccessClient
protected BaseUserSession() throws AccessException
AccessException
protected BaseUserSession(AccessClient aClient) throws AccessException
AccessException
protected BaseUserSession(LocalAccessClient aClient) throws AccessException
AccessException
public int getLevel() throws AccessException
AccessException
- If error occurs during operationpublic java.lang.String getUserIdentity() throws AccessException
AccessException
- If error occurs during operationpublic java.lang.String getLocation() throws AccessException
AccessException
- If error occurs during operationpublic java.lang.String getAction(java.lang.String actionType, java.lang.String name)
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".
actionType
- type of action to be retrieved.
If this is left NULL, the default is headervar.name
- name of the action to be retrieved.public java.util.Hashtable getActions(java.lang.String actionType)
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".
actionType
- type of action to be retrieved. If this is
left NULL, the default is "headervar".public int getNumberOfActions(java.lang.String actionType)
Each resource type defines the following set of action types: cookie, headervar and redirecturl for http resources.
actionType
- type of action to be retrieved. If this is left NULL,
the default is headervar.public java.lang.String[] getActionTypes()
Each resource type defines the following set of action types: cookie, headervar and redirecturl for http resources.
public void clearActions()
public int getStatus() throws AccessException
AccessException
- If error occurs during operationpublic int getError()
Error
public java.lang.String getCustomError()
Error
public java.lang.String getErrorMessage()
protected void setActions(ObKeyValMap actions)
actions
- Contains key/val pair of actions.public boolean isAuthorized(ResourceRequest res, java.util.Hashtable parameters) throws AccessException
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 of
ResourceRequest
AccessException
- In case a failure occurs during the operationpublic boolean isAuthorized(ResourceRequest res) throws AccessException
res
- object representing a requested resource whose
authorization is to be checked.AccessException
- In case a failure occurs during the operationpublic void setLocation(java.lang.String sLocation) throws AccessException
sLocation
- IP address of the clientAccessException
- In case if it fails to validate Ip addressprotected java.lang.String validateIPAddress(java.lang.String ip) throws AccessException
ip
- java.net.UnknownHostException
AccessException
protected boolean isAuthorized(ResourceRequest res, ValNameList pRActions, boolean allrActions, ObAAAStatus opStatus) throws AccessException
AccessException