frontend

Create Registration Flow for Native Apps

This endpoint initiates a registration flow for API clients 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 registration flow call /self-service/registration/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.

In the case of an error, the error.id of the JSON response body can be one of:

session_already_available: The user is already signed in. security_csrf_violation: Unable to fetch the flow because a CSRF violation occurred.

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.

get/self-service/registration/api

Response

registrationFlow

active'password' | 'totp' | 'oidc' | 'webauthn' | 'lookup_secret'

and so on.

expires_atstring date-time required

ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in, a new flow has to be initiated.

idstring uuid required

ID represents the flow's unique ID. When performing the registration flow, this represents the id in the registration ui's query parameter: http://<selfservice.flows.registration.ui_url>/?flow=<id>

issued_atstring date-time required

IssuedAt is the time (UTC) when the flow occurred.

oauth2_login_challengestring uuid4 nullable
request_urlstring required

RequestURL is the initial URL that was requested from Ory Kratos. It can be used to forward information contained in the URL's path or query for example.

return_tostring

ReturnTo contains the requested return_to URL.

transient_payloadobject

TransientPayload is used to pass data from the registration to a webhook

typestring required

The flow type can either be api or browser.

Example response

{
  "expires_at": "2000-01-23T04:56:07.000+00:00",
  "oauth2_login_request": {
    "requested_access_token_audience": [
      "requested_access_token_audience",
      "requested_access_token_audience"
    ],
    "subject": "subject",
    "oidc_context": {
      "login_hint": "login_hint",
      "ui_locales": [
        "ui_locales",
        "ui_locales"
      ],
      "id_token_hint_claims": {
        "key": ""
      },
      "acr_values": [
        "acr_values",
        "acr_values"
      ],
      "display": "display"
    },
    "challenge": "challenge",
    "client": {
      "metadata": "",
      "token_endpoint_auth_signing_alg": "token_endpoint_auth_signing_alg",
      "client_uri": "client_uri",
      "jwt_bearer_grant_access_token_lifespan": "jwt_bearer_grant_access_token_lifespan",
      "jwks": "",
      "logo_uri": "logo_uri",
      "created_at": "2000-01-23T04:56:07.000+00:00",
      "registration_client_uri": "registration_client_uri",
      "allowed_cors_origins": [
        "allowed_cors_origins",
        "allowed_cors_origins"
      ],
      "refresh_token_grant_access_token_lifespan": "refresh_token_grant_access_token_lifespan",
      "registration_access_token": "registration_access_token",
      "client_id": "client_id",
      "token_endpoint_auth_method": "token_endpoint_auth_method",
      "userinfo_signed_response_alg": "userinfo_signed_response_alg",
      "authorization_code_grant_id_token_lifespan": "authorization_code_grant_id_token_lifespan",
      "authorization_code_grant_refresh_token_lifespan": "authorization_code_grant_refresh_token_lifespan",
      "client_credentials_grant_access_token_lifespan": "client_credentials_grant_access_token_lifespan",
      "updated_at": "2000-01-23T04:56:07.000+00:00",
      "scope": "scope",
      "request_uris": [
        "request_uris",
        "request_uris"
      ],
      "client_secret": "client_secret",
      "backchannel_logout_session_required": true,
      "backchannel_logout_uri": "backchannel_logout_uri",
      "client_name": "client_name",
      "policy_uri": "policy_uri",
      "owner": "owner",
      "audience": [
        "audience",
        "audience"
      ],
      "authorization_code_grant_access_token_lifespan": "authorization_code_grant_access_token_lifespan",
      "post_logout_redirect_uris": [
        "post_logout_redirect_uris",
        "post_logout_redirect_uris"
      ],
      "grant_types": [
        "grant_types",
        "grant_types"
      ],
      "subject_type": "subject_type",
      "refresh_token_grant_refresh_token_lifespan": "refresh_token_grant_refresh_token_lifespan",
      "redirect_uris": [
        "redirect_uris",
        "redirect_uris"
      ],
      "sector_identifier_uri": "sector_identifier_uri",
      "frontchannel_logout_session_required": true,
      "frontchannel_logout_uri": "frontchannel_logout_uri",
      "refresh_token_grant_id_token_lifespan": "refresh_token_grant_id_token_lifespan",
      "implicit_grant_id_token_lifespan": "implicit_grant_id_token_lifespan",
      "client_secret_expires_at": 0,
      "implicit_grant_access_token_lifespan": "implicit_grant_access_token_lifespan",
      "jwks_uri": "jwks_uri",
      "request_object_signing_alg": "request_object_signing_alg",
      "tos_uri": "tos_uri",
      "contacts": [
        "contacts",
        "contacts"
      ],
      "response_types": [
        "response_types",
        "response_types"
      ]
    },
    "session_id": "session_id",
    "skip": true,
    "request_url": "request_url",
    "requested_scope": [
      "requested_scope",
      "requested_scope"
    ]
  },
  "transient_payload": "{}",
  "ui": {
    "nodes": [
      {
        "meta": {
          "label": {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        },
        "messages": [
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          },
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        ],
        "attributes": null,
        "type": "text",
        "group": "default"
      },
      {
        "meta": {
          "label": {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        },
        "messages": [
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          },
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        ],
        "attributes": null,
        "type": "text",
        "group": "default"
      }
    ],
    "method": "method",
    "action": "action",
    "messages": [
      {
        "context": "{}",
        "id": 6,
        "text": "text",
        "type": "info"
      },
      {
        "context": "{}",
        "id": 6,
        "text": "text",
        "type": "info"
      }
    ]
  },
  "oauth2_login_challenge": "oauth2_login_challenge",
  "active": null,
  "return_to": "return_to",
  "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "type": "type",
  "issued_at": "2000-01-23T04:56:07.000+00:00",
  "request_url": "request_url"
}

Changes