Skip to content

Latest commit

 

History

History
1414 lines (963 loc) · 96.7 KB

FrontendApi.md

File metadata and controls

1414 lines (963 loc) · 96.7 KB

ory_kratos_client.api.FrontendApi

Load the API package

import 'package:ory_kratos_client/api.dart';

All URIs are relative to http://localhost

Method HTTP request Description
createBrowserLoginFlow GET /self-service/login/browser Create Login Flow for Browsers
createBrowserLogoutFlow GET /self-service/logout/browser Create a Logout URL for Browsers
createBrowserRecoveryFlow GET /self-service/recovery/browser Create Recovery Flow for Browsers
createBrowserRegistrationFlow GET /self-service/registration/browser Create Registration Flow for Browsers
createBrowserSettingsFlow GET /self-service/settings/browser Create Settings Flow for Browsers
createBrowserVerificationFlow GET /self-service/verification/browser Create Verification Flow for Browser Clients
createNativeLoginFlow GET /self-service/login/api Create Login Flow for Native Apps
createNativeRecoveryFlow GET /self-service/recovery/api Create Recovery Flow for Native Apps
createNativeRegistrationFlow GET /self-service/registration/api Create Registration Flow for Native Apps
createNativeSettingsFlow GET /self-service/settings/api Create Settings Flow for Native Apps
createNativeVerificationFlow GET /self-service/verification/api Create Verification Flow for Native Apps
disableMyOtherSessions DELETE /sessions Disable my other sessions
disableMySession DELETE /sessions/{id} Disable one of my sessions
exchangeSessionToken GET /sessions/token-exchange Exchange Session Token
getFlowError GET /self-service/errors Get User-Flow Errors
getLoginFlow GET /self-service/login/flows Get Login Flow
getRecoveryFlow GET /self-service/recovery/flows Get Recovery Flow
getRegistrationFlow GET /self-service/registration/flows Get Registration Flow
getSettingsFlow GET /self-service/settings/flows Get Settings Flow
getVerificationFlow GET /self-service/verification/flows Get Verification Flow
getWebAuthnJavaScript GET /.well-known/ory/webauthn.js Get WebAuthn JavaScript
listMySessions GET /sessions Get My Active Sessions
performNativeLogout DELETE /self-service/logout/api Perform Logout for Native Apps
toSession GET /sessions/whoami Check Who the Current HTTP Session Belongs To
updateLoginFlow POST /self-service/login Submit a Login Flow
updateLogoutFlow GET /self-service/logout Update Logout Flow
updateRecoveryFlow POST /self-service/recovery Update Recovery Flow
updateRegistrationFlow POST /self-service/registration Update Registration Flow
updateSettingsFlow POST /self-service/settings Complete Settings Flow
updateVerificationFlow POST /self-service/verification Complete Verification Flow

createBrowserLoginFlow

LoginFlow createBrowserLoginFlow(refresh, aal, returnTo, cookie, loginChallenge, organization)

Create Login Flow for Browsers

This endpoint initializes a browser-based user login flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to selfservice.flows.login.ui_url with the flow ID set as the query parameter ?flow=. If a valid user session exists already, the browser will be redirected to urls.default_redirect_url unless the query parameter ?refresh=true was set. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. 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. session_aal1_required: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. security_csrf_violation: Unable to fetch the flow because a CSRF violation occurred. security_identity_mismatch: The requested ?return_to address is not allowed to be used. Adjust this in the configuration! The optional query parameter login_challenge is set when using Kratos with Hydra in an OAuth2 flow. See the oauth2_provider.url configuration option. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at Ory Kratos User Login and User Registration Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final bool refresh = true; // bool | 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.
final String aal = aal_example; // String | Request a Specific AuthenticationMethod Assurance Level  Use this parameter to upgrade an existing session's authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to \"upgrade\" the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to \"aal2\".
final String returnTo = returnTo_example; // String | The URL to return the browser to after the flow was completed.
final String cookie = cookie_example; // String | 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.
final String loginChallenge = loginChallenge_example; // String | An optional Hydra login challenge. If present, Kratos will cooperate with Ory Hydra to act as an OAuth2 identity provider.  The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/login?login_challenge=abcde`).
final String organization = organization_example; // String | An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network.

try {
    final response = api.createBrowserLoginFlow(refresh, aal, returnTo, cookie, loginChallenge, organization);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createBrowserLoginFlow: $e\n');
}

Parameters

Name Type Description Notes
refresh bool 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. [optional]
aal String Request a Specific AuthenticationMethod Assurance Level Use this parameter to upgrade an existing session's authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to "upgrade" the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to "aal2". [optional]
returnTo String The URL to return the browser to after the flow was completed. [optional]
cookie String 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. [optional]
loginChallenge String An optional Hydra login challenge. If present, Kratos will cooperate with Ory Hydra to act as an OAuth2 identity provider. The value for this parameter comes from login_challenge URL Query parameter sent to your application (e.g. /login?login_challenge=abcde). [optional]
organization String An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network. [optional]

Return type

LoginFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createBrowserLogoutFlow

