Class: OryClient::FrontendApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ory-client/api/frontend_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FrontendApi

Returns a new instance of FrontendApi.



19
20
21
# File 'lib/ory-client/api/frontend_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



17
18
19
# File 'lib/ory-client/api/frontend_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_browser_login_flow(opts = {}) ⇒ LoginFlow

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. - session_aal2_enrollment_required: Second-factor auth is required but the identity has no second factor enrolled. Follow redirect_browser_to to the settings flow to enroll one. - 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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean) —

    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.

  • :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".

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

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

  • :login_challenge (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`).

  • :organization (String) —

    An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network.

  • :via (String) —

    Via should contain the identity's credential the code should be sent to. Only relevant in aal2 flows. DEPRECATED: This field is deprecated. Please remove it from your requests. The user will now see a choice of MFA credentials to choose from to perform the second factor instead.

  • :identity_schema (String) —

    An optional identity schema to use for the login flow.

Returns:



34
35
36
37
# File 'lib/ory-client/api/frontend_api.rb', line 34

def (opts = {})
  data, _status_code, _headers = (opts)
  data
end

#create_browser_login_flow_with_http_info(opts = {}) ⇒ Array<(LoginFlow, Integer, Hash)>

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. - `session_aal2_enrollment_required`: Second-factor auth is required but the identity has no second factor enrolled. Follow `redirect_browser_to` to the settings flow to enroll one. - `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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean) —

    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.

  • :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 &quot;upgrade&quot; the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to &quot;aal2&quot;.

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

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

  • :login_challenge (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`).

  • :organization (String) —

    An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network.

  • :via (String) —

    Via should contain the identity's credential the code should be sent to. Only relevant in aal2 flows. DEPRECATED: This field is deprecated. Please remove it from your requests. The user will now see a choice of MFA credentials to choose from to perform the second factor instead.

  • :identity_schema (String) —

    An optional identity schema to use for the login flow.

Returns:

  • (Array<(LoginFlow, Integer, Hash)>) —

    LoginFlow data, response status code and response headers



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/ory-client/api/frontend_api.rb', line 51

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_browser_login_flow ...'
  end
  # resource path
  local_var_path = '/self-service/login/browser'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'refresh'] = opts[:'refresh'] if !opts[:'refresh'].nil?
  query_params[:'aal'] = opts[:'aal'] if !opts[:'aal'].nil?
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?
  query_params[:'login_challenge'] = opts[:'login_challenge'] if !opts[:'login_challenge'].nil?
  query_params[:'organization'] = opts[:'organization'] if !opts[:'organization'].nil?
  query_params[:'via'] = opts[:'via'] if !opts[:'via'].nil?
  query_params[:'identity_schema'] = opts[:'identity_schema'] if !opts[:'identity_schema'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoginFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_browser_login_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_browser_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_browser_logout_flow(opts = {}) ⇒ LogoutFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :cookie (String) —

    HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request.

  • :return_to (String) —

    Return to URL The URL to which the browser should be redirected to after the logout has been performed.

Returns:



109
110
111
112
# File 'lib/ory-client/api/frontend_api.rb', line 109

def create_browser_logout_flow(opts = {})
  data, _status_code, _headers = create_browser_logout_flow_with_http_info(opts)
  data
end

#create_browser_logout_flow_with_http_info(opts = {}) ⇒ Array<(LogoutFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :cookie (String) —

    HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request.

  • :return_to (String) —

    Return to URL The URL to which the browser should be redirected to after the logout has been performed.

Returns:

  • (Array<(LogoutFlow, Integer, Hash)>) —

    LogoutFlow data, response status code and response headers



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/ory-client/api/frontend_api.rb', line 120

def create_browser_logout_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_browser_logout_flow ...'
  end
  # resource path
  local_var_path = '/self-service/logout/browser'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LogoutFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_browser_logout_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_browser_logout_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_browser_recovery_flow(opts = {}) ⇒ RecoveryFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :skip_settings (String) —

    Skip redirection to the settings UI after the recovery flow was completed. Instead, the user will be redirected to the URL specified in `return_to` query parameter or the default return URL if `return_to` is not set.

Returns:



172
173
174
175
# File 'lib/ory-client/api/frontend_api.rb', line 172

def create_browser_recovery_flow(opts = {})
  data, _status_code, _headers = create_browser_recovery_flow_with_http_info(opts)
  data
end

#create_browser_recovery_flow_with_http_info(opts = {}) ⇒ Array<(RecoveryFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :skip_settings (String) —

    Skip redirection to the settings UI after the recovery flow was completed. Instead, the user will be redirected to the URL specified in `return_to` query parameter or the default return URL if `return_to` is not set.

Returns:

  • (Array<(RecoveryFlow, Integer, Hash)>) —

    RecoveryFlow data, response status code and response headers



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/ory-client/api/frontend_api.rb', line 183

def create_browser_recovery_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_browser_recovery_flow ...'
  end
  # resource path
  local_var_path = '/self-service/recovery/browser'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?
  query_params[:'skip_settings'] = opts[:'skip_settings'] if !opts[:'skip_settings'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RecoveryFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_browser_recovery_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_browser_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_browser_registration_flow(opts = {}) ⇒ RegistrationFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :login_challenge (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.

  • :after_verification_return_to (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.

  • :organization (String) —

    An optional organization ID that should be used to register this user. This parameter is only effective in the Ory Network.

  • :identity_schema (String) —

    An optional identity schema to use for the registration flow.

Returns:



238
239
240
241
# File 'lib/ory-client/api/frontend_api.rb', line 238

def create_browser_registration_flow(opts = {})
  data, _status_code, _headers = create_browser_registration_flow_with_http_info(opts)
  data
end

#create_browser_registration_flow_with_http_info(opts = {}) ⇒ Array<(RegistrationFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :login_challenge (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.

  • :after_verification_return_to (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.

  • :organization (String) —

    An optional organization ID that should be used to register this user. This parameter is only effective in the Ory Network.

  • :identity_schema (String) —

    An optional identity schema to use for the registration flow.

Returns:

  • (Array<(RegistrationFlow, Integer, Hash)>) —

    RegistrationFlow data, response status code and response headers



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/ory-client/api/frontend_api.rb', line 252

def create_browser_registration_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_browser_registration_flow ...'
  end
  # resource path
  local_var_path = '/self-service/registration/browser'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?
  query_params[:'login_challenge'] = opts[:'login_challenge'] if !opts[:'login_challenge'].nil?
  query_params[:'after_verification_return_to'] = opts[:'after_verification_return_to'] if !opts[:'after_verification_return_to'].nil?
  query_params[:'organization'] = opts[:'organization'] if !opts[:'organization'].nil?
  query_params[:'identity_schema'] = opts[:'identity_schema'] if !opts[:'identity_schema'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RegistrationFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_browser_registration_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_browser_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_browser_settings_flow(opts = {}) ⇒ SettingsFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

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

  • :organization (String) —

    An optional organization ID that scopes the settings flow to providers of that organization. This parameter is only effective in the Ory Network.

Returns:



308
309
310
311
# File 'lib/ory-client/api/frontend_api.rb', line 308

def create_browser_settings_flow(opts = {})
  data, _status_code, _headers = create_browser_settings_flow_with_http_info(opts)
  data
end

#create_browser_settings_flow_with_http_info(opts = {}) ⇒ Array<(SettingsFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

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

  • :organization (String) —

    An optional organization ID that scopes the settings flow to providers of that organization. This parameter is only effective in the Ory Network.

Returns:

  • (Array<(SettingsFlow, Integer, Hash)>) —

    SettingsFlow data, response status code and response headers



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/ory-client/api/frontend_api.rb', line 320

def create_browser_settings_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_browser_settings_flow ...'
  end
  # resource path
  local_var_path = '/self-service/settings/browser'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?
  query_params[:'organization'] = opts[:'organization'] if !opts[:'organization'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SettingsFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_browser_settings_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_browser_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_browser_verification_flow(opts = {}) ⇒ VerificationFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

Returns:



372
373
374
375
# File 'lib/ory-client/api/frontend_api.rb', line 372

def create_browser_verification_flow(opts = {})
  data, _status_code, _headers = create_browser_verification_flow_with_http_info(opts)
  data
end

#create_browser_verification_flow_with_http_info(opts = {}) ⇒ Array<(VerificationFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

Returns:

  • (Array<(VerificationFlow, Integer, Hash)>) —

    VerificationFlow data, response status code and response headers



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/ory-client/api/frontend_api.rb', line 382

def create_browser_verification_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_browser_verification_flow ...'
  end
  # resource path
  local_var_path = '/self-service/verification/browser'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VerificationFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_browser_verification_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_browser_verification_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_fedcm_flow(opts = {}) ⇒ CreateFedcmFlowResponse

Get FedCM Parameters This endpoint returns a list of all available FedCM providers. It is only supported on the Ory Network.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



431
432
433
434
# File 'lib/ory-client/api/frontend_api.rb', line 431

def create_fedcm_flow(opts = {})
  data, _status_code, _headers = create_fedcm_flow_with_http_info(opts)
  data
end

#create_fedcm_flow_with_http_info(opts = {}) ⇒ Array<(CreateFedcmFlowResponse, Integer, Hash)>

Get FedCM Parameters This endpoint returns a list of all available FedCM providers. It is only supported on the Ory Network.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(CreateFedcmFlowResponse, Integer, Hash)>) —

    CreateFedcmFlowResponse data, response status code and response headers



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/ory-client/api/frontend_api.rb', line 440

def create_fedcm_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_fedcm_flow ...'
  end
  # resource path
  local_var_path = '/self-service/fed-cm/parameters'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateFedcmFlowResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_fedcm_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_fedcm_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_id_p_initiated_saml_browser_login_flow(provider, code, opts = {}) ⇒ ErrorGeneric

Complete IdP-Initiated SAML Login for Browsers This endpoint is the entry point for IdP-initiated login through Ory Polis. Ory Polis redirects the browser here with a single-use authorization code after validating an unsolicited SAML response; Kratos then starts a regular browser login flow and forwards the code as a code_hint so Polis can complete the flow without a second round-trip to the identity provider. The provider must be a jackson provider with idp_initiated_login_enabled set to true in its configuration. This endpoint is NOT INTENDED for API clients and only works with browsers.

Parameters:

  • provider (String) —

    The SAML provider ID as configured in the Ory Kratos configuration.

  • code (String) —

    The single-use authorization code issued by Ory Polis for the unsolicited SAML response.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



490
491
492
493
# File 'lib/ory-client/api/frontend_api.rb', line 490

def (provider, code, opts = {})
  data, _status_code, _headers = (provider, code, opts)
  data
end

#create_id_p_initiated_saml_browser_login_flow_with_http_info(provider, code, opts = {}) ⇒ Array<(ErrorGeneric, Integer, Hash)>

Complete IdP-Initiated SAML Login for Browsers This endpoint is the entry point for IdP-initiated login through Ory Polis. Ory Polis redirects the browser here with a single-use authorization code after validating an unsolicited SAML response; Kratos then starts a regular browser login flow and forwards the code as a `code_hint` so Polis can complete the flow without a second round-trip to the identity provider. The provider must be a `jackson` provider with `idp_initiated_login_enabled` set to `true` in its configuration. This endpoint is NOT INTENDED for API clients and only works with browsers.

Parameters:

  • provider (String) —

    The SAML provider ID as configured in the Ory Kratos configuration.

  • code (String) —

    The single-use authorization code issued by Ory Polis for the unsolicited SAML response.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(ErrorGeneric, Integer, Hash)>) —

    ErrorGeneric data, response status code and response headers



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/ory-client/api/frontend_api.rb', line 501

def (provider, code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_id_p_initiated_saml_browser_login_flow ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling FrontendApi.create_id_p_initiated_saml_browser_login_flow"
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling FrontendApi.create_id_p_initiated_saml_browser_login_flow"
  end
  # resource path
  local_var_path = '/self-service/methods/saml/idp-initiated/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'code'] = code

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ErrorGeneric'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_id_p_initiated_saml_browser_login_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_id_p_initiated_saml_browser_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_native_login_flow(opts = {}) ⇒ LoginFlow

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. - session_aal2_enrollment_required: Second-factor auth is required but the identity has no second factor enrolled. Follow redirect_browser_to to the settings flow to enroll one. - 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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean) —

    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.

  • :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 &quot;upgrade&quot; the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to &quot;aal2&quot;.

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

  • :return_session_token_exchange_code (Boolean) —

    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.

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :organization (String) —

    An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network.

  • :via (String) —

    Via should contain the identity's credential the code should be sent to. Only relevant in aal2 flows. DEPRECATED: This field is deprecated. Please remove it from your requests. The user will now see a choice of MFA credentials to choose from to perform the second factor instead.

  • :identity_schema (String) —

    An optional identity schema to use for the login flow.

Returns:



566
567
568
569
# File 'lib/ory-client/api/frontend_api.rb', line 566

def (opts = {})
  data, _status_code, _headers = (opts)
  data
end

#create_native_login_flow_with_http_info(opts = {}) ⇒ Array<(LoginFlow, Integer, Hash)>

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. - `session_aal2_enrollment_required`: Second-factor auth is required but the identity has no second factor enrolled. Follow `redirect_browser_to` to the settings flow to enroll one. - `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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean) —

    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.

  • :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 &quot;upgrade&quot; the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to &quot;aal2&quot;.

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

  • :return_session_token_exchange_code (Boolean) —

    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.

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :organization (String) —

    An optional organization ID that should be used for logging this user in. This parameter is only effective in the Ory Network.

  • :via (String) —

    Via should contain the identity's credential the code should be sent to. Only relevant in aal2 flows. DEPRECATED: This field is deprecated. Please remove it from your requests. The user will now see a choice of MFA credentials to choose from to perform the second factor instead.

  • :identity_schema (String) —

    An optional identity schema to use for the login flow.

