Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Redirect the users to different pages based on users role once they login

orton607Feb 14 2013 — edited Feb 14 2013
Hello,

Can anyone please help with this problem. I am using Oracle Application express authentication and redirecting the users to different page based on their roles; once they login. This is working fine. The problem I have is even if the user is not a valid user; he is able to login to application with no data found message. Below is the login process which I am using. For no data found, I added an exception.

If the user is not a valid user then it should display a message Invalid Login credentials. The process which I have is over riding this step. Please help. Any help is appreciated.

--my login process on pg 101
DECLARE
   v_role   VARCHAR2 (30);
   v_page   NUMBER;
BEGIN
   SELECT user_role
     INTO v_role
     FROM users
    WHERE USER_ID = UPPER (TRIM (:P101_USERNAME));
 
   IF v_role = 'ADMIN'
   THEN
      v_page := 1;
   ELSIF v_role = 'USER'
   THEN
      v_page := 32;
   ELSE
      v_page := 200;
   END IF;
 
   APEX_UTIL.
    set_session_state (p_name => 'FSP_AFTER_LOGIN_URL', p_value => NULL);
   wwv_flow_custom_auth_std.login (P_UNAME        => :P101_USERNAME,
                                   P_PASSWORD     => :P101_PASSWORD,
                                   P_SESSION_ID   => v ('APP_SESSION'),
                                   P_FLOW_PAGE    => :APP_ID || ':' || v_page);
EXCEPTION WHEN NO_DATA_FOUND THEN
v_role := NULL;
END;
Thanks,
Orton
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2013
Added on Feb 14 2013
5 comments
3,766 views