LogoutFlow createBrowserLogoutFlow(cookie, returnTo)

Create a Logout URL for Browsers

This endpoint initializes a browser-based user logout flow and a URL which can be used to log out the user. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the /self-service/logout/api URL directly with the Ory Session Token. The URL is only valid for the currently signed in user. If no user is signed in, this endpoint returns a 401 error. When calling this endpoint from a backend, please ensure to properly forward the HTTP cookies.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String cookie = cookie_example; // String | HTTP Cookies  If you call this endpoint from a backend, please include the original Cookie header in the request.
final String returnTo = returnTo_example; // String | Return to URL  The URL to which the browser should be redirected to after the logout has been performed.

try {
    final response = api.createBrowserLogoutFlow(cookie, returnTo);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createBrowserLogoutFlow: $e\n');
}

Parameters

Name Type Description Notes
cookie String HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request. [optional]
returnTo String Return to URL The URL to which the browser should be redirected to after the logout has been performed. [optional]

Return type

LogoutFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createBrowserRecoveryFlow

RecoveryFlow createBrowserRecoveryFlow(returnTo)

Create Recovery Flow for Browsers

This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to selfservice.flows.recovery.ui_url with the flow ID set as the query parameter ?flow=. If a valid user session exists, the browser is returned to the configured return URL. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects or a 400 bad request error if the user is already authenticated. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at Ory Kratos Account Recovery Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String returnTo = returnTo_example; // String | The URL to return the browser to after the flow was completed.

try {
    final response = api.createBrowserRecoveryFlow(returnTo);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createBrowserRecoveryFlow: $e\n');
}

Parameters

Name Type Description Notes
returnTo String The URL to return the browser to after the flow was completed. [optional]

Return type

RecoveryFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createBrowserRegistrationFlow

RegistrationFlow createBrowserRegistrationFlow(returnTo, loginChallenge, afterVerificationReturnTo, organization)

Create Registration Flow for Browsers

This endpoint initializes a browser-based user registration flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to selfservice.flows.registration.ui_url with the flow ID set as the query parameter ?flow=. If a valid user session exists already, the browser will be redirected to urls.default_redirect_url. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. 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. security_identity_mismatch: The requested ?return_to address is not allowed to be used. Adjust this in the configuration! If this endpoint is called via an AJAX request, the response contains the registration flow without a redirect. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at Ory Kratos User Login and User Registration Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String returnTo = returnTo_example; // String | The URL to return the browser to after the flow was completed.
final String loginChallenge = loginChallenge_example; // String | Ory OAuth 2.0 Login Challenge.  If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider.  The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/registration?login_challenge=abcde`).  This feature is compatible with Ory Hydra when not running on the Ory Network.
final String afterVerificationReturnTo = afterVerificationReturnTo_example; // String | The URL to return the browser to after the verification flow was completed.  After the registration flow is completed, the user will be sent a verification email. Upon completing the verification flow, this URL will be used to override the default `selfservice.flows.verification.after.default_redirect_to` value.
final String organization = organization_example; // String | 

try {
    final response = api.createBrowserRegistrationFlow(returnTo, loginChallenge, afterVerificationReturnTo, organization);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createBrowserRegistrationFlow: $e\n');
}

Parameters

Name Type Description Notes
returnTo String The URL to return the browser to after the flow was completed. [optional]
loginChallenge String Ory OAuth 2.0 Login Challenge. If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider. The value for this parameter comes from login_challenge URL Query parameter sent to your application (e.g. /registration?login_challenge=abcde). This feature is compatible with Ory Hydra when not running on the Ory Network. [optional]
afterVerificationReturnTo String The URL to return the browser to after the verification flow was completed. After the registration flow is completed, the user will be sent a verification email. Upon completing the verification flow, this URL will be used to override the default selfservice.flows.verification.after.default_redirect_to value. [optional]
organization String [optional]

Return type

RegistrationFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createBrowserSettingsFlow

SettingsFlow createBrowserSettingsFlow(returnTo, cookie)

Create Settings Flow for Browsers

This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to selfservice.flows.settings.ui_url with the flow ID set as the query parameter ?flow=. If no valid Ory Kratos Session Cookie is included in the request, a login flow will be initialized. If this endpoint is opened as a link in the browser, it will be redirected to selfservice.flows.settings.ui_url with the flow ID set as the query parameter ?flow=. If no valid user session was set, the browser will be redirected to the login endpoint. If this endpoint is called via an AJAX request, the response contains the settings flow without any redirects or a 401 forbidden error if no valid session was set. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor (happens automatically for server-side browser flows) or change the configuration. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the error.id of the JSON response body can be one of: security_csrf_violation: Unable to fetch the flow because a CSRF violation occurred. session_inactive: No Ory Session was found - sign in a user first. security_identity_mismatch: The requested ?return_to address is not allowed to be used. Adjust this in the configuration! This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at Ory Kratos User Settings & Profile Management Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String returnTo = returnTo_example; // String | The URL to return the browser to after the flow was completed.
final String cookie = cookie_example; // String | 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.

