5 Replies Latest reply on Feb 2, 2015 10:45 AM by temm

    Change default (first) page in Apex

    temm

      Hi,

       

      I know this has been mentioned quit a bit, but after trying everything i still am stuck with this problem.

       

      My application requires authentication and after successful login I want to set the first page in Apex depending on the user.

       

      This is done with the default login process which exist on page 101

        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||':1'
            );
      
      

       

      I've changed this to

       

      if package_auth.user_is_advanced(:P101_USERNAME) then
          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||':50'
            );
          APEX_UTIL.SET_SESSION_STATE('FSP_LOGOUT_PAGE',50);
      else
          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||':1'
            );
          APEX_UTIL.SET_SESSION_STATE('FSP_LOGOUT_PAGE',1);
      end if;
      
      

       

      depending on the user it works correctly and it branches to page 50 or page 1.

       

      The problem is when i logout, logging in again will take me always to page 1. I found out that i have to change to default Home URL. So I've changed the Home URL from Application Properties->User Interfaces->User Interface Details to

      f?p=&APP_ID.:&FSP_LOGOUT_PAGE.:&SESSION.
      
      

       

      but the application item FSP_LOGOUT_PAGE resets to null, thus directing me to an invalid page. I have checked and FSP_LOGOUT_PAGE application item that i have created is set with the correct value after logging in.

       

      Any ideas?

       

       

      APEX version: 4.2.4.00.08

      DB version: 10.2.0.1 under RedHad 4 update 5 32bit

      Web server architecture: OHS running on DataBase server

      Browser(s)/version(s): Firefox latest version

      UI/Theme: Builder Blue custom changes

       

      Edited message to include platform/application version information

        • 1. Re: Change default (first) page in Apex
          Shwetha Siddamallappa-Oracle

          Hi Temm,

           

          Please check the below link which may resolve your issue

           

          Dimitri Gielis Blog (Oracle Application Express - APEX): Change default (first) page in APEX

           

          When you make your first application in APEX you typically have as default page 1 or the login page (101). If you want to change your default (first) page you need to have a look at three different places. Let's say we want to have page 9 as default page:

           

          1) Application Builder > Your Application > Page 101 > Processes (Page Processing) > Login
          Change Process to:

           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||':9'
             );

          Whenever somebody logs in we want him to go to page 9.


          2) Shared Components > Security > Authentication Schemes > Your AuthenticationChange the Logout URL: wwv_flow_custom_auth_std.logout?p_this_flow=&APP_ID.&p_next_flow_page_sess=&APP_ID.:9

          If somebody logged out, we set the default page to 9 as that's our default page.


          3) Shared Components > Security > Edit Security AttributesChange the Home Link to: f?p=&APP_ID.:9:&SESSION.

          If no page is specified this is the page to go to for ex. f?p=100 means we're going to application 100 with as default page, the page specified in the Home Link. You can also reference this url by #HOME_LINK#.


          Hope this helps!!


          (Note: If you believe it answers your question, please mark it as correct answer. This will help other community users )

           

          Thanks,
          Shwetha

          • 2. Re: Change default (first) page in Apex
            Kiran Pawar

            Hi temm,

             

                 Please provide your Oracle APEX environment details and details about Authentication Scheme.

                 This will help forum members to provide more appropriate reply.

             

            Regards,

            Kiran

            • 3. Re: Change default (first) page in Apex
              temm

              Yes, i've seen this. The problem is that i have to used an application item instead of a fixed value (e.g 9 from Dimitris Gielis blog). When using an application item and logging out the value of it resets to null.

              • 4. Re: Change default (first) page in Apex
                Kiran Pawar

                Hi temm,

                 

                temm wrote:

                 

                Yes, i've seen this. The problem is that i have to used an application item instead of a fixed value (e.g 9 from Dimitris Gielis blog). When using an application item and logging out the value of it resets to null.

                     Oracle APEX Session state cease to exist after logging out of the application.

                     Refer : http://docs.oracle.com/cd/E37097_01/doc.42/e35125/concept_ses.htm#HTMDB03007

                     Do you have per user/per user groups different landing page?

                 

                     Instead of changing the authentication related components, why don't you handle it after authentication when there is a valid session state.

                     You could create a before header branch on the home page to redirect the user to appropriate user home page.

                    

                     If there are many users and home page of each user varies, you could add a column to map home page to each user.

                     Create a before header process that does APEX_UTIL.REDIRECT_URL getting the appropriate home page from the users table.

                 

                     Hope it helps!

                 

                Regards,

                Kiran

                1 person found this helpful
                • 5. Re: Change default (first) page in Apex
                  temm

                  Hi Kiran,

                   

                  the before header process that does APEX_UTIL.REDIRECT_URL it's not so elegant but it works!

                   

                  Thanks.