0 Replies Latest reply: Dec 5, 2013 5:15 AM by bjarkekr RSS

    FSP_AFTER_LOGIN not working

    bjarkekr

      Hi,

       

      I have the following function which will decrypt a string, login the user and then go to the specified url.

       

      Only one problem. This line apex_util.set_session_state('FSP_AFTER_LOGIN_URL', v_url); doesnt work. It goes to the start page of the app instead of v_url.

       

      Anyone can help me why this is happening?

       

      FUNCTION f_url_login(p_crypt_string IN VARCHAR2) RETURN VARCHAR2 IS

          v_decrypt     VARCHAR2(500);

          v_seconds_now NUMBER;

          v_seconds     NUMBER;

          v_dif         NUMBER;

          v_session     NUMBER;

          v_url         VARCHAR2(500);

          v_str         APEX_APPLICATION_GLOBAL.VC_ARR2;

        BEGIN

          v_decrypt := tosca.pck_crypt.tosca_web_decrypt(p_crypt_string);

          v_str := APEX_UTIL.STRING_TO_TABLE (v_decrypt);

          logger.log_error('v_str1: '||v_str(1)||'- v_str2: '||v_str(2)||'- v_str3: '||v_str(3));

         

          v_session := APEX_CUSTOM_AUTH.GET_SESSION_ID;

          apex_authentication.post_login(v_str(1),NULL);

          v_seconds_now := TO_NUMBER(TO_CHAR(SYSDATE, 'SSSSS'));

          v_seconds := to_number(v_str(2));

          v_dif := v_seconds_now - v_seconds;

          logger.log_error(to_char(v_dif));

         

          IF ((v_seconds_now - v_seconds) < 3600) THEN

            logger.log_error('seconds dif is less than 3600');

            v_url := 'f?p='||v('APP_ID')||':'||v_str(3)||':'||v_session||'';

            logger.log_error(v_url);

            apex_util.set_session_state('GLOB_URL_LOGIN', 'Y');

            apex_util.set_session_state('FSP_AFTER_LOGIN_URL', v_url);

            logger.log_error('after session state');

          END IF;

         

          RETURN NULL;

        END;