Get Login Flow
This endpoint returns a login flow's context with, for example, error details and other information.
GET /self-service/login/flows
This endpoint returns a login flow's context with, for example, error details and other information.
Browser flows expect the anti-CSRF cookie to be included in the request's HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail.
If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint:
pseudo-code example
router.get('/login', async function (req, res) {
const flow = await client.getLoginFlow(req.header('cookie'), req.query['flow'])
res.render('login', flow)
})This request may fail due to several reasons. The error.id can be one of:
session_already_available: The user is already signed in.
self_service_flow_expired: The flow is expired and you should request a new one.
More information can be found at Ory Kratos User Login and User Registration Documentation.
Operation ID: getLoginFlow Tag: frontend
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Login Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /login?flow=abcde). |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Cookie | string | no | HTTP Cookies When using the SDK in a browser app, on the server side you must include the HTTP Cookie Header sent by the client to your server here. This ensures that CSRF and session cookies are respected. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | loginFlow | application/json, object |
| 403 | errorGeneric | application/json, object |
| 404 | errorGeneric | application/json, object |
| 410 | errorGeneric | application/json, object |
| default | errorGeneric | application/json, object |
Generated from /tmp/kratos-api.json at build time.