Skip to main content

Multiple Authentication in the same APEX Application

Objective:

Recently client asked me to implement multiple authentication schemes in the same APEX Application. We are using SSO and as an alternative authentications like (LDAP, APEX, CUSTOM). The problem is, you can only define one authentication scheme being "CURRENT" for an application. So how can we solve this issue?

Solution:

We need to create two URL to access the same application. One URL will redirect to SSO integrated application (Only AD users and people who are accessing office Network can able to access), another one URL is public (Can access the system anywhere).  

http://xxx.yyy.home:####/ords/f?p=spm:home - Can't access the system from outside office

http://xxx.yyy.home:####/spm/f?p=spm:home - Public

Note: Both the URLs are pointing to the same application (SPM).

Working Modal:


Fig 1: Flow Diagram

Step 1: Create customized login pages (as you like).


Fig 2: Home Login


Fig 3: Login

Step 2: Go to User Interface Details and paste Valid Login URL.


Fig 4: User Interface Attributes
Step 3: Login Buttons
     
To call the different authentication schemes on our login page we need different buttons.


Fig 5: Login Buttons

Step 4: Authentication Scheme

We need to create the different authentication schemes. The SSO authentication is to authenticate directly by passing HTTP Header Variable, next we have APEX (Application Express Authentication which is there by default), CUSTOM (Authenticate with username, password which is there in db table) and LDAP (Authenticate with windows credentials)



Fig 6: Authentication Schemes

Fig 7: APEX Account

Fig 8: Custom

Fig 9: SSO - Single Sign On

Fig 10:  LDAP - Active Directory



Step 5: Authentication Call

The "I am in OFFICE" [LOGIN SSO] button will redirect to http://xxx.yyy.home:####/ords/f?p=spm:home (It will do SSO authentication as that is the default authentication). (Check - Current authentication in Shared Components => Authentication Schemes).

The "Connect with WINDOWS Credentials" [LOGIN LDAP] button has a request defined in the link: APEX_AUTHENTICATION = LDAP, this is the way that APEX let you switch authentication schemes on the fly.


Fig 11:  APEX Authentication Request


The "Connect as EXTERNAL USER" [LOGIN CUSTOM] button has a request defined in the link: APEX_AUTHENTICATION = CUSTOM.

The "Connect with APEX Account" [LOGIN APEX] button has a request defined in the link: APEX_AUTHENTICATION = APEX. 

Fig 12:  URL


Note: The name after the equal sign needs to be the same as your authentication scheme)

Step 6: Switch in session & Session Sharing

The non-current scheme must have the following property, switch in session = Enabled.

Fig 13:  Switch in Session

Fig 14:  Session Sharing

Step 7: Sign Out

When the application not authenticated through SSO, sign out is required not otherwise.

Fig 15:  APP SIGNOUT


Fig 16:  Sign Out URL

Fig 17:  Sign Out Condition

Step 8: Click Application Alais to make user friendly APEX URL.

Comments

Post a Comment

Popular posts from this blog

Printing Page Numbers in RTF Template [Oracle BI Publisher]

Here I am giving an example to print the page numbers dynamically in the RTF (Rich Text Format) template. Step 1:  Go to page footer and copy and paste the below script. Page |  <?fo:page-number?>  of  <?fo:page-number-citation:xdofo:lastpage-joinseq?> <fo:page-number> :   This is the object, which is used to represent the current page-number. <?fo:page-number-citation:xdofo:lastpage-joinseq?> :  This is the syntax, which is used to represent the total number of pages. Step 2:  Load the XML and preview the result. Output: That's it. References: fo:page-number Printing Page Number Code in Oracle XMLP RTF Template

Generating the report with APEX_DATA_EXPORT

With the APEX_DATA_EXPORT package, you are able to export data from Oracle Application Express in the following file types: PDF, XLSX, HTML, CSV, XML, and JSON. Step 1: Create a table and populate it with some sample records. CREATE TABLE emp   (     empno        NUMBER,     first_name   VARCHAR2(240),     last_name    VARCHAR2(240),     mgr          NUMBER,     deptno       NUMBER,     sal          NUMBER,     created_date TIMESTAMP (6),     comm         NUMBER,     hiredate     DATE,     JOB          VARCHAR2(240),     ename        VARCHAR2(240),     PRIMARY KEY (empno) USING INDEX ENABLE   ); /    INSERT INTO emp (empno, first_name, last_name, mgr,                   deptno, sal, created_date)         VALUES                 (1, 'Larry', 'Ellison', ,                  10, 5000, LOCALTIMESTAMP);   INSERT INTO emp (empno, first_name, last_name, mgr,                   deptno, sal, created_date)         VALUES                 (2, 'Juan', 'Juan', 1,  

Save Selected Interactive Grid Records into a Collection - Oracle APEX

Here I am giving an example to save selected interactive grid records into a oracle apex collection. Step 1: Create a new blank page. Note: Mine was page 20. You will need to update reference to " P20 " with your page number if it's different. Step 2: Create a new interactive grid report region to the page using below query. Set Static Id "EmpDetails" to the region. SELECT  *     FROM   ( SELECT  emp . empno ,                emp . ename ,                emp . JOB ,                dept . dname department ,                dept . loc  LOCATION ,                mgr . ename  manager ,                emp . hiredate ,                 nvl ( emp . sal , 0 )  salary ,                 nvl ( emp . comm , 0 )  commission            FROM  eba_demo_chart_emp emp ,                eba_demo_chart_dept dept ,                eba_demo_chart_emp mgr           WHERE  emp . deptno = dept . deptno             AND  emp . mgr      = mgr . empno  ( + )           ORDER   BY  emp . ename