Custom Authentication Function

Oracle Application Express is a rapid development tool for Web applications on the Oracle database.
Post Reply
admin
Posts: 2062
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Custom Authentication Function

Post by admin »

function js_authentication (
p_username in varchar2,
p_password in varchar2 )
return boolean
is
l_user my_users.user_name%type := upper(p_username);
l_id my_users.id%type;
l_hash my_users.password_hash%type;
begin
begin
select id , password_hash
into l_id, l_hash
from my_users
where user_name = l_user;
exception when no_data_found then
l_hash := '-invalid-';
end;

return l_hash = rawtohex(sys.dbms_crypto.hash (
sys.utl_raw.cast_to_raw (
p_password||l_id||l_user ),
sys.dbms_crypto.hash_sh512 ));
end;
Malik Sikandar Hayat
admin@erpstuff.com
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests