This tutorial shows you how to add security to your application using Oracle Application Express.
Approximately 40 minutes.
Oracle Application Express (Oracle APEX) is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle Application Express is available with the Oracle Database, whether it's on-premises or in the Oracle Cloud.
In this tutorial, you use Oracle Application Express Release 5.0 to create and run a database application.
Please keep in mind the following while running this tutorial:
Before starting this tutorial, you should have:
deinstall_database_obj.sql
to reset the application environment.Project_Tasks_Appln_2.exe
in your working directory to import the application. Make sure you install the supporting objects.From the Oracle Application Express home page, click the down arrow next to the Administration icon, and selectManage Users and Groups.
Description of this imageClick Create User >.
Description of this imageEnter Brad.Knight for Username and [email protected] for Email Address, and scroll down further.
Description of this image Ensure the following values are provided, and click Create and Create Another.
User is a workspace administrator | No |
User is a developer | No |
Password | Any password of your choice. In this case, enterqweQWE123! |
Confirm Password | qweQWE123! |
Require Change of Password on First Use | No |
Description of this image
Enter Susie.Parker for Username and [email protected] for Email Address, and scroll down further.
Description of this imageEnsure the following values are provided, and click Create and Create Another.
User is a workspace administrator |
No |
User is a developer |
No |
Password |
Any password of your choice. In this case, enterqweQWE123! |
Confirm Password |
qweQWE123! |
Require Change of Password on First Use |
No |
Enter John.Bell for Username and [email protected] for Email Address, and scroll down further.
Description of this imageEnsure the following values are provided, and click Create User.
User is a workspace administrator |
No |
User is a developer |
No |
Password |
Any password of your choice. In this case, enterqweQWE123! |
Confirm Password |
qweQWE123! |
Require Change of Password on First Use |
No |
The three new users are created. In the next section, you will set up access control to the application. ClickApplication Builder.
Description of this imageNow that you have users defined, you can restrict access to certain portions of the application. In this topic, you allow only certain users to edit tasks. To do this, perform the following steps:
To secure the application so that only privileged users can perform certain operations, you create an Access Control Page that is used to define which users can access which part of the application. Perform the following steps:
Click Project Tasks Application.
Description of this imageClick Create Page >.
Description of this imageClick Access Control.
Description of this imageEnter 7 for Administration Page Number, and click Next >.
Description of this imageEnsure Do not associate this page with a navigation menu entry is selected for Navigation Preference, and clickNext >.
Description of this image Click Create.
Note: Oracle Application Express creates two internal tables called APEX_ACCESS_SETUP
andAPEX_ACCESS_CONTROL
along with the Access Control Administration page.
The Access Control Administration page is created. Click Save and Run Page.
Description of this imageIf the Log In screen appears, enter your Oracle Application Express credentials, and click Log In.
Description of this image The Access Control Administration page opens. Notice that the page is divided into two regions called Application Administration and Access Control List. The default setting for the Application Mode is "Full Access to all, access control list is not used". In this tutorial, you want to restrict certain users from accessing certain features of this application.
Select Restricted access. Only users defined in the access control list are allowed for Application Mode, and click Set Application Mode.
The Application mode is set. In the next topic, you identify your privileged users. Click Add User in the Access Control List region.
Description of this imageIn one of the previous sections, you created 3 users: Brad.Knight, John.Bell and Susie.Parker. In this topic, you identify your application's privileged users as follows:
Enter john.bell for Username, select View for Privilege, and click Add User.
Description of this imageEnter brad.knight for Username, select Edit for Privilege, and click Add User.
Description of this imageEnter susie.parker for Username, select Administrator for Privilege, and click Apply Changes.
Description of this imageNext, you can define which areas of the application are restricted. Click the Application<n> in the developer tool bar.
Description of this imageYou want to create an authorization scheme, such that:
Click Edit Application Properties.
Description of this imageClick the Security tab.
Description of this imageSelect access control - view for Authorization Scheme, and click Apply Changes.
Description of this imageNow that you have given access to the application for view privileged users, you can restrict edit privileged users to the Employee Information. Click 2 - Projects.
Description of this imageUnder Rendering, click the small triangle icon beside Columns.
Description of this imageClick PROJECT_ID.
Description of this imageIn the property editor, under Security, select access control - edit for Authorization Scheme, and click Save.
Description of this imageYou also want the Create Button to appear only if the user has Edit or Administrator privileges. In the Rendering tab, under Region Buttons, click CREATE.
Description of this imageIn the property editor, under Security, select access control - edit for Authorization Scheme, and click Save.
Description of this imageEven though you restricted the view privileged users from editing the Projects page, they can still access page 3 (Projects Master Detail page) by entering the correct URL in the browser's address bar. To prevent direct access to page 3, enter 3 in the Page Search field, and click Go.
Description of this imageMake sure Page 3 is selected in the Rendering tab. In the property editor, under Security, select access control - edit for Authorization Scheme, and click Save and Run Page.
Description of this imageSince, previously, you logged in as a user who is not defined in the access control list, you see an error message as shown below. Click Application<n> in the developer toolbar.
Description of this imageSince only users with the administrator privileges are allowed to make changes to the access control list, you need to set an authorization scheme for this page. Click 3 - Access Control Administration.
Description of this imageIn the property editor, under Security, select access control - administrator for Authorization Scheme, and clickSave.
Description of this imageEnter 101 in the page search field, and click Go.
Description of this imageClick Save and Run Page.
Description of this imageEnter brad.knight for Username, qweQWE123! for Password, and click Log In.
Description of this imageClick Manage Projects and Tasks in the Navigation Menu.
Description of this imageNotice that the Create button is visible on the Projects page because brad.knight is defined as an edit privileged user. Click the edit icon beside Email Integration.
Description of this imageNotice that brad.knight can edit the Projects. Click Log out.
Description of this imageEnter john.bell for Username, qweQWE123! for Password, and click Log In.
Description of this imageClick Manage Projects and Tasks in the Navigation Menu.
Description of this imageNotice that the Create button is not visible and edit icon is not displayed beside any project in this page because john.bell is defined as a view privileged user.
Description of this image Now, let us try accessing Page 3 (Projects Master Detail page) by changing the page number in the URL as explained below:
Example url …/f?p=2018:2:2101953412249296357::NO
Change to …/f?p=2018:3:2101953412249296357::NO
Press the Enter key and notice that you receive a message denying you access to the page because you restricted Page 3 to edit privileged users only. Click the Application <n> link in the Developer tool bar.
Click 101 - Login Page.
Description of this imageClick Save and Run Page.
Description of this imageEnter susie.parker for Username, qweQWE123! for Password, and click Log In.
Description of this imageClick Manage Projects and Tasks in the Navigation Menu.
Description of this imageNotice that the Create button is visible on the Projects page because susie.parker is defined as an administrator. Click the edit icon beside Email Integration.
Description of this imageNotice that susie.parker can edit the Projects.
Description of this image Change the page number in the URL to open the Access Control Administration page as explained below:
Example url …/f?p=2018:3:2101953412249296357::NO
Change to …/f?p=2018:7:2101953412249296357::NO
Press the Enter key and notice that you can access this page because susie.parker is created with administrator privileges. Click Log Out.
In this tutorial, you have learned how to: