9 Replies Latest reply: Dec 2, 2013 3:10 AM by Christian Neumueller RSS

    wwv_flow_custom_auth_std.logout not working in 4.2.3

    GarryLawton

      Hi,

      my provider recently upgraded to APEX version 4.2.3. I was using wwv_flow_custom_auth_std.logout. Now it is not working. I read in the Patch Set Notes that it is deprecated and that apex_authentication.logout should be used. However, they do not have the same functionality. wwv_flow_custom_auth_std.logout allows me to go to another application after logout, apex_authentication.logout does not.

       

      Am I missing something. At the moment I cannot think of a way I can get around this. Anyone got any ideas.

       

      Regards Garry Lawton

        • 1. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
          Christian Neumueller

          Hi Garry,

           

          can you please explain what is not working?

           

          You can configure the Post-Logout URL in the authentication scheme. It can either be the application's home page or any other URL.

           

          Regards,
          Christian

          • 2. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
            GarryLawton

            Hi Christian,

            many thanks for the reply. In my case the Post-Logout URL does not help because the URL is in a global application item. At logout, session state is cleared before the branch to the Post-Logout URL.

             

            Regards Garry

            • 3. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
              Christian Neumueller

              Hi Garry,

               

              thanks for the explanation. You are right, APEX deletes the session before branching to the Post-Logout URL. I thought that we loaded session state into PL/SQL before deleting the session, but apparently that's not the case. It makes sense to be able to use substitution variables in the Post-Logout URL, so you can define a URL like "&G_LOGOUT_URL." that is based on an application item. I could also reproduce the error in wwv_flow_custom_auth_std.logout.

               

              One way to work around this problem for now is

              - create a new page "logout"

              - add a before header process that executes

              begin
                  apex_authentication.logout (
                      p_session_id => :SESSION,
                      p_app_id     => :APP_ID );
              exception when apex_application.e_stop_apex_engine  then null;
              end;
              
              apex_debug.trace('redirecting to %s', :G_LOGOUT_URL);
              sys.owa_util.redirect_url(:G_LOGOUT_URL);
              
              apex_application.stop_apex_engine;
              

              - redirect to that page to log the user out (e.g. by placing f?p=&APP_ID.:102:&SESSION. in the "Logout" navigation bar entry)

               

              Regards,

              Christian

              • 4. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
                GarryLawton

                Hi Christian, thanks again, I will try this asap.

                 

                Regards, Garry

                • 5. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
                  GarryLawton

                  Hi Christian,

                  I tried it but it did not work. It redirects to the application's own login page.

                  The manual states that APEX_AUTHENTICATION.LOGOUT "closes the session and redirects to the application's home page". This would, in turn, redirect to the login page.

                  I moved APEX_APPLICATION.STOP_APEX_ENGINE; before APEX_AUTHENTICATION.LOGOUT and it appears to work but I don't know if it really does.

                   

                  Regards, Garry

                  • 6. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
                    Christian Neumueller

                    Hi Garry,

                     

                    if you move APEX_APPLICATION.STOP_APEX_ENGINE, it raises an exception and the session logout does not happen, so I would not do that. Instead, can you please try again with a post-logout URL of null in the authentication scheme? In my test case, I used &G_LOGOUT_URL., but since the substitution value is empty in 4.2.3, the effective value is null. Btw, I filed bug #17555033 for this issue and already fixed it in 5.0.

                     

                    Regards,

                    Christian

                    • 7. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
                      GarryLawton

                      Hi Christian,

                      again, many thanks. I did what you suggested and it works.

                       

                      Regards, Garry

                      • 8. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
                        Damir Vadas

                        Hi,

                         

                        I have problem with "wwv_flow_custom_auth_std.logout" called from a logout from menu bar entry wich is defined, as in your suggestion as:

                        &G_DEFAULT_LOGOUT_URL.

                        In runtime it value becomes like:

                        http://xxx:8080/apex/wwv_flow_custom_auth_std.logout?p_this_flow=10011001&p_next_flow_page_sess=10011001:33

                        This sent me to page 33 on logout process.

                        On page 33, in on load before header, I have code which reset many variables:

                        begin

                          XE_AUTH_PKG.reset_app_vars (2);

                          XE_GLOBAL_PKG.init_app_vars (2);

                          :P33_SESSION_TIMEOUT    := XE_GLOBAL_PKG.get_app_def_session_timeout;

                          :G_SESS_DATE_FORMAT := 'DD.MM.YYYY';

                          :G_SESS_DATE_TIME_FORMAT := 'DD.MM.YYYY HH24:MI:SS';

                          SELECT to_char(sysdate, :G_SESS_DATE_TIME_FORMAT) INTO :G_DATE_TIME FROM DUAL;

                        exception

                          when others then

                            auto_log_error_apex_web_app ('Process "Reset and init vars"- When others');

                        end;

                        It works for several years without any problem (from Apex 3.x if I remember good). Now in 4.2.3 I have Apex_listener error and could not help.

                        So mine question is:

                        Does your answer means that in Apex 5.0 this all will work again as it was in 4.2 or code modification should be done anyway? I'd like o stay on this code because it was tested in many case and works OK.

                         

                        If previous answer is that Apex 5.0 will not fix that (to be OK as before) could you please tell me a little bit more widely what to do...haven't understand from your previous post.

                         

                        THX

                        Damir

                        • 9. Re: wwv_flow_custom_auth_std.logout not working in 4.2.3
                          Christian Neumueller

                          Hi Damir,

                           

                          apex_authentication.logout is the only logout procedure that we will support in the future. We had to deprecate the others, see here:

                           

                          Oracle Application Express 4.2.3 - Patch Set Notes</title><meta name="Title" content="Oracle App…

                           

                          The wwv_flow_custom_auth_std.logout procedure first deletes the session. Then it redirects to page 33. This request creates a new session, where your before header process initializes these variables. Not sure if that is what you expect the code to do, but that's what it does in 4.x and probably also in 3.x. What Apex Listener error do you get?

                           

                          The best way to execute code after logout is the post logout procedure hook in custom authentication schemes or authentication plugins. Please explain what you intend to do on logout and we can discuss how to accomplish this. Maybe you should also start a new forum thread, since this one is already answered and people will therefore skip the ongoing discussion.

                           

                          Regards,
                          Christian