Stack Exchange
Adding one more parameter in Log in page of Oracle Apex
I want to add one more parameter in Login page which returns team_id but I am unable to authenticate the user. Below function is default one from Oracle Apex Authentication schemes where I added p_team as a in paramter.
function my_authentication (
p_username in varchar2,
p_password in varchar2,
p_team in varchar2
)
return boolean
is
l_user ncr_emp.qlid%type := upper(p_username);
l_pwd  ncr_emp.pass%type;
l_team ncr_emp.team_id%type;

begin
select qlid  , pass , team_id
  into l_user, l_pwd, l_team
  from ncr_emp
 where upper(qlid) = upper(l_user) and upper(pass)=upper(p_password)
 and upper(team_id) = upper(l_team);

 return true;

  exception
  when NO_DATA_FOUND then return false;
  end;

And when calling below function its showing error:
apex_authentication.login(
p_username => :P9999_USERNAME,
p_password => :P9999_PASSWORD,
 p_team => :P9999_TEAM
);

Error: 

ORA-06550: line 1, column 64: PLS-00306: wrong number or types of arguments in call to 'LOGIN'


This requires a predefined signature that cannot change. I also severely question your use of upper(pass)

This requires a predefined signature that cannot change. => Is there any solution to validate on three parameters?
I also severely question your use of upper(pass) => If you are asking this why I user upper(pass) then this is not a final code final authentication will be case sensitive.

@Scott What if I build my own API for log in, does it sound good?

User your custom authentication function here:
Shared Components / Authentication schemes / (Select your current) / settings / Authentication Function Name
And leave the normal apex code alone.
Note that your custom authentication function has to return a boolean (true or false).

If you define an Authentication Scheme of scheme type 'Custom', you will note the following in the Authentication Function Name inline help.

This function must return a boolean to the login procedure that calls
  it. It has 2 input parameters 'p_username' and 'p_password' that can
  be used to access the values an end user entered on the login page.

The apex_authentication.login definition does not match your attempt - you did not call your own function.
Does the security model really need to accept 'team'? Is this vital to establishing identity, or is something that could be nominated after login?
As for the upper(pass), while it may not be 'final code', it shows you are starting on the back foot - clear text passwords shouldn't even make it to draft, IMHO.
