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 2020/12/05 16:16:44 UTC

[GitHub] [cordova-plugin-inappbrowser] SnpDeveloper commented on issue #361: adding support for passing request headers

SnpDeveloper commented on issue #361:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/361#issuecomment-739316175


   Thanks iharyan and lihuelg. You code changes help me in Android and worked fine. I am not sure why in iOS its still not working.
   
   Here is my scenario.
   
   I have 3 urls:
   entryURL
   basic Authentication validation URL
   successURL
   
      
   1. entry url environment.samlURL - example say: site1.com/mobile/index.html (samlURL) - receives authorization header
   
   ```
   let authHeader:any={};
   authHeader['Authorization'] = 'Basic ' + btoa(params.name + ':' + params.password);
   const browser = this.iab.create(environment.samlURL, '_blank', { usewkwebview: 'yes', hidenavigationbuttons: 'yes', hideurlbar: 'no', location: 'yes', clearcache: 'yes', clearsessioncache: 'yes' }, authHeader);
   ```
   
   2. site1.com redirects with headers to samlSite for verifying authentication (idp-xxx.sss.com/samlverification...) 
   3. on successful authentication samlsite redirects back to site1.com/mobile/success.html?successToken with successToken
   
           await browser.on('loadstart').subscribe(async (event) => {
             await browser.executeScript({ code: 'location.search.substring(1)' }).then(async (queryParams: any) => {
               if (queryParams && queryParams[0] !== '') {
                 const urlParams = new URLSearchParams(queryParams[0]);
                 const sToken = urlParams.get('successToken');
                 if (uuid) {
                   resolve(sToken);
                   browser.close();
                 }
               }
             });
    
   In android all works as expected, but in iOS navigation stops in second stage. I am able to see the headers getting passed to site1.com but redirection to idp basic authentication fails.. 
   Is there anything in iOS code where redirection to different domain will stop??
   
   any pointers will be very helpful.
   


----------------------------------------------------------------
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