This chapter describes the functions, procedures, and data types in the owa_sec
package in the PL/SQL Web Toolkit.
Note:
Use the procedures and functions in theowa_sec
package for custom authentication.Parameters that have default values are optional.
owa_sec.get_client_hostname function - returns the client's hostname.
owa_sec.get_client_ip function - returns the client's IP address.
owa_sec.get_password function - returns the password that the user entered.
owa_sec.get_user_id function - returns the username that the user entered.
owa_sec.set_authorization procedure - enables the PL/SQL application to use custom authentication.
owa_sec.set_protection_realm procedure - defines the realm that the page is in.
This function returns the hostname of the client.
Table 7-1 defines the properties of the owa_sec.get_client_hostname function.
This function returns the IP address of the client.
Table 7-2 defines the properties of the owa_sec.get_client_ip function.
Table 7-2 owa_sec.get_client_ip function
Properties | Definitions |
---|---|
Syntax: |
owa_sec.get_client_ip return owa_util.ip_address; |
Parameters: |
None. |
Returns: |
The IP address. The owa_util.ip_address data type is a PL/SQL table where the first four elements contain the four numbers of the IP address. For example, if the IP address is ipaddr(1) = 123 ipaddr(2) = 45 ipaddr(3) = 67 ipaddr(4) = 89 |
This function returns the password that the user used to log in. For security reasons, this function returns a true value only when custom authentication is used. If you call this function when you are not using custom authentication, the function returns an undefined value. Thus, the database passwords are not exposed.
Table 7-3 defines the properties of the owa_sec.get_password function.
This function returns the username that the user used to log in.
Table 7-4 defines the properties of the owa_sec.get_user_id function.
This procedure, called in the initialization portion of the owa_custom
package, sets the authorization scheme for the PL/SQL Gateway. This implements your authorize
function, which authorizes the user before his requested procedure is run. The placement of the authorize
function depends on the scheme you selected.
Table 7-5 defines the properties of the owa_sec.set_authorization procedure.
Table 7-5 owa_sec.set_authorization procedure
Properties | Definitions |
---|---|
Syntax: |
owa_sec.set_authorization(scheme in integer); |
Parameters: |
scheme - the authorization scheme. It is one of the following schemes for set_authorization: OWA_SEC.NO_CHECK - Specifies that the PL/SQL application is not to do any custom authentication. This is the default. OWA_SEC.GLOBAL - Defines an authorize function that is called for all users and all procedures. The function is owa_custom.authorize function in the "sys" schema. OWA_SEC.PER_PACKAGE - Define an OWA_SEC.CUSTOM - Implements different authorize functions for each user. The function owa_custom.authorize in the user's schema is called to authorize the user. If the user's schema does not contain an owa_custom.authorize function, the PL/SQL Gateway looks for it in the "sys" schema. The custom function authorize return boolean; If the function returns TRUE, authentication succeeded. If it returns FALSE, authentication failed. If the |
Returns: |
Not applicable |
This procedure sets the realm of the page that is returned to the user. The user enters a username and login that already exist in the realm.
Table 7-6 defines the properties of the owa_sec.set_protection_realm procedure.