Initialize Login Flow for APIs, Services, Apps, ...
This endpoint initiates a login flow for API clients that do not use a browser, such as mobile devices, smart TVs, and so on.
If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter ?refresh=true is set.
To fetch an existing login flow call /self-service/login/flows?flow=<flow_id>.
You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks.
This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).
More information can be found at Ory Kratos User Login and User Registration Documentation.
Query parameters
Refresh a login session
If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session.
Response
selfServiceLoginFlow
Example response
{
"expires_at": "2000-01-23T04:56:07.000+00:00",
"ui": {
"nodes": [
{
"meta": {
"label": {
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
}
},
"messages": [
{
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
},
{
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
}
],
"type": "type",
"group": "group"
},
{
"meta": {
"label": {
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
}
},
"messages": [
{
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
},
{
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
}
],
"type": "type",
"group": "group"
}
],
"method": "method",
"action": "action",
"messages": [
{
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
},
{
"context": "{}",
"id": 0,
"text": "text",
"type": "type"
}
]
},
"updated_at": "2000-01-23T04:56:07.000+00:00",
"forced": true,
"active": "active",
"created_at": "2000-01-23T04:56:07.000+00:00",
"id": "id",
"type": "type",
"issued_at": "2000-01-23T04:56:07.000+00:00",
"request_url": "request_url"
}