Integrate Oracle APEX with OCI Identity and Access Management
Configure APEX with OCI Identity and Access Management. Here are simple steps.First I will create a demo application i.e. Sales App in APEX and then will configure the IAM to integrated with APEX.
I am dividing this in two parts.
Part 1: Create application in APEX
Part 2: Integrate Oracle APEX with OCI IAM.
Part 1: Create application in APEX
1) Login to your APEX Application
2) Click on App Builder -> Click on create button.
Part 2: Integrate Oracle APEX with OCI IAM.
Once you install/create application in APEX. Now it's time to configure OCI IAM.
1) Navigate to "Identity & Security" -> Under Identity click on "Domains"
Click on "Default" domain.
3) Click on "Integrated Applications" and then -> "Add Application" button.
4) Select "Confidential Application" and click "Launch workflow" button.
5) Provide appropriate application name. Here in my example it is "ApexSalesApp".
Do not modify any other values and click "Next"
6) Skip the server configuration. For Client configuration click on "Configure this application as a client now" radio button.
Select the "Authorization code" check box and click "Next".
7) Provide Redirect URL and Post-logout redirect URL.
Here is the syntax of the URLs.
Redirect URL: https://<myadb>.eu-frankfurt-1.oraclecloudapps.com/ords/apex_authentication.callback
Post-logout redirect URL (optional): https://<myadb>.adb.eu-frankfurt-1.oraclecloudapps.com/ords/home
In my case Redirect URL is
https://geb397a43cf343c-cbtapexprod.adb.ap-mumbai- 1.oraclecloudapps.com/ords/apex_authentication.callback
Post-logout redirect URL is https://geb397a43cf343c-cbtapexprod.adb.ap-mumbai- 1.oraclecloudapps.com/ords/r/cbtapex/salesapp/home
Click on "Finish" button below the screen.
Name - OCI IAM Sales App Credentials
Static ID - OCI_IAM_Sales_App_Credentials
Authentication Type - Basic Authentication
Client ID or Username- This is the same we collected in previous step of OCI IAM of Client ID.
Client Secret or Password - This is the same we collected in previous step of OCI IAM of Client Secret.
Verify Client Secret or Password - This is the same we collected in previous step of OCI IAM of Client Secret.
Click Create button to create the credentials.
You can see the credentials are created.
17) Now go back to the OCI IAM - > ApexSalesApp details page.
Click on the Users -> Add Users -> select the available Users from the list to whom you want to grant access to the APEX application. Clicl Assign button.
Name - OCI IAM SalesApp Auth Scheme
Scheme Type - Social Sign-In
Credential Store - OCI IAM Sales App Credentials -> This we created previously in create cedential steps. Choose it from the drop down menu.
Authentication Provider - OpenID Connect Provider
Discovery URL - https://idcs-a947aa0b126a47fd84b34cc647be6e03.identity.oraclecloud.com:443/.well-known/openid-configuration/
Scope - profile,email,groups
Username - #sub#
Additional User Attributes - groups
Click on "Create Authentication Scheme" button.
Here discovery URL is nothing but your domain URL just append /.well-known/openid-configuration/ at the end of your domain URL.
Where do you find the domain URL?
Go to the Domain - Overview section and you will find the domain URL as shown in below screenshot.
The Post-Logout URL is in the form https://<host_name>/ords/r/<alias_schema_name>/<app_name>/home and it is the IDCS (now IAM) URL redirect after logging out (it is optional, however recommended).
In my case https://geb397a43cf343c-cbtapexprod.adb.ap-mumbai- 1.oraclecloudapps.com/ords/r/cbtapex/salesapp/home is my logout URL which redirect to home page of my application.
Click on "Apply Changes" button.
Make this Scheme as current scheme by clicking "Make Current Scheme" button.
Click OK.
Now you can see, "OCI IAM SalesApp Auth Scheme" is the current scheme for this application.
24) Now, go back to the Shared Component -> Under Security -> Click on "Security Attributes"
Under Authentication,
Authentication Scheme - OCI IAM SalesApp Auth Scheme
Under Authorization
Authorization Scheme - No application authorization required -
Source for Role or Group Schemes - Custom Code
Click "Apply Changes" button
Now Final steps to Run the application and Test if it is working or not.
Click Run Application button.
The Integrated Application access page shows up: on this page click Allow