adamdport commented on issue #922: URL: https://github.com/apache/cordova-ios/issues/922#issuecomment-790658776
FWIW I managed to get my Cordova app to use authentication cookies set by the response of an XHR request to my remote without needing any plugins or hacks. There are some gotchas though and wanted to try to outline them here: - Add CORS headers to your remote that allow the origin defined by your `scheme` and `hostname` in config.xml (eg. `foo://mydomain.com`), allow CORS headers, and make sure you're returning 200 for OPTIONS requests even though they won't have authentication cookies - Set `withCredentials: true` on your XHR requests - Add your remote to `WKAppBoundDomains` in your app's plist file - Opt into `limitsNavigationsToAppBoundDomains = YES` in `CDVWebViewEngine.m` The last two aren't ideal, and I've created a[ feature request for cordova-ios to handle AppBoundDomains](https://github.com/apache/cordova-ios/issues/1088) out of the box. If you're up against a deadline however, it's not too painful to add it yourself ---------------------------------------------------------------- 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]
