Drupal REST in IOS failed with 403 forbidden access but success in browser

Viewed 99

My app can interact with Drupal API in the browser but not in the simulator and device. (Currently testing in iOS).

How can I fix it? Everything is working fine in the browser but in the simulator/device, I get 403 forbidden access.

The problem that might cause it

I think the issue is with cookies? In Drupal, I have ini_set(‘session.cookie_samesite’, ‘none’); and it works. If I removed that, I get 403 forbidden access in the browser, simulator & device. If I add that, it works on the browser but not in simulator/device.

How can I fix this?

Can I use https://ionicframework.com/docs/native/http/ instead of angular http service? Does it support withCredentials?

Thanks

1 Answers

I think you should use a different authentication method if you want to access the site from different devices. By default, Drupal has "Samesite" to "Strict" I think. Setting the samesite to "None" means that other domains or devices can access the same cookies from your website.

Related