Security_csrf_violation errors when bundled with Capacitorjs #3128
-
I'm currently hosting my Kratos instance on auth.example.com and my main application on example.com. The Capacitorjs app uses the domains: How would I fix the CSRF errors? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
I am not familiar with Capacitorjs, but it looks like, it is a cross-platform framework (similar to React Native). From that, I am guessing you're using the API endpoints to initiate flows, but are still sending the requests from a browser context (for testing and development). Is that correct? And are you also using the Ory SDKs? If that's the case, you need to disable sending credentials (e.g. cookies) by setting |
Beta Was this translation helpful? Give feedback.
-
@jonas-jonas Thanks for your answer! To clarify i'm using the ORY Javascript/Typescript SDK and Capacitorjs is a cross-platform bundler, so yes similar to React Native. |
Beta Was this translation helpful? Give feedback.
-
Headers
Request
Response
|
Beta Was this translation helpful? Give feedback.
-
Using the Http Capacitor Plugin fixes the
|
Beta Was this translation helpful? Give feedback.
Using the Http Capacitor Plugin fixes the
Origin
issue when running the app in the emulator or on the phone.--dev
flag andDEV_DISABLE_API_FLOW_ENFORCEMENT
are useful for testing purposes when developing using a browser (without emulator), but never use this in production.