Returns:

  • (Array<(LoginFlow, Integer, Hash)>) —

    LoginFlow data, response status code and response headers



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
# File 'lib/ory-client/api/frontend_api.rb', line 583

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_native_login_flow ...'
  end
  # resource path
  local_var_path = '/self-service/login/api'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'refresh'] = opts[:'refresh'] if !opts[:'refresh'].nil?
  query_params[:'aal'] = opts[:'aal'] if !opts[:'aal'].nil?
  query_params[:'return_session_token_exchange_code'] = opts[:'return_session_token_exchange_code'] if !opts[:'return_session_token_exchange_code'].nil?
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?
  query_params[:'organization'] = opts[:'organization'] if !opts[:'organization'].nil?
  query_params[:'via'] = opts[:'via'] if !opts[:'via'].nil?
  query_params[:'identity_schema'] = opts[:'identity_schema'] if !opts[:'identity_schema'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoginFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_native_login_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_native_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_native_recovery_flow(opts = {}) ⇒ RecoveryFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



639
640
641
642
# File 'lib/ory-client/api/frontend_api.rb', line 639

def create_native_recovery_flow(opts = {})
  data, _status_code, _headers = create_native_recovery_flow_with_http_info(opts)
  data
end

#create_native_recovery_flow_with_http_info(opts = {}) ⇒ Array<(RecoveryFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(RecoveryFlow, Integer, Hash)>) —

    RecoveryFlow data, response status code and response headers



648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
# File 'lib/ory-client/api/frontend_api.rb', line 648

def create_native_recovery_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_native_recovery_flow ...'
  end
  # resource path
  local_var_path = '/self-service/recovery/api'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RecoveryFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_native_recovery_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_native_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_native_registration_flow(opts = {}) ⇒ RegistrationFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_session_token_exchange_code (Boolean) —

    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.

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :organization (String) —

    An optional organization ID that should be used to register this user. This parameter is only effective in the Ory Network.

  • :identity_schema (String) —

    An optional identity schema to use for the registration flow.

Returns:



700
701
702
703
# File 'lib/ory-client/api/frontend_api.rb', line 700

def create_native_registration_flow(opts = {})
  data, _status_code, _headers = create_native_registration_flow_with_http_info(opts)
  data
end

#create_native_registration_flow_with_http_info(opts = {}) ⇒ Array<(RegistrationFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_session_token_exchange_code (Boolean) —

    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.

  • :return_to (String) —

    The URL to return the browser to after the flow was completed.

  • :organization (String) —

    An optional organization ID that should be used to register this user. This parameter is only effective in the Ory Network.

  • :identity_schema (String) —

    An optional identity schema to use for the registration flow.

Returns:

  • (Array<(RegistrationFlow, Integer, Hash)>) —

    RegistrationFlow data, response status code and response headers



713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/ory-client/api/frontend_api.rb', line 713

def create_native_registration_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_native_registration_flow ...'
  end
  # resource path
  local_var_path = '/self-service/registration/api'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'return_session_token_exchange_code'] = opts[:'return_session_token_exchange_code'] if !opts[:'return_session_token_exchange_code'].nil?
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?
  query_params[:'organization'] = opts[:'organization'] if !opts[:'organization'].nil?
  query_params[:'identity_schema'] = opts[:'identity_schema'] if !opts[:'identity_schema'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RegistrationFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_native_registration_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_native_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_native_settings_flow(opts = {}) ⇒ SettingsFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

  • :organization (String) —

    An optional organization ID that scopes the settings flow to providers of that organization. This parameter is only effective in the Ory Network.

Returns:



767
768
769
770
# File 'lib/ory-client/api/frontend_api.rb', line 767

def create_native_settings_flow(opts = {})
  data, _status_code, _headers = create_native_settings_flow_with_http_info(opts)
  data
end

#create_native_settings_flow_with_http_info(opts = {}) ⇒ Array<(SettingsFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

  • :organization (String) —

    An optional organization ID that scopes the settings flow to providers of that organization. This parameter is only effective in the Ory Network.

Returns:

  • (Array<(SettingsFlow, Integer, Hash)>) —

    SettingsFlow data, response status code and response headers



778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# File 'lib/ory-client/api/frontend_api.rb', line 778

def create_native_settings_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_native_settings_flow ...'
  end
  # resource path
  local_var_path = '/self-service/settings/api'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'organization'] = opts[:'organization'] if !opts[:'organization'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SettingsFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_native_settings_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_native_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_native_verification_flow(opts = {}) ⇒ VerificationFlow

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    A URL contained in the return_to key of the verification flow. This piece of data has no effect on the actual logic of the flow and is purely informational.

Returns:



829
830
831
832
# File 'lib/ory-client/api/frontend_api.rb', line 829

def create_native_verification_flow(opts = {})
  data, _status_code, _headers = create_native_verification_flow_with_http_info(opts)
  data
end

#create_native_verification_flow_with_http_info(opts = {}) ⇒ Array<(VerificationFlow, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :return_to (String) —

    A URL contained in the return_to key of the verification flow. This piece of data has no effect on the actual logic of the flow and is purely informational.

Returns:

  • (Array<(VerificationFlow, Integer, Hash)>) —

    VerificationFlow data, response status code and response headers



839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
# File 'lib/ory-client/api/frontend_api.rb', line 839

def create_native_verification_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.create_native_verification_flow ...'
  end
  # resource path
  local_var_path = '/self-service/verification/api'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VerificationFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.create_native_verification_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#create_native_verification_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_test_login_flow(id, opts = {}) ⇒ nil

Delete a test OIDC login flow Deletes a dry-run OIDC test login flow. A flow whose debug payload has been captured requires the HMAC cookie set by the OIDC callback; a flow still in the initial choose-method state is deletable with just the flow ID (it carries no PII, and the admin may want to abandon it).

Parameters:

  • id (String) —

    ID of the test login flow to delete.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :cookie (String) —

    HTTP Cookies. A captured test flow requires the ory_kratos_test_flow cookie set by the OIDC callback; a flow still in the initial choose-method state does not.

Returns:

  • (nil)


890
891
892
893
# File 'lib/ory-client/api/frontend_api.rb', line 890

def (id, opts = {})
  (id, opts)
  nil
end

#delete_test_login_flow_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a test OIDC login flow Deletes a dry-run OIDC test login flow. A flow whose debug payload has been captured requires the HMAC cookie set by the OIDC callback; a flow still in the initial choose-method state is deletable with just the flow ID (it carries no PII, and the admin may want to abandon it).

Parameters:

  • id (String) —

    ID of the test login flow to delete.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :cookie (String) —

    HTTP Cookies. A captured test flow requires the ory_kratos_test_flow cookie set by the OIDC callback; a flow still in the initial choose-method state does not.

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/ory-client/api/frontend_api.rb', line 901

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.delete_test_login_flow ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.delete_test_login_flow"
  end
  # resource path
  local_var_path = '/self-service/login/test'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.delete_test_login_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#delete_test_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_my_other_sessions(opts = {}) ⇒ DeleteMySessionsCount

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

Returns:



957
958
959
960
# File 'lib/ory-client/api/frontend_api.rb', line 957

def disable_my_other_sessions(opts = {})
  data, _status_code, _headers = disable_my_other_sessions_with_http_info(opts)
  data
end

#disable_my_other_sessions_with_http_info(opts = {}) ⇒ Array<(DeleteMySessionsCount, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

Returns:

  • (Array<(DeleteMySessionsCount, Integer, Hash)>) —

    DeleteMySessionsCount data, response status code and response headers



968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'lib/ory-client/api/frontend_api.rb', line 968

def disable_my_other_sessions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.disable_my_other_sessions ...'
  end
  # resource path
  local_var_path = '/sessions'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteMySessionsCount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.disable_my_other_sessions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#disable_my_other_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_my_session(id, opts = {}) ⇒ nil

Disable one of my sessions Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.

Parameters:

  • id (String) —

    ID is the session's ID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

Returns:

  • (nil)


1021
1022
1023
1024
# File 'lib/ory-client/api/frontend_api.rb', line 1021

def disable_my_session(id, opts = {})
  disable_my_session_with_http_info(id, opts)
  nil
end

#disable_my_session_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Disable one of my sessions Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.

Parameters:

  • id (String) —

    ID is the session's ID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
# File 'lib/ory-client/api/frontend_api.rb', line 1033

def disable_my_session_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.disable_my_session ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.disable_my_session"
  end
  # resource path
  local_var_path = '/sessions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.disable_my_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#disable_my_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#exchange_session_token(init_code, return_to_code, opts = {}) ⇒ SuccessfulNativeLogin

Exchange Session Token

Parameters:

  • init_code (String) —

    The part of the code return when initializing the flow.

  • return_to_code (String) —

    The part of the code returned by the return_to URL.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1088
1089
1090
1091
# File 'lib/ory-client/api/frontend_api.rb', line 1088

def exchange_session_token(init_code, return_to_code, opts = {})
  data, _status_code, _headers = exchange_session_token_with_http_info(init_code, return_to_code, opts)
  data
end

#exchange_session_token_with_http_info(init_code, return_to_code, opts = {}) ⇒ Array<(SuccessfulNativeLogin, Integer, Hash)>

Exchange Session Token

Parameters:

  • init_code (String) —

    The part of the code return when initializing the flow.

  • return_to_code (String) —

    The part of the code returned by the return_to URL.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SuccessfulNativeLogin, Integer, Hash)>) —

    SuccessfulNativeLogin data, response status code and response headers



