Sharing authentication cookies from browser to http api calls

We have a mobile app (android and ios) created using Ionic 5, Capacitor 1.5 and Angular 9

I am relatively new to using Javascript frameworks and need help understanding how to share cookies with different parts of our application.

If I launch an in app browser window for the user to authenticate against our CAS system - how can I make the authentication cookies from the browser window available to send with the http requests that we make to our API using the HttpClient from ‘@angular/common/http’?

I have tried setting the hostname in the capacitor.config.json file to the same domain as our CAS server and using “withCredentials” in the http api calls but it doesn’t seem to be including the authentication cookies.

I appreciate any suggestions.

2 Likes

I’m facing the same problem. Any tips or best practices?