Hello APEX Community,
I'm working on creating an RSVP site for an upcoming event, but I want to limit the number of "random" users that try to sign in by implementing some sort of password system.
I am running this on apex.oracle.com...
What I have currently set up is the following:
I have a table (user_auth) that stores a list of passwords. I will send individual people one password that they will type in on the login page.
The issue I have right now is how to implement the authentication scheme...
Based on the authentication drop down options, I should be choosing "Custom"... But I am stuck at this point...
I have created a function called "my_authentication" (code provided below) and entered "my_authentication" as the Authentication Function Name, but when I test it, it keeps failing. I left the Login page as is, I don't enter a user name but I enter a valid password from the user_auth table. When I hit Login, it just boots me back to the login page. Do I need anything for Sentry Function?
create or replace function my_authentication (
p_username in varchar2 default null,
p_password in varchar2)
return boolean
is
l_count number;
l_return_value boolean;
begin
select count(*) into l_count from user_auth t where t.user_password = upper(p_password);
if (l_count > 0) then
l_return_value := true;
else
l_return_value := false;
end if;
return l_return_value;
exception
when no_data_found then
return false;
end my_authentication;
Please let me know if you want me to elaborate further...
Thanks and regards,
Ivan