1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/ory-client/api/frontend_api.rb', line 1098

def exchange_session_token_with_http_info(init_code, return_to_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.exchange_session_token ...'
  end
  # verify the required parameter 'init_code' is set
  if @api_client.config.client_side_validation && init_code.nil?
    fail ArgumentError, "Missing the required parameter 'init_code' when calling FrontendApi.exchange_session_token"
  end
  # verify the required parameter 'return_to_code' is set
  if @api_client.config.client_side_validation && return_to_code.nil?
    fail ArgumentError, "Missing the required parameter 'return_to_code' when calling FrontendApi.exchange_session_token"
  end
  # resource path
  local_var_path = '/sessions/token-exchange'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'init_code'] = init_code
  query_params[:'return_to_code'] = return_to_code

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SuccessfulNativeLogin'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.exchange_session_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#exchange_session_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_flow_error(id, opts = {}) ⇒ FlowError

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.

Parameters:

  • id (String) —

    Error is the error's ID

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1157
1158
1159
1160
# File 'lib/ory-client/api/frontend_api.rb', line 1157

def get_flow_error(id, opts = {})
  data, _status_code, _headers = get_flow_error_with_http_info(id, opts)
  data
end

#get_flow_error_with_http_info(id, opts = {}) ⇒ Array<(FlowError, Integer, Hash)>

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.

