function custom_authentication (p_username in varchar2, 
                                p_password in varchar2) return boolean
is
    v_userName     varchar2(20) := upper(p_username);
    v_valuesToHash apex_t_varchar2 := 
                               apex_t_varchar2(v_username, p_password);
    v_userCount    int;
begin
    select count(*) into v_userCount
    from USERS
    where UserName = v_userName 
    and   Password = apex_util.get_hash(v_valuesToHash, null);

    return v_userCount = 1;
end;

