mysterious-kitchen-18431
10/29/2024, 5:47 PMbrief-egg-61061
10/29/2024, 5:47 PMbrief-egg-61061
10/29/2024, 5:47 PMbash curl -X GET \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -c cookies.txt \ https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/login/browser|PROJECT_SLUG.projects.oryapis.com/self-service/login/browser>
[Docs > Kratos > Bring-your-own-ui > Integration basics > Login flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#login-flow) 2. Submit the login flow: Send a POST request to /self-service/login
with the flow ID, CSRF token, and login credentials: bash curl -X POST \ -H 'Content-Type: application/json'\ -H 'Accept: application/json' \ -d '{"method":"password","csrf_token":"your-csrf-token","identifier":"<mailto:user@example.com|user@example.com>","password":"verystrongpassword"}' \ -b cookies.txt \ -c cookies.txt \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/login?flow=<your-flow-id|PROJECT_SLUG.projects.oryapis.com/self-service/login?flow=<your-flow-id>>"
[Docs > Kratos > Bring-your-own-ui > Integration basics > Login flow > Submit login flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#submit-login-flow) Key differences for browser-based login: 1. Use /self-service/login/browser
instead of /self-service/login/api
to initialize the flow. 2. Include cookies in your requests (-b cookies.txt -c cookies.txt
). 3. Include the CSRF token in the login submission. 4. The response will set session cookies for authentication instead of returning a session token. Remember to replace $PROJECT_SLUG
with your actual project slug, your-csrf-token
with the CSRF token received in the initial response, and <your-flow-id>
with the flow ID from the initialization response.