thorsten-wolf-neptune commented on issue #877: URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/877#issuecomment-864101567
Hi guys, we are having the same requirement and face this issue as well on our side. The cookie handling seems to be different since iOS Version 14.5 and since the usage of WKWebView. In iOS < 14.5 and Apps still running the deprecated UIWebView this still works. ### Our Environment Cordova iOS 6.2.0 iOS 14.6 cordova-plugin-inappbrowser v 5.0.0 Usage of WkWebView ### Our Flow We have a button in our main cordova app (running WKWebView) which opens the cordova-plugin-inappbrowser. There we trigger an Azure AD Login (login.microsoftonline.com) which in the end returns important Login Cookies for further SAML Authentication flow in our main App. We then automatically close the inappbrowser window. After that we subsequently trigger Ajax calls against *.microsoftonline.com in our main App but those will approx. 90% of the time fail since the cookies from the inappbrowser are not being sent with the ajax calls. However, the very strange thing is that there are cases where this works: - If we put a timeout of 10 seconds after the inappbrowser is closed the cookies seem to be correctly synced between inappbrowser and main WKWebView and the authentication works. - If the user clicks the button to login again after the first failure the inappbrowser seems to have still all cookies in place (no requirement to put in the password again in the inappbrowser page). If he continues the flow then and the inappbrowser is closed THEN the cookies seem to be transfered back to the main WKWebView and the next Ajax calls will have the required Cookies in the main app. This looks to me like a timing or async issue. I have no knowledge about native iOS Development, but could it be that the Cookie stores and their synchronization are handled somehow asynchronously by iOS now and we need a callback/promise approach here? We have tried many things to get around this issue but none of them resolved this behavior.: - In iOS Settings --> Safari --> Advanced --> Experimental Features. We enabled "Disable Full 3rd-Party Cookie Blocking" "Disable Removal of Non-Cookie Da..." - We have tried https://github.com/ikosta/cordova-plugin-cookies - We have tried https://github.com/nim901/cordova-cookie-emperor - We have tried https://github.com/zalaris/cordova-plugin-wkwebview-inject-cookie - We have tried building with XCode 11.7 as mentioned here: https://github.com/CWBudde/cordova-plugin-wkwebview-inject-cookie/issues/11#issuecomment-707729811 - We have tried adding NSCrossWebsiteTrackingUsageDescription in config.xml as mentioned here https://github.com/CWBudde/cordova-plugin-wkwebview-inject-cookie/issues/11#issuecomment-708606549 - We have tried iOS 15 Beta Any help here is very much appreciated :-) -- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
