Search This Blog

Wednesday, July 19, 2017

Login Authentication on Oracle Apex 5

Hi
Today I am going to write about how to do LOGIN AUTHENTICATION   

1. Go to apex default login page then >> go to dynamic action call login >> PL/SQL Code
Now copy the name of this two parameter.
p_username
p_password


2. Now create a function using this tow parameter.
Here I do a function using EMPLOYEES TABLE
and I assume EMPLOYEE_ID AS PASSWORD AND FIRST_NAME AS USERNAME

   CREATE OR REPLACE FUNCTION LOGIN_FUNC (p_username   VARCHAR2,
                                       p_password   NUMBER)
   RETURN BOOLEAN
IS
   VAL_TEST   NUMBER;
BEGIN
   SELECT 1
     INTO VAL_TEST
     FROM EMPLOYEES 
    WHERE     UPPER (first_name) = UPPER (p_username)  -- (obviously use upper function  to make the function more ----- efferent )   
          AND employee_id = p_password;    

   RETURN TRUE;

EXCEPTION
   WHEN NO_DATA_FOUND
   THEN
   
      RETURN FALSE;
      
END; 

3. Now go to application page to >>Edit Application Properties >>Security >> (Authentication) Define Authentication Schemes >> Create >> Based on a pre-configured scheme from the gallery AND CLICK NEXT >> type a name>>Scheme Type --CUSTOM >>Authentication Function Name (HERE YOU RIGHT NAME OF YOUR FUNCTION WHAT YOU WRIGHT FOR AUTHENTICATION

THAT'S END

NOW YOUR PAGE AUTHENTICATION WILL WORK.
YOU CAN LOGIN USING ANY EMPLOYEE  FIRST_NAME AND EMPLOYEE_ID ;

THANK YOU
(Value Required) 

No comments:

Post a Comment

PDF to Text Covert by Oracle Apex

Here are the steps to convert and get the character into a region by Oracle Apex. Step1.  Create a page and Copy-Pest the below code into Pa...