Parameters:

  • id (String) —

    Error is the error's ID

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(FlowError, Integer, Hash)>) —

    FlowError data, response status code and response headers



1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
# File 'lib/ory-client/api/frontend_api.rb', line 1167

def get_flow_error_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_flow_error ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.get_flow_error"
  end
  # resource path
  local_var_path = '/self-service/errors'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FlowError'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_flow_error",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_flow_error\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_login_flow(id, opts = {}) ⇒ LoginFlow

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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:



1222
1223
1224
1225
# File 'lib/ory-client/api/frontend_api.rb', line 1222

def (id, opts = {})
  data, _status_code, _headers = (id, opts)
  data
end

#get_login_flow_with_http_info(id, opts = {}) ⇒ Array<(LoginFlow, Integer, Hash)>

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) 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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:

  • (Array<(LoginFlow, Integer, Hash)>) —

    LoginFlow data, response status code and response headers



1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# File 'lib/ory-client/api/frontend_api.rb', line 1233

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_login_flow ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.get_login_flow"
  end
  # resource path
  local_var_path = '/self-service/login/flows'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoginFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_login_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_recovery_flow(id, opts = {}) ⇒ RecoveryFlow

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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:



1289
1290
1291
1292
# File 'lib/ory-client/api/frontend_api.rb', line 1289

def get_recovery_flow(id, opts = {})
  data, _status_code, _headers = get_recovery_flow_with_http_info(id, opts)
  data
end

#get_recovery_flow_with_http_info(id, opts = {}) ⇒ Array<(RecoveryFlow, Integer, Hash)>

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) res.render('recovery', flow) }) ``` More information can be found at Ory Kratos Account Recovery Documentation.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:

  • (Array<(RecoveryFlow, Integer, Hash)>) —

    RecoveryFlow data, response status code and response headers



1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
# File 'lib/ory-client/api/frontend_api.rb', line 1300

def get_recovery_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_recovery_flow ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.get_recovery_flow"
  end
  # resource path
  local_var_path = '/self-service/recovery/flows'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RecoveryFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_recovery_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_registration_flow(id, opts = {}) ⇒ RegistrationFlow

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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:



1356
1357
1358
1359
# File 'lib/ory-client/api/frontend_api.rb', line 1356

def get_registration_flow(id, opts = {})
  data, _status_code, _headers = get_registration_flow_with_http_info(id, opts)
  data
end

#get_registration_flow_with_http_info(id, opts = {}) ⇒ Array<(RegistrationFlow, Integer, Hash)>

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) 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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:

  • (Array<(RegistrationFlow, Integer, Hash)>) —

    RegistrationFlow data, response status code and response headers



1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
# File 'lib/ory-client/api/frontend_api.rb', line 1367

def get_registration_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_registration_flow ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.get_registration_flow"
  end
  # resource path
  local_var_path = '/self-service/registration/flows'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RegistrationFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_registration_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_saml_metadata(opts = {}) ⇒ String

Get SAML SP Metadata This endpoint serves the per-project SAML Service Provider metadata document: the SP entity ID and certificates this Ory Network project presents to every SAML identity provider by default. It is a public, unauthenticated, cacheable endpoint and never contains a private key. By SAML SP convention, the returned entity ID is this endpoint's own URL. The native engine derives and uses it automatically as the default SP entity ID for every connection, so there is nothing to copy; share it with an identity provider administrator setting up SSO. A connection can present a different SP entity ID via sp_entity_id_override. This endpoint 404s if no native SAML connection has been configured for this project yet (no SP signing key exists to publish).

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (String)


1421
1422
1423
1424
# File 'lib/ory-client/api/frontend_api.rb', line 1421

def (opts = {})
  data, _status_code, _headers = (opts)
  data
end

#get_saml_metadata_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>

Get SAML SP Metadata This endpoint serves the per-project SAML Service Provider metadata document: the SP entity ID and certificates this Ory Network project presents to every SAML identity provider by default. It is a public, unauthenticated, cacheable endpoint and never contains a private key. By SAML SP convention, the returned entity ID is this endpoint's own URL. The native engine derives and uses it automatically as the default SP entity ID for every connection, so there is nothing to copy; share it with an identity provider administrator setting up SSO. A connection can present a different SP entity ID via `sp_entity_id_override`. This endpoint 404s if no native SAML connection has been configured for this project yet (no SP signing key exists to publish).

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>) —

    String data, response status code and response headers



1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
# File 'lib/ory-client/api/frontend_api.rb', line 1430

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_saml_metadata ...'
  end
  # resource path
  local_var_path = '/self-service/methods/saml/metadata'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_saml_metadata",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_saml_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_saml_provider_metadata(provider, opts = {}) ⇒ String

Get Per-Connection SAML SP Metadata This endpoint serves per-connection SAML Service Provider metadata: the identity and certificate a single native connection presents to its identity provider, including the connection's own Assertion Consumer Service (ACS) URL. It serves a document for any native connection; when the connection sets sp_entity_id_override the SP entity ID is that value, otherwise it is the project default. It 404s -- with the identical generic response -- for an unknown connection ID, a connection disabled by invalid configuration, and a non-native connection, which manages its SP identity out of band.

Parameters:

  • provider (String) —

    The SAML connection ID to get metadata for.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (String)


1479
1480
1481
1482
# File 'lib/ory-client/api/frontend_api.rb', line 1479

def (provider, opts = {})
  data, _status_code, _headers = (provider, opts)
  data
end

#get_saml_provider_metadata_with_http_info(provider, opts = {}) ⇒ Array<(String, Integer, Hash)>

Get Per-Connection SAML SP Metadata This endpoint serves per-connection SAML Service Provider metadata: the identity and certificate a single native connection presents to its identity provider, including the connection's own Assertion Consumer Service (ACS) URL. It serves a document for any native connection; when the connection sets `sp_entity_id_override` the SP entity ID is that value, otherwise it is the project default. It 404s -- with the identical generic response -- for an unknown connection ID, a connection disabled by invalid configuration, and a non-native connection, which manages its SP identity out of band.

Parameters:

  • provider (String) —

    The SAML connection ID to get metadata for.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>) —

    String data, response status code and response headers



1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
# File 'lib/ory-client/api/frontend_api.rb', line 1489

def (provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_saml_provider_metadata ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling FrontendApi.get_saml_provider_metadata"
  end
  # resource path
  local_var_path = '/self-service/methods/saml/metadata/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_saml_provider_metadata",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_saml_provider_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_settings_flow(id, opts = {}) ⇒ SettingsFlow

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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token When using the SDK in an app without a browser, please include the session token here.

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

Returns:



1544
1545
1546
1547
# File 'lib/ory-client/api/frontend_api.rb', line 1544

def get_settings_flow(id, opts = {})
  data, _status_code, _headers = get_settings_flow_with_http_info(id, opts)
  data
end

#get_settings_flow_with_http_info(id, opts = {}) ⇒ Array<(SettingsFlow, Integer, Hash)>

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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token When using the SDK in an app without a browser, please include the session token here.

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

Returns:

  • (Array<(SettingsFlow, Integer, Hash)>) —

    SettingsFlow data, response status code and response headers



1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
# File 'lib/ory-client/api/frontend_api.rb', line 1556

def get_settings_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_settings_flow ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.get_settings_flow"
  end
  # resource path
  local_var_path = '/self-service/settings/flows'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SettingsFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_settings_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_verification_flow(id, opts = {}) ⇒ VerificationFlow

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.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:



1613
1614
1615
1616
# File 'lib/ory-client/api/frontend_api.rb', line 1613

def get_verification_flow(id, opts = {})
  data, _status_code, _headers = get_verification_flow_with_http_info(id, opts)
  data
end

#get_verification_flow_with_http_info(id, opts = {}) ⇒ Array<(VerificationFlow, Integer, Hash)>

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) res.render('verification', flow) }) ``` More information can be found at Ory Kratos Email and Phone Verification Documentation.

