You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/05/24 04:01:20 UTC

[GitHub] [cordova-ios] priyankabakkar opened a new issue #1112: SSO login using InAppBrowser plugin, it doesnot persist cookies while returning to app so unable to reload ios app

priyankabakkar opened a new issue #1112:
URL: https://github.com/apache/cordova-ios/issues/1112


   # Bug Report
   
   ## Problem
   We have hybrid app developed using cordova. Our app is “SwiftEnterprise” available on apple store.
   We have functionality of SSO login which we are achieving using InAppBrowser plugin. Earlier it was working fine but from Aug 2020 it stopped working for ios.
   
   We are able to login to SSO url, using InAppBrowser plugin but after login we were redirecting to our main app. Issue is, now we are not able to reload our app as jsession cookies are missing. Application not able to load. I guess it is cookies issue, I tried setting manual cookies as well but nothing works out.
   
   ### What is expected to happen?
   After successful SSO login we redirect back to main application by closing inappbrowser. Here we expect to get jsession Id so that our session timeout will not happen and app can able to reload
   
   
   
   ### What does actually happen?
   Currently on login we are getting session timeout because of missing cookies
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   Using InAppBrowser plugin's target "_blank" to load sso url and then after successful login we redirect it to our own app
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   ```javascript
   /* This api for SSO/Netscalar login */
   MobileApp.Directlogin = function(a_event) {
   	var w_appData = JSON.parse(localStorage.getItem('appData') ? localStorage.getItem('appData') : '{}');
   	var w_url= w_appData.appUrl;
       var w_target = '_blank';
       var w_options = 'location=yes,clearsessioncache=no,clearcache=no,closebuttoncaption=Close,closebuttoncolor=red,hideurlbar=yes';
       var w_authPage = cordova.InAppBrowser.open(w_url, w_target, w_options);
   
       w_authPage.addEventListener("loadstop", function () {
           w_authPage.executeScript (
               { code: "document.body.innerText" },
               function( values ) {
   
                   if (values[0].indexOf("cobrandPath") > -1) {
                       var w_loginResponse = JSON.parse(values[0]);
   
                       if (w_loginResponse.loginStatus) {
                           w_authPage.close();
                           var w_LandingURL = 'maxema/index_mobile.html?';
   
                           for (var w_dataVal in w_loginResponse) {
                               if (w_dataVal != 'loginStatus') {
                                   w_LandingURL += w_dataVal + '=' + w_loginResponse[w_dataVal] + '&';
                               }
                           }
                           w_LandingURL = w_LandingURL.substr(0, w_LandingURL.length - 1);
                           window.location = w_LandingURL;
                       }
                   }
               }
           );
   
      });
     w_authPage.addEventListener("exit", function () {
        MobileApp.changeServer();
    })
   };
   ```
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   Our app is hybrid app and we are facing this issue on IOS platform since aug 2020
   
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   cordova version -10.0.0
   cordova Installed platforms:
     android 7.0.0
     ios 6.2.0
   InAppBrowser - cordova-plugin-inappbrowser 5.0.0 
   Xcode - Version 12.4 (12D4e)
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] jcesarmobile closed issue #1112: SSO login using InAppBrowser plugin, it doesnot persist cookies while returning to app so unable to reload ios app

Posted by GitBox <gi...@apache.org>.
jcesarmobile closed issue #1112:
URL: https://github.com/apache/cordova-ios/issues/1112


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] jcesarmobile commented on issue #1112: SSO login using InAppBrowser plugin, it doesnot persist cookies while returning to app so unable to reload ios app

Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on issue #1112:
URL: https://github.com/apache/cordova-ios/issues/1112#issuecomment-847890744


   closing as duplicate of https://github.com/apache/cordova-ios/issues/1110


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org