index

Package body mip_security



Program units
get_user_status  
login   Logs the user into the system and registers with APEX.
get_hash   Produce a 'password hash' from the given username and password
authenticate_user   Authenticates the given username and password
valid_user2   Authenticates the given p_username and p_password
valid_user   Authenticates the given username and password
authorization   Checks for authorization to access the given component
page_authorization   Checks for authorization to access the given page
component_authorization   Checks for authorization to access the given component
region_authorization   Checks for authorization to access the given page
user_screen  
admin_screen  
new_password  
redirect_on_expired_account  


get_user_status

FUNCTION get_user_status(p_username IN VARCHAR2) RETURN VARCHAR2


login

PROCEDURE login(p_uname      IN VARCHAR2
               ,p_password   IN VARCHAR2
               ,p_session_id IN VARCHAR2
               ,p_flow_page  IN VARCHAR2)

Logs the user into the system and registers with APEX.
 
if the user account is 'OPEN', log them in and flow to the requested page if the user account is 'EXPIRED', log them in and flow to the 'Change Password'  page if the user account is 'LOCKED', log the user out and flow to the 'Locked' page


get_hash

FUNCTION get_hash(p_username IN VARCHAR2
                 ,p_password IN VARCHAR2) RETURN VARCHAR2

Produce a 'password hash' from the given username and password
 
Uses the dbms_obfuscation_toolkit to produce the hash.


authenticate_user

FUNCTION authenticate_user(p_username IN VARCHAR2
                          ,p_password IN VARCHAR2) RETURN BOOLEAN

Authenticates the given username and password

Returns
TRUE for authenticated username and password combination

Replaces
valid_user, valid_user2


valid_user2

PROCEDURE valid_user2(p_username IN VARCHAR2
                     ,p_password IN VARCHAR2)

Authenticates the given p_username and p_password
 
Checks the passwords table for a hash value matching that produced from the given p_username and p_password.

Raises
-20000   when unable to authenticate

Obsolete
Replaced by authenticate_user


valid_user

FUNCTION valid_user(p_username IN VARCHAR2
                   ,p_password IN VARCHAR2) RETURN BOOLEAN

Authenticates the given username and password

Obsolete
Replaced by authenticate_user


authorization

FUNCTION authorization(p_app_user       IN VARCHAR2
                      ,p_component_name IN apex_authorization.component_name%TYPE
                      ,p_component_type IN apex_authorization.component_type%TYPE
                      ,p_privilege      IN apex_authorization.privilege%TYPE DEFAULT 'A')
  RETURN BOOLEAN

Checks for authorization to access the given component
 
 
Checks the roles assigned to the given p_app_user to see whether they are authorized to access the given component.
 
If configuration item APEX_AUTHORIZATION_DEFAULT_MODE = PUBLIC, all components are considered to be accessible to all unless specifically listed in the apex_authorization table. Otherwise, the requested access must be listed in the apex_authorization table.

Parameters
p_app_user   username
p_component_name   name of the component to be accessed
p_component_type   the type of component to be accessed
p_privilege   the access privilege being sought

Returns
TRUE if the given p_app_user is authorized


page_authorization

FUNCTION page_authorization(p_app_user  IN VARCHAR2
                           ,p_page_id   IN NUMBER
                           ,p_privilege IN apex_authorization.privilege%TYPE DEFAULT 'A')
  RETURN BOOLEAN

Checks for authorization to access the given page
 
Calls the authorization function to perform the check

Parameters
p_app_user   username
p_page_id   page number to be accessed
p_privilege   the access privilege being sought

Returns
TRUE if the given p_app_user is authorized


component_authorization

FUNCTION component_authorization(p_app_user       IN VARCHAR2
                                ,p_component_name IN apex_authorization.component_name%TYPE
                                ,p_privilege      IN apex_authorization.privilege%TYPE DEFAULT 'A')
  RETURN BOOLEAN

Checks for authorization to access the given component
 
Calls the authorization function to perform the check

Parameters
p_app_user   username
p_component_name   name of the component to be accessed
p_privilege   the access privilege being sought

Returns
TRUE if the given p_app_user is authorized


region_authorization

FUNCTION region_authorization(p_app_user       IN VARCHAR2
                             ,p_component_name IN apex_authorization.component_name%TYPE
                             ,p_privilege      IN apex_authorization.privilege%TYPE DEFAULT 'A')
  RETURN BOOLEAN

Checks for authorization to access the given page
 
Calls the authorization function to perform the check

Parameters
p_app_user   username
p_component_name   name of the region to be accessed
p_privilege   the access privilege being sought

Returns
TRUE if the given p_app_user is authorized


user_screen

FUNCTION user_screen(p_username IN VARCHAR2) RETURN BOOLEAN


admin_screen

FUNCTION admin_screen(p_username IN VARCHAR2) RETURN BOOLEAN


new_password

PROCEDURE new_password(p_username IN VARCHAR2
                      ,p_password IN VARCHAR2)


redirect_on_expired_account

PROCEDURE redirect_on_expired_account(p_username IN VARCHAR2)