Parameters:

  • 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`).

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:

  • (Array<(VerificationFlow, Integer, Hash)>) —

    VerificationFlow data, response status code and response headers



1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/ory-client/api/frontend_api.rb', line 1624

def get_verification_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_verification_flow ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FrontendApi.get_verification_flow"
  end
  # resource path
  local_var_path = '/self-service/verification/flows'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VerificationFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_verification_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_verification_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_web_authn_java_script(opts = {}) ⇒ String

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (String)


1678
1679
1680
1681
# File 'lib/ory-client/api/frontend_api.rb', line 1678

def get_web_authn_java_script(opts = {})
  data, _status_code, _headers = get_web_authn_java_script_with_http_info(opts)
  data
end

#get_web_authn_java_script_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>

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=&quot;https://public-kratos.example.org/.well-known/ory/webauthn.js&quot; type=&quot;script&quot; async /> ``` More information can be found at Ory Kratos User Login and User Registration Documentation.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>) —

    String data, response status code and response headers



1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
# File 'lib/ory-client/api/frontend_api.rb', line 1687

def get_web_authn_java_script_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_web_authn_java_script ...'
  end
  # resource path
  local_var_path = '/.well-known/ory/webauthn.js'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_web_authn_java_script",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_web_authn_java_script\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Get WebAuthn Related Origins This endpoint serves the WebAuthn Related Origin Requests document specified in https://www.w3.org/TR/webauthn-3/#sctn-related-origins. It lists the web origins allowed to use this domain as their WebAuthn relying party ID. Browsers fetch it when a page requests a relying party ID that does not match the page's own origin. The document contains the relying party origins configured for the enabled WebAuthn and passkey methods.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1735
1736
1737
1738
# File 'lib/ory-client/api/frontend_api.rb', line 1735

def get_web_authn_related_origins(opts = {})
  data, _status_code, _headers = get_web_authn_related_origins_with_http_info(opts)
  data
end

Get WebAuthn Related Origins This endpoint serves the WebAuthn Related Origin Requests document specified in https://www.w3.org/TR/webauthn-3/#sctn-related-origins. It lists the web origins allowed to use this domain as their WebAuthn relying party ID. Browsers fetch it when a page requests a relying party ID that does not match the page's own origin. The document contains the relying party origins configured for the enabled WebAuthn and passkey methods.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(WebAuthnRelatedOrigins, Integer, Hash)>) —

    WebAuthnRelatedOrigins data, response status code and response headers



1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
# File 'lib/ory-client/api/frontend_api.rb', line 1744

def get_web_authn_related_origins_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_web_authn_related_origins ...'
  end
  # resource path
  local_var_path = '/.well-known/webauthn'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'WebAuthnRelatedOrigins'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_web_authn_related_origins",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_web_authn_related_origins\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_well_known_change_password(opts = {}) ⇒ ErrorGeneric

Change Password URL This endpoint implements the W3C "change password URL" well-known location by redirecting the browser to the configured settings UI. Password managers follow this redirect to take users straight to the page where they can change their password.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1792
1793
1794
1795
# File 'lib/ory-client/api/frontend_api.rb', line 1792

def get_well_known_change_password(opts = {})
  data, _status_code, _headers = get_well_known_change_password_with_http_info(opts)
  data
end

#get_well_known_change_password_with_http_info(opts = {}) ⇒ Array<(ErrorGeneric, Integer, Hash)>

Change Password URL This endpoint implements the W3C &quot;change password URL&quot; well-known location by redirecting the browser to the configured settings UI. Password managers follow this redirect to take users straight to the page where they can change their password.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(ErrorGeneric, Integer, Hash)>) —

    ErrorGeneric data, response status code and response headers



1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
# File 'lib/ory-client/api/frontend_api.rb', line 1801

def get_well_known_change_password_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.get_well_known_change_password ...'
  end
  # resource path
  local_var_path = '/.well-known/change-password'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ErrorGeneric'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.get_well_known_change_password",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#get_well_known_change_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#init_saml_login(provider, flow, purpose, opts = {}) ⇒ String

Initiate Native SAML Sign-In This endpoint starts a native SP-initiated SAML sign-in for the given connection. It checks that the flow named by the flow query parameter exists as the kind named by purpose, builds a SAML AuthnRequest, and forwards the browser to the identity provider's Single Sign-On endpoint -- either with an HTTP 302 redirect (HTTP-Redirect binding) or by returning a self-submitting HTML form (HTTP-POST binding). A login, registration, or settings flow redirects here as a browser navigation once a SAML connection has been selected. This endpoint is NOT INTENDED to be called directly by API clients: it is a browser navigation target, not a JSON API.

Parameters:

  • provider (String) —

    The SAML connection ID to start a native SP-initiated sign-in for.

  • flow (String) —

    The Login, Registration, or Settings Flow ID this SAML sign-in continues.

  • purpose (String) —

    The kind of flow `flow` names: `login`, `registration`, or `settings-link` (a settings flow linking a new SAML credential). The flow must exist in the named kind, or the request is not found.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (String)


1852
1853
1854
1855
# File 'lib/ory-client/api/frontend_api.rb', line 1852

def (provider, flow, purpose, opts = {})
  data, _status_code, _headers = (provider, flow, purpose, opts)
  data
end

#init_saml_login_request(provider, flow, purpose, opts = {}) ⇒ String

Initiate Native SAML Sign-In (Direct POST) Identical to GET /self-service/methods/saml/init/{provider}, except the caller POSTs directly to this endpoint -- validated by the anti-CSRF middleware -- instead of being redirected here as a GET.

Parameters:

  • provider (String) —

    The SAML connection ID to start a native SP-initiated sign-in for.

  • flow (String) —

    The Login, Registration, or Settings Flow ID this SAML sign-in continues.

  • purpose (String) —

    The kind of flow `flow` names: `login`, `registration`, or `settings-link` (a settings flow linking a new SAML credential). The flow must exist in the named kind, or the request is not found.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (String)


1934
1935
1936
1937
# File 'lib/ory-client/api/frontend_api.rb', line 1934

def (provider, flow, purpose, opts = {})
  data, _status_code, _headers = (provider, flow, purpose, opts)
  data
end

#init_saml_login_request_with_http_info(provider, flow, purpose, opts = {}) ⇒ Array<(String, Integer, Hash)>