try {
    final response = api.createBrowserSettingsFlow(returnTo, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createBrowserSettingsFlow: $e\n');
}

Parameters

Name Type Description Notes
returnTo String The URL to return the browser to after the flow was completed. [optional]
cookie String 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. [optional]

Return type

SettingsFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createBrowserVerificationFlow

VerificationFlow createBrowserVerificationFlow(returnTo)

Create Verification Flow for Browser Clients

This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to selfservice.flows.verification.ui_url with the flow ID set as the query parameter ?flow=. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at Ory Kratos Email and Phone Verification Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String returnTo = returnTo_example; // String | The URL to return the browser to after the flow was completed.

try {
    final response = api.createBrowserVerificationFlow(returnTo);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createBrowserVerificationFlow: $e\n');
}

Parameters

Name Type Description Notes
returnTo String The URL to return the browser to after the flow was completed. [optional]

Return type

VerificationFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createNativeLoginFlow

LoginFlow createNativeLoginFlow(refresh, aal, xSessionToken, returnSessionTokenExchangeCode, returnTo, via)

Create Login Flow for Native Apps

This endpoint initiates a login flow for native apps 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. 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. session_aal1_required: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. 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.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final bool refresh = true; // bool | 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.
final String aal = aal_example; // String | Request a Specific AuthenticationMethod Assurance Level  Use this parameter to upgrade an existing session's authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to \"upgrade\" the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to \"aal2\".
final String xSessionToken = xSessionToken_example; // String | The Session Token of the Identity performing the settings flow.
final bool returnSessionTokenExchangeCode = true; // bool | EnableSessionTokenExchangeCode requests the login flow to include a code that can be used to retrieve the session token after the login flow has been completed.
final String returnTo = returnTo_example; // String | The URL to return the browser to after the flow was completed.
final String via = via_example; // String | Via should contain the identity's credential the code should be sent to. Only relevant in aal2 flows.

try {
    final response = api.createNativeLoginFlow(refresh, aal, xSessionToken, returnSessionTokenExchangeCode, returnTo, via);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createNativeLoginFlow: $e\n');
}

Parameters

Name Type Description Notes
refresh bool 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. [optional]
aal String Request a Specific AuthenticationMethod Assurance Level Use this parameter to upgrade an existing session's authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to "upgrade" the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to "aal2". [optional]
xSessionToken String The Session Token of the Identity performing the settings flow. [optional]
returnSessionTokenExchangeCode bool EnableSessionTokenExchangeCode requests the login flow to include a code that can be used to retrieve the session token after the login flow has been completed. [optional]
returnTo String The URL to return the browser to after the flow was completed. [optional]
via String Via should contain the identity's credential the code should be sent to. Only relevant in aal2 flows. [optional]

Return type

LoginFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createNativeRecoveryFlow

RecoveryFlow createNativeRecoveryFlow()

Create Recovery Flow for Native Apps

This endpoint initiates a recovery 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. On an existing recovery flow, use the getRecoveryFlow API endpoint. 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. 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 Account Recovery Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();

try {
    final response = api.createNativeRecoveryFlow();
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createNativeRecoveryFlow: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

RecoveryFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createNativeRegistrationFlow

RegistrationFlow createNativeRegistrationFlow(returnSessionTokenExchangeCode, returnTo)

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.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final bool returnSessionTokenExchangeCode = true; // bool | EnableSessionTokenExchangeCode requests the login flow to include a code that can be used to retrieve the session token after the login flow has been completed.
final String returnTo = returnTo_example; // String | The URL to return the browser to after the flow was completed.

try {
    final response = api.createNativeRegistrationFlow(returnSessionTokenExchangeCode, returnTo);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createNativeRegistrationFlow: $e\n');
}

Parameters

Name Type Description Notes
returnSessionTokenExchangeCode bool EnableSessionTokenExchangeCode requests the login flow to include a code that can be used to retrieve the session token after the login flow has been completed. [optional]
returnTo String The URL to return the browser to after the flow was completed. [optional]

Return type

RegistrationFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createNativeSettingsFlow

SettingsFlow createNativeSettingsFlow(xSessionToken)

Create Settings Flow for Native Apps

This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK. To fetch an existing settings flow call /self-service/settings/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. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor or change the configuration. In the case of an error, the error.id of the JSON response body can be one of: security_csrf_violation: Unable to fetch the flow because a CSRF violation occurred. session_inactive: No Ory Session was found - sign in a user first. 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 Settings & Profile Management Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String xSessionToken = xSessionToken_example; // String | The Session Token of the Identity performing the settings flow.

try {
    final response = api.createNativeSettingsFlow(xSessionToken);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createNativeSettingsFlow: $e\n');
}

Parameters

Name Type Description Notes
xSessionToken String The Session Token of the Identity performing the settings flow. [optional]

Return type

SettingsFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createNativeVerificationFlow

VerificationFlow createNativeVerificationFlow()

Create Verification Flow for Native Apps

This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on. To fetch an existing verification flow call /self-service/verification/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. 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 Email and Phone Verification Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();

try {
    final response = api.createNativeVerificationFlow();
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->createNativeVerificationFlow: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

VerificationFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

disableMyOtherSessions

DeleteMySessionsCount disableMyOtherSessions(xSessionToken, cookie)

Disable my other sessions

Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String xSessionToken = xSessionToken_example; // String | Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
final String cookie = cookie_example; // String | Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: `ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==`.  It is ok if more than one cookie are included here as all other cookies will be ignored.

try {
    final response = api.disableMyOtherSessions(xSessionToken, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->disableMyOtherSessions: $e\n');
}

Parameters

Name Type Description Notes
xSessionToken String Set the Session Token when calling from non-browser clients. A session token has a format of MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj. [optional]
cookie String Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==. It is ok if more than one cookie are included here as all other cookies will be ignored. [optional]

Return type

DeleteMySessionsCount

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

disableMySession

disableMySession(id, xSessionToken, cookie)

Disable one of my sessions

Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String id = id_example; // String | ID is the session's ID.
final String xSessionToken = xSessionToken_example; // String | Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
final String cookie = cookie_example; // String | Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: `ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==`.  It is ok if more than one cookie are included here as all other cookies will be ignored.

try {
    api.disableMySession(id, xSessionToken, cookie);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->disableMySession: $e\n');
}

Parameters

Name Type Description Notes
id String ID is the session's ID.
xSessionToken String Set the Session Token when calling from non-browser clients. A session token has a format of MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj. [optional]
cookie String Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==. It is ok if more than one cookie are included here as all other cookies will be ignored. [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

exchangeSessionToken

SuccessfulNativeLogin exchangeSessionToken(initCode, returnToCode)

Exchange Session Token

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String initCode = initCode_example; // String | The part of the code return when initializing the flow.
final String returnToCode = returnToCode_example; // String | The part of the code returned by the return_to URL.

try {
    final response = api.exchangeSessionToken(initCode, returnToCode);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->exchangeSessionToken: $e\n');
}

Parameters

Name Type Description Notes
initCode String The part of the code return when initializing the flow.
returnToCode String The part of the code returned by the return_to URL.

Return type

SuccessfulNativeLogin

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getFlowError

FlowError getFlowError(id)

Get User-Flow Errors

This endpoint returns the error associated with a user-facing self service errors. This endpoint supports stub values to help you implement the error UI: ?id=stub:500 - returns a stub 500 (Internal Server Error) error. More information can be found at Ory Kratos User User Facing Error Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String id = id_example; // String | Error is the error's ID

try {
    final response = api.getFlowError(id);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->getFlowError: $e\n');
}

Parameters

Name Type Description Notes
id String Error is the error's ID

Return type

FlowError

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getLoginFlow

LoginFlow getLoginFlow(id, cookie)

Get Login Flow

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: js 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.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String id = id_example; // String | The Login Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/login?flow=abcde`).
final String cookie = cookie_example; // String | 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.

try {
    final response = api.getLoginFlow(id, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->getLoginFlow: $e\n');
}

Parameters

Name Type Description Notes
id String The Login Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /login?flow=abcde).
cookie String 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. [optional]

Return type

LoginFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getRecoveryFlow

RecoveryFlow getRecoveryFlow(id, cookie)

Get Recovery Flow

This endpoint returns a recovery 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: js pseudo-code example router.get('/recovery', async function (req, res) { const flow = await client.getRecoveryFlow(req.header('Cookie'), req.query['flow']) res.render('recovery', flow) }) More information can be found at Ory Kratos Account Recovery Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String id = id_example; // String | The Flow ID  The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/recovery?flow=abcde`).
final String cookie = cookie_example; // String | 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.

try {
    final response = api.getRecoveryFlow(id, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->getRecoveryFlow: $e\n');
}

Parameters

Name Type Description Notes
id String The Flow ID The value for this parameter comes from request URL Query parameter sent to your application (e.g. /recovery?flow=abcde).
cookie String 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. [optional]

Return type

RecoveryFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getRegistrationFlow

RegistrationFlow getRegistrationFlow(id, cookie)

Get Registration Flow

This endpoint returns a registration 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: js pseudo-code example router.get('/registration', async function (req, res) { const flow = await client.getRegistrationFlow(req.header('cookie'), req.query['flow']) res.render('registration', 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.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String id = id_example; // String | The Registration Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`).
final String cookie = cookie_example; // String | 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.

try {
    final response = api.getRegistrationFlow(id, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->getRegistrationFlow: $e\n');
}

Parameters

Name Type Description Notes
id String The Registration Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /registration?flow=abcde).
cookie String 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. [optional]

Return type

RegistrationFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSettingsFlow

SettingsFlow getSettingsFlow(id, xSessionToken, cookie)

Get Settings Flow

When accessing this endpoint through Ory Kratos' Public API you must ensure that either the Ory Kratos Session Cookie or the Ory Kratos Session Token are set. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor or change the configuration. You can access this endpoint without credentials when using Ory Kratos' Admin API. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the error.id of the JSON response body can be one of: security_csrf_violation: Unable to fetch the flow because a CSRF violation occurred. session_inactive: No Ory Session was found - sign in a user first. security_identity_mismatch: The flow was interrupted with session_refresh_required but apparently some other identity logged in instead. More information can be found at Ory Kratos User Settings & Profile Management Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String id = id_example; // String | ID is the Settings Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/settings?flow=abcde`).
final String xSessionToken = xSessionToken_example; // String | The Session Token  When using the SDK in an app without a browser, please include the session token here.
final String cookie = cookie_example; // String | 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.

try {
    final response = api.getSettingsFlow(id, xSessionToken, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->getSettingsFlow: $e\n');
}

Parameters

Name Type Description Notes
id String ID is the Settings Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /settings?flow=abcde).
xSessionToken String The Session Token When using the SDK in an app without a browser, please include the session token here. [optional]
cookie String 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. [optional]

Return type

SettingsFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getVerificationFlow

VerificationFlow getVerificationFlow(id, cookie)

Get Verification Flow

This endpoint returns a verification 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: js pseudo-code example router.get('/recovery', async function (req, res) { const flow = await client.getVerificationFlow(req.header('cookie'), req.query['flow']) res.render('verification', flow) }) More information can be found at Ory Kratos Email and Phone Verification Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String id = id_example; // String | The Flow ID  The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/verification?flow=abcde`).
final String cookie = cookie_example; // String | HTTP Cookies  When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.

try {
    final response = api.getVerificationFlow(id, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->getVerificationFlow: $e\n');
}

Parameters

Name Type Description Notes
id String The Flow ID The value for this parameter comes from request URL Query parameter sent to your application (e.g. /verification?flow=abcde).
cookie String HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here. [optional]

Return type

VerificationFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebAuthnJavaScript

String getWebAuthnJavaScript()

Get WebAuthn JavaScript

This endpoint provides JavaScript which is needed in order to perform WebAuthn login and registration. If you are building a JavaScript Browser App (e.g. in ReactJS or AngularJS) you will need to load this file: html <script src=\"https://public-kratos.example.org/.well-known/ory/webauthn.js\" type=\"script\" async /> More information can be found at Ory Kratos User Login and User Registration Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();

try {
    final response = api.getWebAuthnJavaScript();
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->getWebAuthnJavaScript: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listMySessions

BuiltList listMySessions(perPage, page, pageSize, pageToken, xSessionToken, cookie)

Get My Active Sessions

This endpoints returns all other active sessions that belong to the logged-in user. The current session can be retrieved by calling the /sessions/whoami endpoint.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final int perPage = 789; // int | Deprecated Items per Page  DEPRECATED: Please use `page_token` instead. This parameter will be removed in the future.  This is the number of items per page.
final int page = 789; // int | Deprecated Pagination Page  DEPRECATED: Please use `page_token` instead. This parameter will be removed in the future.  This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list.  For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the `Link` header.
final int pageSize = 789; // int | Page Size  This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
final String pageToken = pageToken_example; // String | Next Page Token  The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
final String xSessionToken = xSessionToken_example; // String | Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
final String cookie = cookie_example; // String | Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: `ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==`.  It is ok if more than one cookie are included here as all other cookies will be ignored.

try {
    final response = api.listMySessions(perPage, page, pageSize, pageToken, xSessionToken, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->listMySessions: $e\n');
}

Parameters

Name Type Description Notes
perPage int Deprecated Items per Page DEPRECATED: Please use page_token instead. This parameter will be removed in the future. This is the number of items per page. [optional] [default to 250]
page int Deprecated Pagination Page DEPRECATED: Please use page_token instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the Link header. [optional]
pageSize int Page Size This is the number of items per page to return. For details on pagination please head over to the pagination documentation. [optional] [default to 250]
pageToken String Next Page Token The next page token. For details on pagination please head over to the pagination documentation. [optional] [default to '1']
xSessionToken String Set the Session Token when calling from non-browser clients. A session token has a format of MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj. [optional]
cookie String Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==. It is ok if more than one cookie are included here as all other cookies will be ignored. [optional]

Return type

BuiltList<Session>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

performNativeLogout

performNativeLogout(performNativeLogoutBody)

Perform Logout for Native Apps

Use this endpoint to log out an identity using an Ory Session Token. If the Ory Session Token was successfully revoked, the server returns a 204 No Content response. A 204 No Content response is also sent when the Ory Session Token has been revoked already before. If the Ory Session Token is malformed or does not exist a 403 Forbidden response will be returned. This endpoint does not remove any HTTP Cookies - use the Browser-Based Self-Service Logout Flow instead.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final PerformNativeLogoutBody performNativeLogoutBody = ; // PerformNativeLogoutBody | 

try {
    api.performNativeLogout(performNativeLogoutBody);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->performNativeLogout: $e\n');
}

Parameters

Name Type Description Notes
performNativeLogoutBody PerformNativeLogoutBody

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

toSession

Session toSession(xSessionToken, cookie, tokenizeAs)

Check Who the Current HTTP Session Belongs To

Uses the HTTP Headers in the GET request to determine (e.g. by using checking the cookies) who is authenticated. Returns a session object in the body or 401 if the credentials are invalid or no credentials were sent. When the request it successful it adds the user ID to the 'X-Kratos-Authenticated-Identity-Id' header in the response. If you call this endpoint from a server-side application, you must forward the HTTP Cookie Header to this endpoint: js pseudo-code example router.get('/protected-endpoint', async function (req, res) { const session = await client.toSession(undefined, req.header('cookie')) console.log(session) }) When calling this endpoint from a non-browser application (e.g. mobile app) you must include the session token: js pseudo-code example ... const session = await client.toSession(\"the-session-token\") console.log(session) When using a token template, the token is included in the tokenized field of the session. js pseudo-code example ... const session = await client.toSession(\"the-session-token\", { tokenize_as: \"example-jwt-template\" }) console.log(session.tokenized) // The JWT Depending on your configuration this endpoint might return a 403 status code if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor or change the configuration. This endpoint is useful for: AJAX calls. Remember to send credentials and set up CORS correctly! Reverse proxies and API Gateways Server-side calls - use the X-Session-Token header! This endpoint authenticates users by checking: if the Cookie HTTP header was set containing an Ory Kratos Session Cookie; if the Authorization: bearer <ory-session-token> HTTP header was set with a valid Ory Kratos Session Token; if the X-Session-Token HTTP header was set with a valid Ory Kratos Session Token. If none of these headers are set or the cookie or token are invalid, the endpoint returns a HTTP 401 status code. As explained above, this request may fail due to several reasons. The error.id can be one of: session_inactive: No active session was found in the request (e.g. no Ory Session Cookie / Ory Session Token). session_aal2_required: An active session was found but it does not fulfil the Authenticator Assurance Level, implying that the session must (e.g.) authenticate the second factor.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String xSessionToken = MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj; // String | Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
final String cookie = ory_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==; // String | Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: `ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==`.  It is ok if more than one cookie are included here as all other cookies will be ignored.
final String tokenizeAs = tokenizeAs_example; // String | Returns the session additionally as a token (such as a JWT)  The value of this parameter has to be a valid, configured Ory Session token template. For more information head over to [the documentation](http://ory.sh/docs/identities/session-to-jwt-cors).

try {
    final response = api.toSession(xSessionToken, cookie, tokenizeAs);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->toSession: $e\n');
}

Parameters

Name Type Description Notes
xSessionToken String Set the Session Token when calling from non-browser clients. A session token has a format of MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj. [optional]
cookie String Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==. It is ok if more than one cookie are included here as all other cookies will be ignored. [optional]
tokenizeAs String Returns the session additionally as a token (such as a JWT) The value of this parameter has to be a valid, configured Ory Session token template. For more information head over to the documentation. [optional]

Return type

Session

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateLoginFlow

SuccessfulNativeLogin updateLoginFlow(flow, updateLoginFlowBody, xSessionToken, cookie)

Submit a Login Flow

Use this endpoint to complete a login flow. This endpoint behaves differently for API and browser flows. API flows expect application/json to be sent in the body and responds with HTTP 200 and a application/json body with the session token on success; HTTP 410 if the original flow expired with the appropriate error messages set and optionally a use_flow_id parameter in the body; HTTP 400 on form validation errors. Browser flows expect a Content-Type of application/x-www-form-urlencoded or application/json to be sent in the body and respond with a HTTP 303 redirect to the post/after login URL or the return_to value if it was set and if the login succeeded; a HTTP 303 redirect to the login UI URL with the flow ID containing the validation errors otherwise. Browser flows with an accept header of application/json will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a Set-Cookie header on success; HTTP 303 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. If this endpoint is called with Accept: application/json in the header, the response contains the flow without a redirect. 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. security_identity_mismatch: The requested ?return_to address is not allowed to be used. Adjust this in the configuration! browser_location_change_required: Usually sent when an AJAX request indicates that the browser needs to open a specific URL. Most likely used in Social Sign In flows. More information can be found at Ory Kratos User Login and User Registration Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String flow = flow_example; // String | The Login Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/login?flow=abcde`).
final UpdateLoginFlowBody updateLoginFlowBody = ; // UpdateLoginFlowBody | 
final String xSessionToken = xSessionToken_example; // String | The Session Token of the Identity performing the settings flow.
final String cookie = cookie_example; // String | 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.

try {
    final response = api.updateLoginFlow(flow, updateLoginFlowBody, xSessionToken, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->updateLoginFlow: $e\n');
}

Parameters

Name Type Description Notes
flow String The Login Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /login?flow=abcde).
updateLoginFlowBody UpdateLoginFlowBody
xSessionToken String The Session Token of the Identity performing the settings flow. [optional]
cookie String 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. [optional]

Return type

SuccessfulNativeLogin

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateLogoutFlow

updateLogoutFlow(token, returnTo, cookie)

Update Logout Flow

This endpoint logs out an identity in a self-service manner. If the Accept HTTP header is not set to application/json, the browser will be redirected (HTTP 303 See Other) to the return_to parameter of the initial request or fall back to urls.default_return_to. If the Accept HTTP header is set to application/json, a 204 No Content response will be sent on successful logout instead. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the /self-service/logout/api URL directly with the Ory Session Token. More information can be found at Ory Kratos User Logout Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String token = token_example; // String | A Valid Logout Token  If you do not have a logout token because you only have a session cookie, call `/self-service/logout/browser` to generate a URL for this endpoint.
final String returnTo = returnTo_example; // String | The URL to return to after the logout was completed.
final String cookie = cookie_example; // String | 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.

try {
    api.updateLogoutFlow(token, returnTo, cookie);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->updateLogoutFlow: $e\n');
}

Parameters

Name Type Description Notes
token String A Valid Logout Token If you do not have a logout token because you only have a session cookie, call /self-service/logout/browser to generate a URL for this endpoint. [optional]
returnTo String The URL to return to after the logout was completed. [optional]
cookie String 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. [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateRecoveryFlow

RecoveryFlow updateRecoveryFlow(flow, updateRecoveryFlowBody, token, cookie)

Update Recovery Flow

Use this endpoint to update a recovery flow. This endpoint behaves differently for API and browser flows and has several states: choose_method expects flow (in the URL query) and email (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header Accept: application/json it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid. and a HTTP 303 See Other redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). For Browser clients without HTTP Header Accept or with Accept: text/_* it returns a HTTP 303 See Other redirect to the Recovery UI URL with the Recovery Flow ID appended. sent_email is the success state after choose_method for the link method and allows the user to request another recovery email. It works for both API and Browser-initiated flows and returns the same responses as the flow in choose_method state. passed_challenge expects a token to be sent in the URL query and given the nature of the flow ("sending a recovery link") does not have any API capabilities. The server responds with a HTTP 303 See Other redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with a new Recovery Flow ID which contains an error message that the recovery link was invalid. More information can be found at Ory Kratos Account Recovery Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String flow = flow_example; // String | The Recovery Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/recovery?flow=abcde`).
final UpdateRecoveryFlowBody updateRecoveryFlowBody = ; // UpdateRecoveryFlowBody | 
final String token = token_example; // String | Recovery Token  The recovery token which completes the recovery request. If the token is invalid (e.g. expired) an error will be shown to the end-user.  This parameter is usually set in a link and not used by any direct API call.
final String cookie = cookie_example; // String | 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.

try {
    final response = api.updateRecoveryFlow(flow, updateRecoveryFlowBody, token, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->updateRecoveryFlow: $e\n');
}

Parameters

Name Type Description Notes
flow String The Recovery Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /recovery?flow=abcde).
updateRecoveryFlowBody UpdateRecoveryFlowBody
token String Recovery Token The recovery token which completes the recovery request. If the token is invalid (e.g. expired) an error will be shown to the end-user. This parameter is usually set in a link and not used by any direct API call. [optional]
cookie String 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. [optional]

Return type

RecoveryFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateRegistrationFlow

SuccessfulNativeRegistration updateRegistrationFlow(flow, updateRegistrationFlowBody, cookie)

Update Registration Flow

Use this endpoint to complete a registration flow by sending an identity's traits and password. This endpoint behaves differently for API and browser flows. API flows expect application/json to be sent in the body and respond with HTTP 200 and a application/json body with the created identity success - if the session hook is configured the session and session_token will also be included; HTTP 410 if the original flow expired with the appropriate error messages set and optionally a use_flow_id parameter in the body; HTTP 400 on form validation errors. Browser flows expect a Content-Type of application/x-www-form-urlencoded or application/json to be sent in the body and respond with a HTTP 303 redirect to the post/after registration URL or the return_to value if it was set and if the registration succeeded; a HTTP 303 redirect to the registration UI URL with the flow ID containing the validation errors otherwise. Browser flows with an accept header of application/json will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a Set-Cookie header on success; HTTP 303 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. If this endpoint is called with Accept: application/json in the header, the response contains the flow without a redirect. 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. security_identity_mismatch: The requested ?return_to address is not allowed to be used. Adjust this in the configuration! browser_location_change_required: Usually sent when an AJAX request indicates that the browser needs to open a specific URL. Most likely used in Social Sign In flows. More information can be found at Ory Kratos User Login and User Registration Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String flow = flow_example; // String | The Registration Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`).
final UpdateRegistrationFlowBody updateRegistrationFlowBody = ; // UpdateRegistrationFlowBody | 
final String cookie = cookie_example; // String | 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.

try {
    final response = api.updateRegistrationFlow(flow, updateRegistrationFlowBody, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->updateRegistrationFlow: $e\n');
}

Parameters

Name Type Description Notes
flow String The Registration Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /registration?flow=abcde).
updateRegistrationFlowBody UpdateRegistrationFlowBody
cookie String 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. [optional]

Return type

SuccessfulNativeRegistration

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateSettingsFlow

SettingsFlow updateSettingsFlow(flow, updateSettingsFlowBody, xSessionToken, cookie)

Complete Settings Flow

Use this endpoint to complete a settings flow by sending an identity's updated password. This endpoint behaves differently for API and browser flows. API-initiated flows expect application/json to be sent in the body and respond with HTTP 200 and an application/json body with the session token on success; HTTP 303 redirect to a fresh settings flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. HTTP 401 when the endpoint is called without a valid session token. HTTP 403 when selfservice.flows.settings.privileged_session_max_age was reached or the session's AAL is too low. Implies that the user needs to re-authenticate. Browser flows without HTTP Header Accept or with Accept: text/_* respond with a HTTP 303 redirect to the post/after settings URL or the return_to value if it was set and if the flow succeeded; a HTTP 303 redirect to the Settings UI URL with the flow ID containing the validation errors otherwise. a HTTP 303 redirect to the login endpoint when selfservice.flows.settings.privileged_session_max_age was reached or the session's AAL is too low. Browser flows with HTTP Header Accept: application/json respond with HTTP 200 and a application/json body with the signed in identity and a Set-Cookie header on success; HTTP 303 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 401 when the endpoint is called without a valid session cookie. HTTP 403 when the page is accessed without a session cookie or the session's AAL is too low. HTTP 400 on form validation errors. Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor (happens automatically for server-side browser flows) or change the configuration. If this endpoint is called with a Accept: application/json HTTP header, the response contains the flow without a redirect. In the case of an error, the error.id of the JSON response body can be one of: session_refresh_required: The identity requested to change something that needs a privileged session. Redirect the identity to the login init endpoint with query parameters ?refresh=true&return_to=<the-current-browser-url>, or initiate a refresh login flow otherwise. security_csrf_violation: Unable to fetch the flow because a CSRF violation occurred. session_inactive: No Ory Session was found - sign in a user first. security_identity_mismatch: The flow was interrupted with session_refresh_required but apparently some other identity logged in instead. security_identity_mismatch: The requested ?return_to address is not allowed to be used. Adjust this in the configuration! browser_location_change_required: Usually sent when an AJAX request indicates that the browser needs to open a specific URL. Most likely used in Social Sign In flows. More information can be found at Ory Kratos User Settings & Profile Management Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String flow = flow_example; // String | The Settings Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/settings?flow=abcde`).
final UpdateSettingsFlowBody updateSettingsFlowBody = ; // UpdateSettingsFlowBody | 
final String xSessionToken = xSessionToken_example; // String | The Session Token of the Identity performing the settings flow.
final String cookie = cookie_example; // String | 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.

try {
    final response = api.updateSettingsFlow(flow, updateSettingsFlowBody, xSessionToken, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->updateSettingsFlow: $e\n');
}

Parameters

Name Type Description Notes
flow String The Settings Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /settings?flow=abcde).
updateSettingsFlowBody UpdateSettingsFlowBody
xSessionToken String The Session Token of the Identity performing the settings flow. [optional]
cookie String 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. [optional]

Return type

SettingsFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateVerificationFlow

VerificationFlow updateVerificationFlow(flow, updateVerificationFlowBody, token, cookie)

Complete Verification Flow

Use this endpoint to complete a verification flow. This endpoint behaves differently for API and browser flows and has several states: choose_method expects flow (in the URL query) and email (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header Accept: application/json it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 303 See Other redirect with a fresh verification flow if the flow was otherwise invalid (e.g. expired). For Browser clients without HTTP Header Accept or with Accept: text/_* it returns a HTTP 303 See Other redirect to the Verification UI URL with the Verification Flow ID appended. sent_email is the success state after choose_method when using the link method and allows the user to request another verification email. It works for both API and Browser-initiated flows and returns the same responses as the flow in choose_method state. passed_challenge expects a token to be sent in the URL query and given the nature of the flow ("sending a verification link") does not have any API capabilities. The server responds with a HTTP 303 See Other redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Verification UI URL with a new Verification Flow ID which contains an error message that the verification link was invalid. More information can be found at Ory Kratos Email and Phone Verification Documentation.

Example

import 'package:ory_kratos_client/api.dart';

final api = OryKratosClient().getFrontendApi();
final String flow = flow_example; // String | The Verification Flow ID  The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/verification?flow=abcde`).
final UpdateVerificationFlowBody updateVerificationFlowBody = ; // UpdateVerificationFlowBody | 
final String token = token_example; // String | Verification Token  The verification token which completes the verification request. If the token is invalid (e.g. expired) an error will be shown to the end-user.  This parameter is usually set in a link and not used by any direct API call.
final String cookie = cookie_example; // String | 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.

try {
    final response = api.updateVerificationFlow(flow, updateVerificationFlowBody, token, cookie);
    print(response);
} catch on DioError (e) {
    print('Exception when calling FrontendApi->updateVerificationFlow: $e\n');
}

Parameters

Name Type Description Notes
flow String The Verification Flow ID The value for this parameter comes from flow URL Query parameter sent to your application (e.g. /verification?flow=abcde).
updateVerificationFlowBody UpdateVerificationFlowBody
token String Verification Token The verification token which completes the verification request. If the token is invalid (e.g. expired) an error will be shown to the end-user. This parameter is usually set in a link and not used by any direct API call. [optional]
cookie String 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. [optional]

Return type

VerificationFlow

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]