Custom Authentication Function :
CREATE OR REPLACE FUNCTION CUSTOM_AUTH (p_username IN VARCHAR2,
p_password IN VARCHAR2)
RETURN BOOLEAN
IS
l_password VARCHAR2 (4000);
l_stored_password VARCHAR2 (4000);
l_expires_on DATE;
l_count NUMBER;
BEGIN
SELECT COUNT (*)
INTO l_count
FROM USER_INFORMATION
WHERE UPPER (LOGIN_NAME) = UPPER (p_username);
IF l_count != 0
THEN
SELECT pwd
INTO l_stored_password
FROM USER_INFORMATION
WHERE UPPER (LOGIN_NAME) = UPPER (p_username);
l_password := f_Password (UPPER (p_username), p_password);
IF l_password = l_stored_password
THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END IF;
END;
Subscribe to:
Post Comments (Atom)
Image File store outside of Oracle Database and show image into Apex Application
Directory Create : grant execute on utl_file to HRMS; CREATE OR REPLACE DIRECTORY STOCK_DIRECTORY AS 'C:\Program Files (x86)\Apache Sof...
-
1.@apexins.sql sysaux sysaux temp /i/ 2. @apxchpwd.sql 3. @apex_rest_config.sql 4. Unlock All Locked User : select username,account_s...
-
Directory Create : grant execute on utl_file to HRMS; CREATE OR REPLACE DIRECTORY STOCK_DIRECTORY AS 'C:\Program Files (x86)\Apache Sof...
-
Insert Data Into Apex Collection : begin if not apex_collection.collection_exists('EMPLOYEE_COLLECTION') then apex_collection.create...
This comment has been removed by the author.
ReplyDeleteHi Sir...
ReplyDeleteFirst thanks for the code and the idea of create custom authentication.
I think you forgot to mention f_Password function. can you please proved its code and explain the purpose of it.
Thanks Brother .Actually f_password Function are used to encrypt User Password.
ReplyDeleteThe Function Code is bellow:
CREATE OR REPLACE function f_Password(p_password in varchar2)
return varchar2
is
begin
return dbms_obfuscation_toolkit.md5
(input =>
utl_raw.cast_to_raw(upper(p_password)
);
end f_Password;