Initiate Native SAML Sign-In (Direct POST) Identical to `GET /self-service/methods/saml/init/provider`, except the caller POSTs directly to this endpoint -- validated by the anti-CSRF middleware -- instead of being redirected here as a GET.

Parameters:

  • provider (String) —

    The SAML connection ID to start a native SP-initiated sign-in for.

  • flow (String) —

    The Login, Registration, or Settings Flow ID this SAML sign-in continues.

  • purpose (String) —

    The kind of flow `flow` names: `login`, `registration`, or `settings-link` (a settings flow linking a new SAML credential). The flow must exist in the named kind, or the request is not found.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>) —

    String data, response status code and response headers



1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
# File 'lib/ory-client/api/frontend_api.rb', line 1946

def (provider, flow, purpose, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.init_saml_login_request ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling FrontendApi.init_saml_login_request"
  end
  # verify the required parameter 'flow' is set
  if @api_client.config.client_side_validation && flow.nil?
    fail ArgumentError, "Missing the required parameter 'flow' when calling FrontendApi.init_saml_login_request"
  end
  # verify the required parameter 'purpose' is set
  if @api_client.config.client_side_validation && purpose.nil?
    fail ArgumentError, "Missing the required parameter 'purpose' when calling FrontendApi.init_saml_login_request"
  end
  # verify enum value
  allowable_values = ["login", "registration", "settings-link"]
  if @api_client.config.client_side_validation && !allowable_values.include?(purpose)
    fail ArgumentError, "invalid value for \"purpose\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/self-service/methods/saml/init/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flow'] = flow
  query_params[:'purpose'] = purpose

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.init_saml_login_request",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#init_saml_login_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#init_saml_login_with_http_info(provider, flow, purpose, opts = {}) ⇒ Array<(String, Integer, Hash)>

Initiate Native SAML Sign-In This endpoint starts a native SP-initiated SAML sign-in for the given connection. It checks that the flow named by the `flow` query parameter exists as the kind named by `purpose`, builds a SAML AuthnRequest, and forwards the browser to the identity provider's Single Sign-On endpoint -- either with an HTTP 302 redirect (HTTP-Redirect binding) or by returning a self-submitting HTML form (HTTP-POST binding). A login, registration, or settings flow redirects here as a browser navigation once a SAML connection has been selected. This endpoint is NOT INTENDED to be called directly by API clients: it is a browser navigation target, not a JSON API.

Parameters:

  • provider (String) —

    The SAML connection ID to start a native SP-initiated sign-in for.

  • flow (String) —

    The Login, Registration, or Settings Flow ID this SAML sign-in continues.

  • purpose (String) —

    The kind of flow `flow` names: `login`, `registration`, or `settings-link` (a settings flow linking a new SAML credential). The flow must exist in the named kind, or the request is not found.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>) —

    String data, response status code and response headers



1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
# File 'lib/ory-client/api/frontend_api.rb', line 1864

