我有一个功能来验证我的用户,这是因为我测试过它。
认证功能:
create or replace function authenticate(p_username in VARCHAR2, p_password in VARCHAR2)
return BOOLEAN
is
l_password varchar2(4000);
l_stored_password varchar2(4000);
l_count number;
begin
select count(*) into l_count from users where username = p_username;
if l_count > 0 then
-- First, we fetch the stored hashed password
select password into l_stored_password
from users where upper(username) = upper(p_username);
-- we have to apply the custom hash function to the password
l_password := custom_hash(p_username, p_password);
-- Finally, we compare them to see if they are the same and return
-- either TRUE or FALSE
if l_password = l_stored_password then
return true;
else
return false;
end if;
else
-- The username provided is not in the users table
return false;
end if;
end;
然而我在 Apex 中的身份验证不起作用,我激活了身份验证方案并链接到身份验证功能。我正在使用顶点 4.2