ancient-dentist-17854
03/17/2025, 9:06 AMbrief-egg-61061
03/17/2025, 9:06 AMbrief-egg-61061
03/17/2025, 9:06 AMhttps://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/{flow-type}/browser|PROJECT_SLUG.projects.oryapis.com/self-service/{flow-type}/browser>
- Native apps use: https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/{flow-type}/api|PROJECT_SLUG.projects.oryapis.com/self-service/{flow-type}/api>
[Browser vs. native apps](https://www.ory.sh/docs/identities/native-browser) documentation explains that these different endpoints implement different security measures. Browser flows use anti-CSRF cookies and issue session cookies, while native flows don't use CSRF protection and issue session tokens instead. In your server logs or when implementing webhooks, you can identify the flow type by checking: 1. The endpoint that was used to initiate the flow 2. The type
field in the flow data, which will be either browser
or api
For example, in the GitHub issue logs, you can see the flow type specified: "type": "browser"
This distinction is important because Ory recommends never using API flows to implement browser applications due to security concerns, as mentioned in the [Self-service flows](https://www.ory.sh/docs/kratos/self-service#performing-login-registration-settings--flows) documentation. When implementing webhooks or actions that respond to registration events, you can use this information to customize your logic based on whether the user is registering from a web browser or a mobile application.ancient-dentist-17854
03/17/2025, 9:08 AMbrief-egg-61061
03/17/2025, 9:08 AMbrief-egg-61061
03/17/2025, 9:08 AM<http://ory.bar.com|ory.bar.com>
and <http://app.bar.com|app.bar.com>
will work; > - <http://ory.bar.com|ory.bar.com>
and <http://bar.com|bar.com>
will work; > - <http://ory.bar.com|ory.bar.com>
and <http://not-bar.com|not-bar.com>
will not work. [Self-service flows](https://www.ory.sh/docs/kratos/self-service#browser-flows-for-server-side-apps-nodejs-php-java-) ## Alternative Approach For mobile applications, Ory recommends using the native API flows instead of browser flows in WebViews: > Native apps use the https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/{flow-type}/api|PROJECT_SLUG.projects.oryapis.com/self-service/{flow-type}/api>
endpoint to initialize flows such as sign in, registration, profile changes, and so on. When using this endpoint, no CSRF cookies will be issued by Ory. [Browser vs. native apps](https://www.ory.sh/docs/identities/native-browser) The native API approach is specifically designed for mobile applications and avoids many of the security concerns associated with WebViews and browser flows.