def (provider, flow, purpose, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.init_saml_login ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling FrontendApi.init_saml_login"
  end
  # verify the required parameter 'flow' is set
  if @api_client.config.client_side_validation && flow.nil?
    fail ArgumentError, "Missing the required parameter 'flow' when calling FrontendApi.init_saml_login"
  end
  # verify the required parameter 'purpose' is set
  if @api_client.config.client_side_validation && purpose.nil?
    fail ArgumentError, "Missing the required parameter 'purpose' when calling FrontendApi.init_saml_login"
  end
  # verify enum value
  allowable_values = ["login", "registration", "settings-link"]
  if @api_client.config.client_side_validation && !allowable_values.include?(purpose)
    fail ArgumentError, "invalid value for \"purpose\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/self-service/methods/saml/init/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flow'] = flow
  query_params[:'purpose'] = purpose

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.init_saml_login",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#init_saml_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_my_sessions(opts = {}) ⇒ Array<Session>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :per_page (Integer) —

    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. (default to 250)

  • :page (Integer) —

    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.

  • :page_size (Integer) —

    Page Size This is the number of items per page to return. For details on pagination please head over to the pagination documentation. (default to 250)

  • :page_token (String) —

    Next Page Token The next page token. For details on pagination please head over to the pagination documentation.

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

Returns:



2019
2020
2021
2022
# File 'lib/ory-client/api/frontend_api.rb', line 2019

def list_my_sessions(opts = {})
  data, _status_code, _headers = list_my_sessions_with_http_info(opts)
  data
end

#list_my_sessions_with_http_info(opts = {}) ⇒ Array<(Array<Session>, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :per_page (Integer) —

    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. (default to 250)

  • :page (Integer) —

    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.

  • :page_size (Integer) —

    Page Size This is the number of items per page to return. For details on pagination please head over to the pagination documentation. (default to 250)

  • :page_token (String) —

    Next Page Token The next page token. For details on pagination please head over to the pagination documentation.

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

Returns:

  • (Array<(Array<Session>, Integer, Hash)>) —

    Array data, response status code and response headers



2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
# File 'lib/ory-client/api/frontend_api.rb', line 2034

def list_my_sessions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.list_my_sessions ...'
  end
  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling FrontendApi.list_my_sessions, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling FrontendApi.list_my_sessions, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FrontendApi.list_my_sessions, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FrontendApi.list_my_sessions, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/sessions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Session>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.list_my_sessions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#list_my_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#perform_native_logout(perform_native_logout_body, opts = {}) ⇒ nil

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.

Parameters:

Returns:

  • (nil)


2105
2106
2107
2108
# File 'lib/ory-client/api/frontend_api.rb', line 2105

def perform_native_logout(perform_native_logout_body, opts = {})
  perform_native_logout_with_http_info(perform_native_logout_body, opts)
  nil
end

#perform_native_logout_with_http_info(perform_native_logout_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

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.

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
# File 'lib/ory-client/api/frontend_api.rb', line 2115

def perform_native_logout_with_http_info(perform_native_logout_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.perform_native_logout ...'
  end
  # verify the required parameter 'perform_native_logout_body' is set
  if @api_client.config.client_side_validation && perform_native_logout_body.nil?
    fail ArgumentError, "Missing the required parameter 'perform_native_logout_body' when calling FrontendApi.perform_native_logout"
  end
  # resource path
  local_var_path = '/self-service/logout/api'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(perform_native_logout_body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.perform_native_logout",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#perform_native_logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_saml_assertion(provider, relay_state, saml_response, opts = {}) ⇒ ErrorGeneric

Native SAML Assertion Consumer Service (ACS) This is the Assertion Consumer Service (ACS) for the native SAML engine. The identity provider delivers its SAML Response here via the HTTP-POST binding, carrying the RelayState token that correlates it with the AuthnRequest issued by the init endpoint. On success the browser is redirected to complete the login, registration, or settings-link flow that started the sign-in. This endpoint is posted to directly by the identity provider's browser and is NOT INTENDED to be called by API clients. Every failure -- a replayed or unknown token, a malformed request, a provider mismatch, a response delivered to a browser other than the one that started the flow, or a signature/assertion validation failure -- is reported with the identical generic error, so the response body cannot be used to probe which check failed.

Parameters:

  • provider (String) —

    The SAML connection ID this assertion is delivered for.

  • relay_state (String) —

    The opaque token that correlates this response with the AuthnRequest issued by `POST /self-service/methods/saml/init/provider`. The PascalCase property name deliberately violates this API's snake_case convention: `RelayState` is the literal form-field name mandated by the SAML 2.0 HTTP-POST binding (OASIS SAML bindings spec), and every identity provider posts exactly this name. Do not rename it.

  • saml_response (String) —

    The base64-encoded, XML-serialized samlp:Response the identity provider produced for the AuthnRequest issued by `POST /self-service/methods/saml/init/provider`. The PascalCase property name deliberately violates this API's snake_case convention: `SAMLResponse` is the literal form-field name mandated by the SAML 2.0 HTTP-POST binding (OASIS SAML bindings spec), and every identity provider posts exactly this name. Do not rename it.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2175
2176
2177
2178
# File 'lib/ory-client/api/frontend_api.rb', line 2175

def submit_saml_assertion(provider, relay_state, saml_response, opts = {})
  data, _status_code, _headers = submit_saml_assertion_with_http_info(provider, relay_state, saml_response, opts)
  data
end

#submit_saml_assertion_with_http_info(provider, relay_state, saml_response, opts = {}) ⇒ Array<(ErrorGeneric, Integer, Hash)>

Native SAML Assertion Consumer Service (ACS) This is the Assertion Consumer Service (ACS) for the native SAML engine. The identity provider delivers its SAML Response here via the HTTP-POST binding, carrying the RelayState token that correlates it with the AuthnRequest issued by the init endpoint. On success the browser is redirected to complete the login, registration, or settings-link flow that started the sign-in. This endpoint is posted to directly by the identity provider's browser and is NOT INTENDED to be called by API clients. Every failure -- a replayed or unknown token, a malformed request, a provider mismatch, a response delivered to a browser other than the one that started the flow, or a signature/assertion validation failure -- is reported with the identical generic error, so the response body cannot be used to probe which check failed.

Parameters:

  • provider (String) —

    The SAML connection ID this assertion is delivered for.

  • relay_state (String) —

    The opaque token that correlates this response with the AuthnRequest issued by `POST /self-service/methods/saml/init/provider`. The PascalCase property name deliberately violates this API's snake_case convention: `RelayState` is the literal form-field name mandated by the SAML 2.0 HTTP-POST binding (OASIS SAML bindings spec), and every identity provider posts exactly this name. Do not rename it.

  • saml_response (String) —

    The base64-encoded, XML-serialized samlp:Response the identity provider produced for the AuthnRequest issued by `POST /self-service/methods/saml/init/provider`. The PascalCase property name deliberately violates this API's snake_case convention: `SAMLResponse` is the literal form-field name mandated by the SAML 2.0 HTTP-POST binding (OASIS SAML bindings spec), and every identity provider posts exactly this name. Do not rename it.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(ErrorGeneric, Integer, Hash)>) —

    ErrorGeneric data, response status code and response headers



2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
# File 'lib/ory-client/api/frontend_api.rb', line 2187

def submit_saml_assertion_with_http_info(provider, relay_state, saml_response, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.submit_saml_assertion ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling FrontendApi.submit_saml_assertion"
  end
  # verify the required parameter 'relay_state' is set
  if @api_client.config.client_side_validation && relay_state.nil?
    fail ArgumentError, "Missing the required parameter 'relay_state' when calling FrontendApi.submit_saml_assertion"
  end
  # verify the required parameter 'saml_response' is set
  if @api_client.config.client_side_validation && saml_response.nil?
    fail ArgumentError, "Missing the required parameter 'saml_response' when calling FrontendApi.submit_saml_assertion"
  end
  # resource path
  local_var_path = '/self-service/methods/saml/acs/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['RelayState'] = relay_state
  form_params['SAMLResponse'] = saml_response

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ErrorGeneric'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.submit_saml_assertion",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#submit_saml_assertion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#to_session(opts = {}) ⇒ Session

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. - session_aal2_enrollment_required: An active session was found but the required Authenticator Assurance Level can not be reached because the identity has no second factor enrolled. Follow redirect_browser_to to the settings flow to enroll one.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

  • :tokenize_as (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.

Returns:



2257
2258
2259
2260
# File 'lib/ory-client/api/frontend_api.rb', line 2257

def to_session(opts = {})
  data, _status_code, _headers = to_session_with_http_info(opts)
  data
end

#to_session_with_http_info(opts = {}) ⇒ Array<(Session, Integer, Hash)>

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(&quot;the-session-token&quot;) 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(&quot;the-session-token&quot;, { tokenize_as: &quot;example-jwt-template&quot; }) 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. - `session_aal2_enrollment_required`: An active session was found but the required Authenticator Assurance Level can not be reached because the identity has no second factor enrolled. Follow `redirect_browser_to` to the settings flow to enroll one.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    Set the Session Token when calling from non-browser clients. A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.

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

  • :tokenize_as (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.

Returns:

  • (Array<(Session, Integer, Hash)>) —

    Session data, response status code and response headers



2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
# File 'lib/ory-client/api/frontend_api.rb', line 2269

def to_session_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.to_session ...'
  end
  # resource path
  local_var_path = '/sessions/whoami'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'tokenize_as'] = opts[:'tokenize_as'] if !opts[:'tokenize_as'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Session'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.to_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#to_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_fedcm_flow(update_fedcm_flow_body, opts = {}) ⇒ SuccessfulNativeLogin

Submit a FedCM token Use this endpoint to submit a token from a FedCM provider through navigator.credentials.get and log the user in. The parameters from navigator.credentials.get must have come from GET self-service/fed-cm/parameters.

Parameters:

  • update_fedcm_flow_body (UpdateFedcmFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2321
2322
2323
2324
# File 'lib/ory-client/api/frontend_api.rb', line 2321

def update_fedcm_flow(update_fedcm_flow_body, opts = {})
  data, _status_code, _headers = update_fedcm_flow_with_http_info(update_fedcm_flow_body, opts)
  data
end

#update_fedcm_flow_with_http_info(update_fedcm_flow_body, opts = {}) ⇒ Array<(SuccessfulNativeLogin, Integer, Hash)>

Submit a FedCM token Use this endpoint to submit a token from a FedCM provider through `navigator.credentials.get` and log the user in. The parameters from `navigator.credentials.get` must have come from `GET self-service/fed-cm/parameters`.

Parameters:

  • update_fedcm_flow_body (UpdateFedcmFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SuccessfulNativeLogin, Integer, Hash)>) —

    SuccessfulNativeLogin data, response status code and response headers



2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
# File 'lib/ory-client/api/frontend_api.rb', line 2331

def update_fedcm_flow_with_http_info(update_fedcm_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.update_fedcm_flow ...'
  end
  # verify the required parameter 'update_fedcm_flow_body' is set
  if @api_client.config.client_side_validation && update_fedcm_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'update_fedcm_flow_body' when calling FrontendApi.update_fedcm_flow"
  end
  # resource path
  local_var_path = '/self-service/fed-cm/token'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_fedcm_flow_body)

  # return_type
  return_type = opts[:debug_return_type] || 'SuccessfulNativeLogin'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.update_fedcm_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#update_fedcm_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_login_flow(flow, update_login_flow_body, opts = {}) ⇒ SuccessfulNativeLogin

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.

Parameters:

  • 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`).

  • update_login_flow_body (UpdateLoginFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

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

Returns:



2392
2393
2394
2395
# File 'lib/ory-client/api/frontend_api.rb', line 2392

def (flow, , opts = {})
  data, _status_code, _headers = (flow, , opts)
  data
end

#update_login_flow_with_http_info(flow, update_login_flow_body, opts = {}) ⇒ Array<(SuccessfulNativeLogin, Integer, Hash)>

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.

Parameters:

  • 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`).

  • update_login_flow_body (UpdateLoginFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

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

Returns:

  • (Array<(SuccessfulNativeLogin, Integer, Hash)>) —

    SuccessfulNativeLogin data, response status code and response headers



2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
# File 'lib/ory-client/api/frontend_api.rb', line 2405

def (flow, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.update_login_flow ...'
  end
  # verify the required parameter 'flow' is set
  if @api_client.config.client_side_validation && flow.nil?
    fail ArgumentError, "Missing the required parameter 'flow' when calling FrontendApi.update_login_flow"
  end
  # verify the required parameter 'update_login_flow_body' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'update_login_flow_body' when calling FrontendApi.update_login_flow"
  end
  # resource path
  local_var_path = '/self-service/login'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flow'] = flow

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'SuccessfulNativeLogin'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.update_login_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#update_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_logout_flow(opts = {}) ⇒ nil

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

  • :return_to (String) —

    The URL to return to after the logout was completed.

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

Returns:

  • (nil)


2472
2473
2474
2475
# File 'lib/ory-client/api/frontend_api.rb', line 2472

def update_logout_flow(opts = {})
  update_logout_flow_with_http_info(opts)
  nil
end

#update_logout_flow_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

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.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

  • :return_to (String) —

    The URL to return to after the logout was completed.

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

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
# File 'lib/ory-client/api/frontend_api.rb', line 2484

def update_logout_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.update_logout_flow ...'
  end
  # resource path
  local_var_path = '/self-service/logout'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
  query_params[:'return_to'] = opts[:'return_to'] if !opts[:'return_to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.update_logout_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#update_logout_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_recovery_flow(flow, update_recovery_flow_body, opts = {}) ⇒ RecoveryFlow

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.

Parameters:

  • 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`).

  • update_recovery_flow_body (UpdateRecoveryFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

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

Returns:



2539
2540
2541
2542
# File 'lib/ory-client/api/frontend_api.rb', line 2539

def update_recovery_flow(flow, update_recovery_flow_body, opts = {})
  data, _status_code, _headers = update_recovery_flow_with_http_info(flow, update_recovery_flow_body, opts)
  data
end

#update_recovery_flow_with_http_info(flow, update_recovery_flow_body, opts = {}) ⇒ Array<(RecoveryFlow, Integer, Hash)>

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 (&quot;sending a recovery link&quot;) 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.

Parameters:

  • 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`).

  • update_recovery_flow_body (UpdateRecoveryFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

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

Returns:

  • (Array<(RecoveryFlow, Integer, Hash)>) —

    RecoveryFlow data, response status code and response headers



2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
# File 'lib/ory-client/api/frontend_api.rb', line 2552

def update_recovery_flow_with_http_info(flow, update_recovery_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.update_recovery_flow ...'
  end
  # verify the required parameter 'flow' is set
  if @api_client.config.client_side_validation && flow.nil?
    fail ArgumentError, "Missing the required parameter 'flow' when calling FrontendApi.update_recovery_flow"
  end
  # verify the required parameter 'update_recovery_flow_body' is set
  if @api_client.config.client_side_validation && update_recovery_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'update_recovery_flow_body' when calling FrontendApi.update_recovery_flow"
  end
  # resource path
  local_var_path = '/self-service/recovery'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flow'] = flow
  query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_recovery_flow_body)

  # return_type
  return_type = opts[:debug_return_type] || 'RecoveryFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.update_recovery_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#update_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_registration_flow(flow, update_registration_flow_body, opts = {}) ⇒ SuccessfulNativeRegistration

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.

Parameters:

  • 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`).

  • update_registration_flow_body (UpdateRegistrationFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:



2619
2620
2621
2622
# File 'lib/ory-client/api/frontend_api.rb', line 2619

def update_registration_flow(flow, update_registration_flow_body, opts = {})
  data, _status_code, _headers = update_registration_flow_with_http_info(flow, update_registration_flow_body, opts)
  data
end

#update_registration_flow_with_http_info(flow, update_registration_flow_body, opts = {}) ⇒ Array<(SuccessfulNativeRegistration, Integer, Hash)>

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.

Parameters:

  • 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`).

  • update_registration_flow_body (UpdateRegistrationFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

Returns:



2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
# File 'lib/ory-client/api/frontend_api.rb', line 2631

def update_registration_flow_with_http_info(flow, update_registration_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.update_registration_flow ...'
  end
  # verify the required parameter 'flow' is set
  if @api_client.config.client_side_validation && flow.nil?
    fail ArgumentError, "Missing the required parameter 'flow' when calling FrontendApi.update_registration_flow"
  end
  # verify the required parameter 'update_registration_flow_body' is set
  if @api_client.config.client_side_validation && update_registration_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'update_registration_flow_body' when calling FrontendApi.update_registration_flow"
  end
  # resource path
  local_var_path = '/self-service/registration'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flow'] = flow

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_registration_flow_body)

  # return_type
  return_type = opts[:debug_return_type] || 'SuccessfulNativeRegistration'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.update_registration_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#update_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_settings_flow(flow, update_settings_flow_body, opts = {}) ⇒ SettingsFlow

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.

Parameters:

  • 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`).

  • update_settings_flow_body (UpdateSettingsFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

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

Returns:



2698
2699
2700
2701
# File 'lib/ory-client/api/frontend_api.rb', line 2698

def update_settings_flow(flow, update_settings_flow_body, opts = {})
  data, _status_code, _headers = update_settings_flow_with_http_info(flow, update_settings_flow_body, opts)
  data
end

#update_settings_flow_with_http_info(flow, update_settings_flow_body, opts = {}) ⇒ Array<(SettingsFlow, Integer, Hash)>

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.

Parameters:

  • 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`).

  • update_settings_flow_body (UpdateSettingsFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :x_session_token (String) —

    The Session Token of the Identity performing the settings flow.

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

Returns:

  • (Array<(SettingsFlow, Integer, Hash)>) —

    SettingsFlow data, response status code and response headers



2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
# File 'lib/ory-client/api/frontend_api.rb', line 2711

def update_settings_flow_with_http_info(flow, update_settings_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.update_settings_flow ...'
  end
  # verify the required parameter 'flow' is set
  if @api_client.config.client_side_validation && flow.nil?
    fail ArgumentError, "Missing the required parameter 'flow' when calling FrontendApi.update_settings_flow"
  end
  # verify the required parameter 'update_settings_flow_body' is set
  if @api_client.config.client_side_validation && update_settings_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'update_settings_flow_body' when calling FrontendApi.update_settings_flow"
  end
  # resource path
  local_var_path = '/self-service/settings'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flow'] = flow

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_settings_flow_body)

  # return_type
  return_type = opts[:debug_return_type] || 'SettingsFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.update_settings_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#update_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_verification_flow(flow, update_verification_flow_body, opts = {}) ⇒ VerificationFlow

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.

Parameters:

  • 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`).

  • update_verification_flow_body (UpdateVerificationFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

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

Returns:



2779
2780
2781
2782
# File 'lib/ory-client/api/frontend_api.rb', line 2779

def update_verification_flow(flow, update_verification_flow_body, opts = {})
  data, _status_code, _headers = update_verification_flow_with_http_info(flow, update_verification_flow_body, opts)
  data
end

#update_verification_flow_with_http_info(flow, update_verification_flow_body, opts = {}) ⇒ Array<(VerificationFlow, Integer, Hash)>

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 (&quot;sending a verification link&quot;) 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.

Parameters:

  • 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`).

  • update_verification_flow_body (UpdateVerificationFlowBody)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

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

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

Returns:

  • (Array<(VerificationFlow, Integer, Hash)>) —

    VerificationFlow data, response status code and response headers



2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
# File 'lib/ory-client/api/frontend_api.rb', line 2792

def update_verification_flow_with_http_info(flow, update_verification_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FrontendApi.update_verification_flow ...'
  end
  # verify the required parameter 'flow' is set
  if @api_client.config.client_side_validation && flow.nil?
    fail ArgumentError, "Missing the required parameter 'flow' when calling FrontendApi.update_verification_flow"
  end
  # verify the required parameter 'update_verification_flow_body' is set
  if @api_client.config.client_side_validation && update_verification_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'update_verification_flow_body' when calling FrontendApi.update_verification_flow"
  end
  # resource path
  local_var_path = '/self-service/verification'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flow'] = flow
  query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_verification_flow_body)

  # return_type
  return_type = opts[:debug_return_type] || 'VerificationFlow'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"FrontendApi.update_verification_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FrontendApi#update_verification_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end