Class: OryClient::V0alpha2Api

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ V0alpha2Api

Returns a new instance of V0alpha2Api.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

#admin_create_identity(opts = {}) ⇒ Identity

Create an Identity This endpoint creates an identity. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



27
28
29
30
# File 'lib/ory-client/api/v0alpha2_api.rb', line 27

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

#admin_create_identity_with_http_info(opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Create an Identity This endpoint creates an identity. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Identity, Integer, Hash)>)

    Identity data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 37

def admin_create_identity_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_create_identity ...'
  end
  # resource path
  local_var_path = '/admin/identities'

  # 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'])
  # 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(opts[:'admin_create_identity_body'])

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_create_identity",
    :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: V0alpha2Api#admin_create_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a Recovery Link This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



91
92
93
94
# File 'lib/ory-client/api/v0alpha2_api.rb', line 91

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

Create a Recovery Link This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(SelfServiceRecoveryLink, Integer, Hash)>)

    SelfServiceRecoveryLink data, response status code and response headers



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 101

def admin_create_self_service_recovery_link_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_create_self_service_recovery_link ...'
  end
  # resource path
  local_var_path = '/admin/recovery/link'

  # 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'])
  # 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(opts[:'admin_create_self_service_recovery_link_body'])

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_create_self_service_recovery_link",
    :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: V0alpha2Api#admin_create_self_service_recovery_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete an Identity Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

  • (nil)


155
156
157
158
# File 'lib/ory-client/api/v0alpha2_api.rb', line 155

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

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

Calling this endpoint irrecoverably and permanently deletes and invalidates all sessions that belong to the given Identity. This endpoint is useful for: To forcefully logout Identity from all devices and sessions

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

  • (nil)


218
219
220
221
# File 'lib/ory-client/api/v0alpha2_api.rb', line 218

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

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

Calling this endpoint irrecoverably and permanently deletes and invalidates all sessions that belong to the given Identity. This endpoint is useful for: To forcefully logout Identity from all devices and sessions

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/ory-client/api/v0alpha2_api.rb', line 228

def admin_delete_identity_sessions_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_delete_identity_sessions ...'
  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 V0alpha2Api.admin_delete_identity_sessions"
  end
  # resource path
  local_var_path = '/admin/identities/{id}/sessions'.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'])

  # 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] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_delete_identity_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: V0alpha2Api#admin_delete_identity_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete an Identity Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 165

def admin_delete_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_delete_identity ...'
  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 V0alpha2Api.admin_delete_identity"
  end
  # resource path
  local_var_path = '/admin/identities/{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'])

  # 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] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_delete_identity",
    :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: V0alpha2Api#admin_delete_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_extend_session(id, opts = {}) ⇒ Session

Calling this endpoint extends the given session ID. If `session.earliest_possible_extend` is set it will only extend the session after the specified time has passed. Retrieve the session ID from the `/sessions/whoami` endpoint / `toSession` SDK method.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:



281
282
283
284
# File 'lib/ory-client/api/v0alpha2_api.rb', line 281

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

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

Calling this endpoint extends the given session ID. If &#x60;session.earliest_possible_extend&#x60; is set it will only extend the session after the specified time has passed. Retrieve the session ID from the &#x60;/sessions/whoami&#x60; endpoint / &#x60;toSession&#x60; SDK method.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:

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

    Session data, response status code and response headers



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/ory-client/api/v0alpha2_api.rb', line 291

def admin_extend_session_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_extend_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 V0alpha2Api.admin_extend_session"
  end
  # resource path
  local_var_path = '/admin/sessions/{id}/extend'.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'])

  # 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] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_extend_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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V0alpha2Api#admin_extend_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_get_identity(id, opts = {}) ⇒ Identity

Get an Identity Learn how identities work in [Ory Kratos' User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to get

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

    the optional parameters

Options Hash (opts):

  • :include_credential (Array<String>)

    DeclassifyCredentials will declassify one or more identity&#39;s credentials Currently, only &#x60;oidc&#x60; is supported. This will return the initial OAuth 2.0 Access, Refresh and (optionally) OpenID Connect ID Token.

Returns:



345
346
347
348
# File 'lib/ory-client/api/v0alpha2_api.rb', line 345

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

#admin_get_identity_with_http_info(id, opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Get an Identity Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to get

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

    the optional parameters

Options Hash (opts):

  • :include_credential (Array<String>)

    DeclassifyCredentials will declassify one or more identity&#39;s credentials Currently, only &#x60;oidc&#x60; is supported. This will return the initial OAuth 2.0 Access, Refresh and (optionally) OpenID Connect ID Token.

Returns:

  • (Array<(Identity, Integer, Hash)>)

    Identity data, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/ory-client/api/v0alpha2_api.rb', line 356

def admin_get_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_get_identity ...'
  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 V0alpha2Api.admin_get_identity"
  end
  # resource path
  local_var_path = '/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_credential'] = @api_client.build_collection_param(opts[:'include_credential'], :multi) if !opts[:'include_credential'].nil?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_get_identity",
    :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: V0alpha2Api#admin_get_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_list_identities(opts = {}) ⇒ Array<Identity>

List Identities Lists all identities. Does not support search at the moment. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

Returns:



411
412
413
414
# File 'lib/ory-client/api/v0alpha2_api.rb', line 411

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

#admin_list_identities_with_http_info(opts = {}) ⇒ Array<(Array<Identity>, Integer, Hash)>

List Identities Lists all identities. Does not support search at the moment. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

Returns:

  • (Array<(Array<Identity>, Integer, Hash)>)

    Array<Identity> data, response status code and response headers



422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 422

def admin_list_identities_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_list_identities ...'
  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 V0alpha2Api.admin_list_identities, 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 V0alpha2Api.admin_list_identities, must be greater than or equal to 1.'
  end

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

  # resource path
  local_var_path = '/admin/identities'

  # 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?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_list_identities",
    :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: V0alpha2Api#admin_list_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_list_identity_sessions(id, opts = {}) ⇒ Array<Session>

This endpoint returns all sessions that belong to the given Identity. This endpoint is useful for: Listing all sessions that belong to an Identity in an administrative context.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

  • :active (Boolean)

    Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned.

Returns:



488
489
490
491
# File 'lib/ory-client/api/v0alpha2_api.rb', line 488

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

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

This endpoint returns all sessions that belong to the given Identity. This endpoint is useful for: Listing all sessions that belong to an Identity in an administrative context.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

  • :active (Boolean)

    Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned.

Returns:

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

    Array<Session> 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
553
554
555
556
557
558
559
560
561
562
# File 'lib/ory-client/api/v0alpha2_api.rb', line 501

def admin_list_identity_sessions_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_list_identity_sessions ...'
  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 V0alpha2Api.admin_list_identity_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 V0alpha2Api.admin_list_identity_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 V0alpha2Api.admin_list_identity_sessions, must be greater than or equal to 1.'
  end

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

  # resource path
  local_var_path = '/admin/identities/{id}/sessions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # 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[:'active'] = opts[:'active'] if !opts[:'active'].nil?

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

  # 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] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_list_identity_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: V0alpha2Api#admin_list_identity_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_patch_identity(id, opts = {}) ⇒ Identity

Partially updates an Identity's field using [JSON Patch](jsonpatch.com/) NOTE: The fields `id`, `stateChangedAt` and `credentials` are not updateable. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:



570
571
572
573
# File 'lib/ory-client/api/v0alpha2_api.rb', line 570

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

#admin_patch_identity_with_http_info(id, opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Partially updates an Identity&#39;s field using [JSON Patch](jsonpatch.com/) NOTE: The fields &#x60;id&#x60;, &#x60;stateChangedAt&#x60; and &#x60;credentials&#x60; are not updateable. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Identity, Integer, Hash)>)

    Identity data, response status code and response headers



581
582
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 581

def admin_patch_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_patch_identity ...'
  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 V0alpha2Api.admin_patch_identity"
  end
  # resource path
  local_var_path = '/admin/identities/{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'])
  # 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(opts[:'json_patch'])

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_patch_identity",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V0alpha2Api#admin_patch_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_update_identity(id, opts = {}) ⇒ Identity

Update an Identity This endpoint updates an identity. The full identity payload (except credentials) is expected. This endpoint does not support patching. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:



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

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

#admin_update_identity_with_http_info(id, opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Update an Identity This endpoint updates an identity. The full identity payload (except credentials) is expected. This endpoint does not support patching. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](www.ory.sh/docs/next/kratos/concepts/identity-user-model).

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Identity, Integer, Hash)>)

    Identity data, response status code and response headers



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
691
692
693
694
695
696
697
698
699
700
701
702
# File 'lib/ory-client/api/v0alpha2_api.rb', line 651

def admin_update_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_update_identity ...'
  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 V0alpha2Api.admin_update_identity"
  end
  # resource path
  local_var_path = '/admin/identities/{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'])
  # 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(opts[:'admin_update_identity_body'])

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.admin_update_identity",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V0alpha2Api#admin_update_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_project(opts = {}) ⇒ Project

Create a Project Creates a new project.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



709
710
711
712
# File 'lib/ory-client/api/v0alpha2_api.rb', line 709

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

#create_project_with_http_info(opts = {}) ⇒ Array<(Project, Integer, Hash)>

Create a Project Creates a new project.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Project, Integer, Hash)>)

    Project data, response status code and response headers



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
760
761
762
763
764
765
766
# File 'lib/ory-client/api/v0alpha2_api.rb', line 719

def create_project_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.create_project ...'
  end
  # resource path
  local_var_path = '/projects'

  # 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'])
  # 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(opts[:'create_project_body'])

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.create_project",
    :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: V0alpha2Api#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_self_service_logout_flow_url_for_browsers(opts = {}) ⇒ SelfServiceLogoutUrl

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.

Returns:



773
774
775
776
# File 'lib/ory-client/api/v0alpha2_api.rb', line 773

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

#create_self_service_logout_flow_url_for_browsers_with_http_info(opts = {}) ⇒ Array<(SelfServiceLogoutUrl, 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 &#x60;/self-service/logout/api&#x60; 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.

Returns:

  • (Array<(SelfServiceLogoutUrl, Integer, Hash)>)

    SelfServiceLogoutUrl data, response status code and response headers



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
823
824
825
826
# File 'lib/ory-client/api/v0alpha2_api.rb', line 783

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

  # 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'])
  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] || 'SelfServiceLogoutUrl'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.create_self_service_logout_flow_url_for_browsers",
    :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: V0alpha2Api#create_self_service_logout_flow_url_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_identity_schema(id, opts = {}) ⇒ IdentitySchema

Get a JSON Schema

Parameters:

  • id (String)

    ID must be set to the ID of schema you want to get

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

    the optional parameters

Returns:



832
833
834
835
# File 'lib/ory-client/api/v0alpha2_api.rb', line 832

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

#get_identity_schema_with_http_info(id, opts = {}) ⇒ Array<(IdentitySchema, Integer, Hash)>

Get a JSON Schema

Parameters:

  • id (String)

    ID must be set to the ID of schema you want to get

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

    the optional parameters

Returns:

  • (Array<(IdentitySchema, Integer, Hash)>)

    IdentitySchema data, response status code and response headers



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
883
884
885
886
887
# File 'lib/ory-client/api/v0alpha2_api.rb', line 841

def get_identity_schema_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_identity_schema ...'
  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 V0alpha2Api.get_identity_schema"
  end
  # resource path
  local_var_path = '/schemas/{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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_identity_schema",
    :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: V0alpha2Api#get_identity_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project(project_id, opts = {}) ⇒ Project

Get a Project Get a projects you have access to by its ID.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Returns:



894
895
896
897
# File 'lib/ory-client/api/v0alpha2_api.rb', line 894

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

#get_project_members(project_id, opts = {}) ⇒ Array<CloudAccount>

Get all members associated with this project. This endpoint requires the user to be a member of the project with the role `OWNER` or `DEVELOPER`.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Returns:



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

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

#get_project_members_with_http_info(project_id, opts = {}) ⇒ Array<(Array<CloudAccount>, Integer, Hash)>

Get all members associated with this project. This endpoint requires the user to be a member of the project with the role &#x60;OWNER&#x60; or &#x60;DEVELOPER&#x60;.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Returns:

  • (Array<(Array<CloudAccount>, Integer, Hash)>)

    Array<CloudAccount> data, response status code and response headers



967
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
1013
# File 'lib/ory-client/api/v0alpha2_api.rb', line 967

def get_project_members_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_project_members ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling V0alpha2Api.get_project_members"
  end
  # resource path
  local_var_path = '/projects/{project_id}/members'.sub('{' + 'project_id' + '}', CGI.escape(project_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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_project_members",
    :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: V0alpha2Api#get_project_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project_with_http_info(project_id, opts = {}) ⇒ Array<(Project, Integer, Hash)>

Get a Project Get a projects you have access to by its ID.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Returns:

  • (Array<(Project, Integer, Hash)>)

    Project data, response status code and response headers



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
950
# File 'lib/ory-client/api/v0alpha2_api.rb', line 904

def get_project_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling V0alpha2Api.get_project"
  end
  # resource path
  local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_project",
    :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: V0alpha2Api#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_self_service_error(id, opts = {}) ⇒ SelfServiceError

Get Self-Service 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](www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).

Parameters:

  • id (String)

    Error is the error&#39;s ID

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

    the optional parameters

Returns:



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

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

#get_self_service_error_with_http_info(id, opts = {}) ⇒ Array<(SelfServiceError, Integer, Hash)>

Get Self-Service 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: &#x60;?id&#x3D;stub:500&#x60; - returns a stub 500 (Internal Server Error) error. More information can be found at [Ory Kratos User User Facing Error Documentation](www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).

Parameters:

  • id (String)

    Error is the error&#39;s ID

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

    the optional parameters

Returns:

  • (Array<(SelfServiceError, Integer, Hash)>)

    SelfServiceError data, response status code and response headers



1030
1031
1032
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1030

def get_self_service_error_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_self_service_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 V0alpha2Api.get_self_service_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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_self_service_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: V0alpha2Api#get_self_service_error\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_self_service_login_flow(id, opts = {}) ⇒ SelfServiceLoginFlow

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.getSelfServiceLoginFlow(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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • id (String)

    The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).

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



1085
1086
1087
1088
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1085

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

#get_self_service_login_flow_with_http_info(id, opts = {}) ⇒ Array<(SelfServiceLoginFlow, Integer, Hash)>

Get Login Flow This endpoint returns a login flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;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: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/login&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceLoginFlow(req.header(&#39;cookie&#39;), req.query) res.render(&#39;login&#39;, flow) }) &#x60;&#x60;&#x60; This request may fail due to several reasons. The &#x60;error.id&#x60; can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;self_service_flow_expired&#x60;: The flow is expired and you should request a new one. More information can be found at [Ory Kratos User Login](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • id (String)

    The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).

  • 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<(SelfServiceLoginFlow, Integer, Hash)>)

    SelfServiceLoginFlow data, response status code and response headers



1096
1097
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1096

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_self_service_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 V0alpha2Api.get_self_service_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'])
  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] || 'SelfServiceLoginFlow'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_self_service_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: V0alpha2Api#get_self_service_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_self_service_recovery_flow(id, opts = {}) ⇒ SelfServiceRecoveryFlow

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.getSelfServiceRecoveryFlow(req.header('Cookie'), req.query) res.render('recovery', flow) }) “` More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery).

Parameters:

  • id (String)

    The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).

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



1152
1153
1154
1155
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1152

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

#get_self_service_recovery_flow_with_http_info(id, opts = {}) ⇒ Array<(SelfServiceRecoveryFlow, Integer, Hash)>

Get Recovery Flow This endpoint returns a recovery flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;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: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/recovery&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceRecoveryFlow(req.header(&#39;Cookie&#39;), req.query) res.render(&#39;recovery&#39;, flow) }) &#x60;&#x60;&#x60; More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery).

Parameters:

  • id (String)

    The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).

  • 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<(SelfServiceRecoveryFlow, Integer, Hash)>)

    SelfServiceRecoveryFlow data, response status code and response headers



1163
1164
1165
1166
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1163

def get_self_service_recovery_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_self_service_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 V0alpha2Api.get_self_service_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'])
  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] || 'SelfServiceRecoveryFlow'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_self_service_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: V0alpha2Api#get_self_service_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_self_service_registration_flow(id, opts = {}) ⇒ SelfServiceRegistrationFlow

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.getSelfServiceRegistrationFlow(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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • id (String)

    The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).

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



1219
1220
1221
1222
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1219

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

#get_self_service_registration_flow_with_http_info(id, opts = {}) ⇒ Array<(SelfServiceRegistrationFlow, Integer, Hash)>

Get Registration Flow This endpoint returns a registration flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;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: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/registration&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceRegistrationFlow(req.header(&#39;cookie&#39;), req.query) res.render(&#39;registration&#39;, flow) }) &#x60;&#x60;&#x60; This request may fail due to several reasons. The &#x60;error.id&#x60; can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;self_service_flow_expired&#x60;: The flow is expired and you should request a new one. More information can be found at [Ory Kratos User Login](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • id (String)

    The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).

  • 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<(SelfServiceRegistrationFlow, Integer, Hash)>)

    SelfServiceRegistrationFlow data, response status code and response headers



1230
1231
1232
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1230

def get_self_service_registration_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_self_service_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 V0alpha2Api.get_self_service_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'])
  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] || 'SelfServiceRegistrationFlow'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_self_service_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: V0alpha2Api#get_self_service_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_self_service_settings_flow(id, opts = {}) ⇒ SelfServiceSettingsFlow

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](../self-service/flows/user-settings).

Parameters:

  • id (String)

    ID is the Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).

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



1287
1288
1289
1290
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1287

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

#get_self_service_settings_flow_with_http_info(id, opts = {}) ⇒ Array<(SelfServiceSettingsFlow, Integer, Hash)>

Get Settings Flow When accessing this endpoint through Ory Kratos&#39; 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&#39; 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 &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;session_inactive&#x60;: No Ory Session was found - sign in a user first. &#x60;security_identity_mismatch&#x60;: The flow was interrupted with &#x60;session_refresh_required&#x60; but apparently some other identity logged in instead. More information can be found at [Ory Kratos User Settings &amp; Profile Management Documentation](../self-service/flows/user-settings).

Parameters:

  • id (String)

    ID is the Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).

  • 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<(SelfServiceSettingsFlow, Integer, Hash)>)

    SelfServiceSettingsFlow data, response status code and response headers



1299
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/v0alpha2_api.rb', line 1299

def get_self_service_settings_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_self_service_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 V0alpha2Api.get_self_service_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'])
  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] || 'SelfServiceSettingsFlow'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_self_service_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: V0alpha2Api#get_self_service_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_self_service_verification_flow(id, opts = {}) ⇒ SelfServiceVerificationFlow

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.getSelfServiceVerificationFlow(req.header('cookie'), req.query) res.render('verification', flow) }) More information can be found at [Ory Kratos Email and Phone Verification Documentation](www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).

Parameters:

  • id (String)

    The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).

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



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

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

#get_self_service_verification_flow_with_http_info(id, opts = {}) ⇒ Array<(SelfServiceVerificationFlow, Integer, Hash)>

Get Verification Flow This endpoint returns a verification flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;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: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/recovery&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceVerificationFlow(req.header(&#39;cookie&#39;), req.query) res.render(&#39;verification&#39;, flow) }) More information can be found at [Ory Kratos Email and Phone Verification Documentation](www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).

Parameters:

  • id (String)

    The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).

  • 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<(SelfServiceVerificationFlow, Integer, Hash)>)

    SelfServiceVerificationFlow 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/v0alpha2_api.rb', line 1367

def get_self_service_verification_flow_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_self_service_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 V0alpha2Api.get_self_service_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'])
  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] || 'SelfServiceVerificationFlow'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.get_self_service_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: V0alpha2Api#get_self_service_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="public-kratos.example.org/.well-known/ory/webauthn.js" type="script" async /> “` More information can be found at [Ory Kratos User Login](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

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

    the optional parameters

Returns:

  • (String)


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

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: &#x60;&#x60;&#x60;html &lt;script src&#x3D;&quot;public-kratos.example.org/.well-known/ory/webauthn.js"; type&#x3D;&quot;script&quot; async /&gt; &#x60;&#x60;&#x60; More information can be found at [Ory Kratos User Login](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

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/v0alpha2_api.rb', line 1430

def get_web_authn_java_script_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.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'])

  # 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 => :"V0alpha2Api.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: V0alpha2Api#get_web_authn_java_script\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_login_flow_for_browsers(opts = {}) ⇒ SelfServiceLoginFlow

Initialize Login Flow for Browsers This endpoint initializes a browser-based user login flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.login.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `session_aal1_required`: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. `security_identity_mismatch`: The requested `?return_to` address is not allowed to be used. Adjust this in the configuration! 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

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&#39;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&#39;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.

Returns:



1481
1482
1483
1484
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1481

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

#initialize_self_service_login_flow_for_browsers_with_http_info(opts = {}) ⇒ Array<(SelfServiceLoginFlow, Integer, Hash)>

Initialize 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 &#x60;selfservice.flows.login.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If a valid user session exists already, the browser will be redirected to &#x60;urls.default_redirect_url&#x60; unless the query parameter &#x60;?refresh&#x3D;true&#x60; 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 &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;session_aal1_required&#x60;: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;security_identity_mismatch&#x60;: The requested &#x60;?return_to&#x60; 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 Login](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

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&#39;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&#39;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.

Returns:

  • (Array<(SelfServiceLoginFlow, Integer, Hash)>)

    SelfServiceLoginFlow data, response status code and response headers



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
1536
1537
1538
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1493

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_login_flow_for_browsers ...'
  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?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_login_flow_for_browsers",
    :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: V0alpha2Api#initialize_self_service_login_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_login_flow_without_browser(opts = {}) ⇒ SelfServiceLoginFlow

Initialize Login Flow for APIs, Services, Apps, … This endpoint initiates a login flow for API clients that do not use a browser, such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set. To fetch an existing login flow call `/self-service/login/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, …) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks. In the case of an error, the `error.id` of the JSON response body can be one of: `session_already_available`: The user is already signed in. `session_aal1_required`: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. `security_csrf_violation`: Unable to fetch the flow because a CSRF violation occurred. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, …). More information can be found at [Ory Kratos User Login](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

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&#39;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&#39;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.

Returns:



1547
1548
1549
1550
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1547

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

#initialize_self_service_login_flow_without_browser_with_http_info(opts = {}) ⇒ Array<(SelfServiceLoginFlow, Integer, Hash)>

Initialize Login Flow for APIs, Services, Apps, … This endpoint initiates a login flow for API clients that do not use a browser, such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter &#x60;?refresh&#x3D;true&#x60; is set. To fetch an existing login flow call &#x60;/self-service/login/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. 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 &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;session_aal1_required&#x60;: Multi-factor auth (e.g. 2fa) was requested but the user has no session yet. &#x60;security_csrf_violation&#x60;: 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

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&#39;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&#39;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.

Returns:

  • (Array<(SelfServiceLoginFlow, Integer, Hash)>)

    SelfServiceLoginFlow data, response status code and response headers



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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1559

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_login_flow_without_browser ...'
  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?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  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] || 'SelfServiceLoginFlow'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_login_flow_without_browser",
    :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: V0alpha2Api#initialize_self_service_login_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_recovery_flow_for_browsers(opts = {}) ⇒ SelfServiceRecoveryFlow

Initialize 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](../self-service/flows/account-recovery).

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:



1611
1612
1613
1614
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1611

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

#initialize_self_service_recovery_flow_for_browsers_with_http_info(opts = {}) ⇒ Array<(SelfServiceRecoveryFlow, Integer, Hash)>

Initialize Recovery Flow for Browsers This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to &#x60;selfservice.flows.recovery.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. 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](../self-service/flows/account-recovery).

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<(SelfServiceRecoveryFlow, Integer, Hash)>)

    SelfServiceRecoveryFlow data, response status code and response headers



1621
1622
1623
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1621

def initialize_self_service_recovery_flow_for_browsers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_recovery_flow_for_browsers ...'
  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?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_recovery_flow_for_browsers",
    :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: V0alpha2Api#initialize_self_service_recovery_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_recovery_flow_without_browser(opts = {}) ⇒ SelfServiceRecoveryFlow

Initialize Recovery Flow for APIs, Services, 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. To fetch an existing recovery flow call `/self-service/recovery/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 Kratos Account Recovery Documentation](../self-service/flows/account-recovery).

Parameters:

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

    the optional parameters

Returns:



1670
1671
1672
1673
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1670

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

#initialize_self_service_recovery_flow_without_browser_with_http_info(opts = {}) ⇒ Array<(SelfServiceRecoveryFlow, Integer, Hash)>

Initialize Recovery Flow for APIs, Services, 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. To fetch an existing recovery flow call &#x60;/self-service/recovery/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. 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](../self-service/flows/account-recovery).

Parameters:

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

    the optional parameters

Returns:

  • (Array<(SelfServiceRecoveryFlow, Integer, Hash)>)

    SelfServiceRecoveryFlow data, response status code and response headers



1679
1680
1681
1682
1683
1684
1685
1686
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1679

def initialize_self_service_recovery_flow_without_browser_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_recovery_flow_without_browser ...'
  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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_recovery_flow_without_browser",
    :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: V0alpha2Api#initialize_self_service_recovery_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_registration_flow_for_browsers(opts = {}) ⇒ SelfServiceRegistrationFlow

Initialize 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. :::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. :

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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

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:



1728
1729
1730
1731
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1728

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

#initialize_self_service_registration_flow_for_browsers_with_http_info(opts = {}) ⇒ Array<(SelfServiceRegistrationFlow, Integer, Hash)>

Initialize 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. :::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. :

If this endpoint is opened as a link in the browser, it will be redirected to &#x60;selfservice.flows.registration.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If a valid user session exists already, the browser will be redirected to &#x60;urls.default_redirect_url&#x60;. If this endpoint is called via an AJAX request, the response contains the flow without a redirect. In the case of an error, the &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;security_identity_mismatch&#x60;: The requested &#x60;?return_to&#x60; 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

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<(SelfServiceRegistrationFlow, Integer, Hash)>)

    SelfServiceRegistrationFlow data, response status code and response headers



1738
1739
1740
1741
1742
1743
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1738

def initialize_self_service_registration_flow_for_browsers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_registration_flow_for_browsers ...'
  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?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_registration_flow_for_browsers",
    :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: V0alpha2Api#initialize_self_service_registration_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_registration_flow_without_browser(opts = {}) ⇒ SelfServiceRegistrationFlow

Initialize Registration Flow for APIs, Services, 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

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

    the optional parameters

Returns:



1787
1788
1789
1790
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1787

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

#initialize_self_service_registration_flow_without_browser_with_http_info(opts = {}) ⇒ Array<(SelfServiceRegistrationFlow, Integer, Hash)>

Initialize Registration Flow for APIs, Services, 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 &#x60;?refresh&#x3D;true&#x60; is set. To fetch an existing registration flow call &#x60;/self-service/registration/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. 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 &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;security_csrf_violation&#x60;: 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

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

    the optional parameters

Returns:

  • (Array<(SelfServiceRegistrationFlow, Integer, Hash)>)

    SelfServiceRegistrationFlow data, response status code and response headers



1796
1797
1798
1799
1800
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1796

def initialize_self_service_registration_flow_without_browser_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_registration_flow_without_browser ...'
  end
  # resource path
  local_var_path = '/self-service/registration/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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_registration_flow_without_browser",
    :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: V0alpha2Api#initialize_self_service_registration_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_settings_flow_for_browsers(opts = {}) ⇒ SelfServiceSettingsFlow

Initialize 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](../self-service/flows/user-settings).

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:



1845
1846
1847
1848
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1845

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

#initialize_self_service_settings_flow_for_browsers_with_http_info(opts = {}) ⇒ Array<(SelfServiceSettingsFlow, Integer, Hash)>

Initialize Settings Flow for Browsers This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to &#x60;selfservice.flows.settings.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. 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 &#x60;selfservice.flows.settings.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. 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 &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;session_inactive&#x60;: No Ory Session was found - sign in a user first. &#x60;security_identity_mismatch&#x60;: The requested &#x60;?return_to&#x60; 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 &amp; Profile Management Documentation](../self-service/flows/user-settings).

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<(SelfServiceSettingsFlow, Integer, Hash)>)

    SelfServiceSettingsFlow data, response status code and response headers



1855
1856
1857
1858
1859
1860
1861
1862
1863
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1855

def initialize_self_service_settings_flow_for_browsers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_settings_flow_for_browsers ...'
  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?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_settings_flow_for_browsers",
    :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: V0alpha2Api#initialize_self_service_settings_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_settings_flow_without_browser(opts = {}) ⇒ SelfServiceSettingsFlow

Initialize Settings Flow for APIs, Services, 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](../self-service/flows/user-settings).

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.

Returns:



1905
1906
1907
1908
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1905

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

#initialize_self_service_settings_flow_without_browser_with_http_info(opts = {}) ⇒ Array<(SelfServiceSettingsFlow, Integer, Hash)>

Initialize Settings Flow for APIs, Services, 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 &#x60;/self-service/settings/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. 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 &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;session_inactive&#x60;: 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 &amp; Profile Management Documentation](../self-service/flows/user-settings).

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.

Returns:

  • (Array<(SelfServiceSettingsFlow, Integer, Hash)>)

    SelfServiceSettingsFlow data, response status code and response headers



1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1915

def initialize_self_service_settings_flow_without_browser_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_settings_flow_without_browser ...'
  end
  # resource path
  local_var_path = '/self-service/settings/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'])
  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] || 'SelfServiceSettingsFlow'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_settings_flow_without_browser",
    :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: V0alpha2Api#initialize_self_service_settings_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_verification_flow_for_browsers(opts = {}) ⇒ SelfServiceVerificationFlow

Initialize 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](www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).

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:



1965
1966
1967
1968
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1965

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

#initialize_self_service_verification_flow_for_browsers_with_http_info(opts = {}) ⇒ Array<(SelfServiceVerificationFlow, Integer, Hash)>

Initialize Verification Flow for Browser Clients This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to &#x60;selfservice.flows.verification.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. 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](www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).

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<(SelfServiceVerificationFlow, Integer, Hash)>)

    SelfServiceVerificationFlow data, response status code and response headers



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
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
# File 'lib/ory-client/api/v0alpha2_api.rb', line 1975

def initialize_self_service_verification_flow_for_browsers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_verification_flow_for_browsers ...'
  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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_verification_flow_for_browsers",
    :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: V0alpha2Api#initialize_self_service_verification_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initialize_self_service_verification_flow_without_browser(opts = {}) ⇒ SelfServiceVerificationFlow

Initialize Verification Flow for APIs, Services, 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 Kratos Email and Phone Verification Documentation](www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation).

Parameters:

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

    the optional parameters

Returns:



2024
2025
2026
2027
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2024

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

#initialize_self_service_verification_flow_without_browser_with_http_info(opts = {}) ⇒ Array<(SelfServiceVerificationFlow, Integer, Hash)>

Initialize Verification Flow for APIs, Services, 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 &#x60;/self-service/verification/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. 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 Email and Phone Verification Documentation](www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation).

Parameters:

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

    the optional parameters

Returns:

  • (Array<(SelfServiceVerificationFlow, Integer, Hash)>)

    SelfServiceVerificationFlow data, response status code and response headers



2033
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2033

def initialize_self_service_verification_flow_without_browser_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.initialize_self_service_verification_flow_without_browser ...'
  end
  # resource path
  local_var_path = '/self-service/verification/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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.initialize_self_service_verification_flow_without_browser",
    :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: V0alpha2Api#initialize_self_service_verification_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_identity_schemas(opts = {}) ⇒ Array<IdentitySchema>

Get all Identity Schemas

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

Returns:



2082
2083
2084
2085
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2082

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

#list_identity_schemas_with_http_info(opts = {}) ⇒ Array<(Array<IdentitySchema>, Integer, Hash)>

Get all Identity Schemas

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

Returns:

  • (Array<(Array<IdentitySchema>, Integer, Hash)>)

    Array<IdentitySchema> data, response status code and response headers



2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2092

def list_identity_schemas_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.list_identity_schemas ...'
  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 V0alpha2Api.list_identity_schemas, 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 V0alpha2Api.list_identity_schemas, must be greater than or equal to 1.'
  end

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

  # resource path
  local_var_path = '/schemas'

  # 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?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.list_identity_schemas",
    :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: V0alpha2Api#list_identity_schemas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_projects(opts = {}) ⇒ Array<ProjectMetadata>

List All Projects Lists all projects you have access to.

Parameters:

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

    the optional parameters

Returns:



2154
2155
2156
2157
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2154

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

#list_projects_with_http_info(opts = {}) ⇒ Array<(Array<ProjectMetadata>, Integer, Hash)>

List All Projects Lists all projects you have access to.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Array<ProjectMetadata>, Integer, Hash)>)

    Array<ProjectMetadata> data, response status code and response headers



2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2163

def list_projects_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.list_projects ...'
  end
  # resource path
  local_var_path = '/projects'

  # 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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.list_projects",
    :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: V0alpha2Api#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

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. This endpoint is useful for: Displaying all other sessions that belong to the logged-in user

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 &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.

  • :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: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

Returns:



2215
2216
2217
2218
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2215

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

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

This endpoints returns all other active sessions that belong to the logged-in user. The current session can be retrieved by calling the &#x60;/sessions/whoami&#x60; endpoint. This endpoint is useful for: Displaying all other sessions that belong to the logged-in user

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 &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.

  • :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: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.

  • :per_page (Integer)

    Items per Page This is the number of items per page. (default to 250)

  • :page (Integer)

    Pagination Page 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. (default to 1)

Returns:

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

    Array<Session> data, response status code and response headers



2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2228

def list_sessions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.list_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 V0alpha2Api.list_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 V0alpha2Api.list_sessions, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling V0alpha2Api.list_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?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  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 => :"V0alpha2Api.list_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: V0alpha2Api#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_project(project_id, opts = {}) ⇒ SuccessfulProjectUpdate

Patch an Ory Cloud Project Configuration` Deprecated: Use the `patchProjectWithRevision` endpoint instead to specify the exact revision the patch was generated for. This endpoints allows you to patch individual Ory Cloud Project configuration keys for Ory's services (identity, permission, …). The configuration format is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions). This endpoint expects the `version` key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version. If you have an older version of a configuration, you should set the version key in the payload! While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source. For configuration items that can not be translated to Ory Cloud, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Options Hash (opts):

Returns:



2294
2295
2296
2297
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2294

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

#patch_project_with_http_info(project_id, opts = {}) ⇒ Array<(SuccessfulProjectUpdate, Integer, Hash)>

Patch an Ory Cloud Project Configuration&#x60; Deprecated: Use the &#x60;patchProjectWithRevision&#x60; endpoint instead to specify the exact revision the patch was generated for. This endpoints allows you to patch individual Ory Cloud Project configuration keys for Ory&#39;s services (identity, permission, …). The configuration format is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions). This endpoint expects the &#x60;version&#x60; key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version. If you have an older version of a configuration, you should set the version key in the payload! While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source. For configuration items that can not be translated to Ory Cloud, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(SuccessfulProjectUpdate, Integer, Hash)>)

    SuccessfulProjectUpdate data, response status code and response headers



2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2305

def patch_project_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.patch_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling V0alpha2Api.patch_project"
  end
  # resource path
  local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_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'])
  # 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(opts[:'json_patch'])

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.patch_project",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V0alpha2Api#patch_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#purge_project(project_id, opts = {}) ⇒ nil

Irrecoverably Purge a Project !! Use with extreme caution !! Using this API endpoint you can purge (completely delete) a project and its data. This action can not be undone and will delete ALL your data. !! Use with extreme caution !!

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Returns:

  • (nil)


2363
2364
2365
2366
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2363

def purge_project(project_id, opts = {})
  purge_project_with_http_info(project_id, opts)
  nil
end

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

Irrecoverably Purge a Project !! Use with extreme caution !! Using this API endpoint you can purge (completely delete) a project and its data. This action can not be undone and will delete ALL your data. !! Use with extreme caution !!

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2373

def purge_project_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.purge_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling V0alpha2Api.purge_project"
  end
  # resource path
  local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_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'])

  # 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] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"V0alpha2Api.purge_project",
    :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: V0alpha2Api#purge_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_project_member(project_id, member_id, opts = {}) ⇒ nil

Remove a member associated with this project. This also sets their invite status to `REMOVED`. This endpoint requires the user to be a member of the project with the role `OWNER`.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

  • member_id (String)

    Member ID

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

    the optional parameters

Returns:

  • (nil)


2427
2428
2429
2430
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2427

def remove_project_member(project_id, member_id, opts = {})
  remove_project_member_with_http_info(project_id, member_id, opts)
  nil
end

#remove_project_member_with_http_info(project_id, member_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a member associated with this project. This also sets their invite status to &#x60;REMOVED&#x60;. This endpoint requires the user to be a member of the project with the role &#x60;OWNER&#x60;.

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

  • member_id (String)

    Member ID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2438

def remove_project_member_with_http_info(project_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.remove_project_member ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling V0alpha2Api.remove_project_member"
  end
  # verify the required parameter 'member_id' is set
  if @api_client.config.client_side_validation && member_id.nil?
    fail ArgumentError, "Missing the required parameter 'member_id' when calling V0alpha2Api.remove_project_member"
  end
  # resource path
  local_var_path = '/projects/{project_id}/members/{member_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'member_id' + '}', CGI.escape(member_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'])

  # 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] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"V0alpha2Api.remove_project_member",
    :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: V0alpha2Api#remove_project_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted. This endpoint is useful for: To forcefully logout the current user from another device or session

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:

  • (nil)


2495
2496
2497
2498
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2495

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

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

Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted. This endpoint is useful for: To forcefully logout the current user from another device or session

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2505

def revoke_session_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.revoke_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 V0alpha2Api.revoke_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'])

  # 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 => :"V0alpha2Api.revoke_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: V0alpha2Api#revoke_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revoke_sessions(opts = {}) ⇒ RevokedSessions

Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted. This endpoint is useful for: To forcefully logout the current user from all other devices and sessions

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 &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.

  • :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: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.

Returns:



2559
2560
2561
2562
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2559

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

#revoke_sessions_with_http_info(opts = {}) ⇒ Array<(RevokedSessions, Integer, Hash)>

Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted. This endpoint is useful for: To forcefully logout the current user from all other devices and sessions

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 &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.

  • :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: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.

Returns:

  • (Array<(RevokedSessions, Integer, Hash)>)

    RevokedSessions data, response status code and response headers



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
2611
2612
2613
2614
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2570

def revoke_sessions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.revoke_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'])
  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] || 'RevokedSessions'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.revoke_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: V0alpha2Api#revoke_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_self_service_login_flow(flow, submit_self_service_login_flow_body, opts = {}) ⇒ SuccessfulSelfServiceLoginWithoutBrowser

Submit a Login Flow

:::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. :

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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • flow (String)

    The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).

  • submit_self_service_login_flow_body (SubmitSelfServiceLoginFlowBody)
  • 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:



2624
2625
2626
2627
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2624

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

#submit_self_service_login_flow_with_http_info(flow, submit_self_service_login_flow_body, opts = {}) ⇒ Array<(SuccessfulSelfServiceLoginWithoutBrowser, Integer, Hash)>

Submit a Login Flow

:::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. :

Use this endpoint to complete a login flow. This endpoint behaves differently for API and browser flows. API flows expect &#x60;application/json&#x60; 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 &#x60;use_flow_id&#x60; parameter in the body; HTTP 400 on form validation errors. Browser flows expect a Content-Type of &#x60;application/x-www-form-urlencoded&#x60; or &#x60;application/json&#x60; to be sent in the body and respond with a HTTP 303 redirect to the post/after login URL or the &#x60;return_to&#x60; 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 &#x60;application/json&#x60; will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a &#x60;Set-Cookie&#x60; 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 &#x60;Accept: application/json&#x60; in the header, the response contains the flow without a redirect. In the case of an error, the &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;security_identity_mismatch&#x60;: The requested &#x60;?return_to&#x60; address is not allowed to be used. Adjust this in the configuration! &#x60;browser_location_change_required&#x60;: 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • flow (String)

    The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).

  • submit_self_service_login_flow_body (SubmitSelfServiceLoginFlowBody)
  • 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:



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
2689
2690
2691
2692
2693
2694
2695
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2637

def (flow, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.submit_self_service_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 V0alpha2Api.submit_self_service_login_flow"
  end
  # verify the required parameter 'submit_self_service_login_flow_body' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'submit_self_service_login_flow_body' when calling V0alpha2Api.submit_self_service_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'])
  # 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] || 'SuccessfulSelfServiceLoginWithoutBrowser'

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.submit_self_service_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: V0alpha2Api#submit_self_service_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_self_service_logout_flow(opts = {}) ⇒ nil

Complete Self-Service Logout 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](www.ory.sh/docs/next/kratos/self-service/flows/user-logout).

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 &#x60;/self-service/logout/browser&#x60; to generate a URL for this endpoint.

  • :return_to (String)

    The URL to return to after the logout was completed.

Returns:

  • (nil)


2703
2704
2705
2706
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2703

def submit_self_service_logout_flow(opts = {})
  submit_self_service_logout_flow_with_http_info(opts)
  nil
end

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

Complete Self-Service Logout This endpoint logs out an identity in a self-service manner. If the &#x60;Accept&#x60; HTTP header is not set to &#x60;application/json&#x60;, the browser will be redirected (HTTP 303 See Other) to the &#x60;return_to&#x60; parameter of the initial request or fall back to &#x60;urls.default_return_to&#x60;. If the &#x60;Accept&#x60; HTTP header is set to &#x60;application/json&#x60;, 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 &#x60;/self-service/logout/api&#x60; URL directly with the Ory Session Token. More information can be found at [Ory Kratos User Logout Documentation](www.ory.sh/docs/next/kratos/self-service/flows/user-logout).

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 &#x60;/self-service/logout/browser&#x60; to generate a URL for this endpoint.

  • :return_to (String)

    The URL to return to after the logout was completed.

Returns:

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

    nil, response status code and response headers



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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2714

def submit_self_service_logout_flow_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.submit_self_service_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'])

  # 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 => :"V0alpha2Api.submit_self_service_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: V0alpha2Api#submit_self_service_logout_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_self_service_logout_flow_without_browser(submit_self_service_logout_flow_without_browser_body, opts = {}) ⇒ nil

Perform Logout for APIs, Services, 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)


2765
2766
2767
2768
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2765

def submit_self_service_logout_flow_without_browser(submit_self_service_logout_flow_without_browser_body, opts = {})
  submit_self_service_logout_flow_without_browser_with_http_info(submit_self_service_logout_flow_without_browser_body, opts)
  nil
end

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

Perform Logout for APIs, Services, 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



2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
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
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2775

def submit_self_service_logout_flow_without_browser_with_http_info(submit_self_service_logout_flow_without_browser_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.submit_self_service_logout_flow_without_browser ...'
  end
  # verify the required parameter 'submit_self_service_logout_flow_without_browser_body' is set
  if @api_client.config.client_side_validation && submit_self_service_logout_flow_without_browser_body.nil?
    fail ArgumentError, "Missing the required parameter 'submit_self_service_logout_flow_without_browser_body' when calling V0alpha2Api.submit_self_service_logout_flow_without_browser"
  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'])
  # 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(submit_self_service_logout_flow_without_browser_body)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.submit_self_service_logout_flow_without_browser",
    :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: V0alpha2Api#submit_self_service_logout_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_self_service_recovery_flow(flow, submit_self_service_recovery_flow_body, opts = {}) ⇒ SelfServiceRecoveryFlow

Complete Recovery Flow Use this endpoint to complete 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](../self-service/flows/account-recovery).

Parameters:

  • flow (String)

    The Recovery Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).

  • submit_self_service_recovery_flow_body (SubmitSelfServiceRecoveryFlowBody)
  • 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:



2836
2837
2838
2839
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2836

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

#submit_self_service_recovery_flow_with_http_info(flow, submit_self_service_recovery_flow_body, opts = {}) ⇒ Array<(SelfServiceRecoveryFlow, Integer, Hash)>

Complete Recovery Flow Use this endpoint to complete a recovery flow. This endpoint behaves differently for API and browser flows and has several states: &#x60;choose_method&#x60; expects &#x60;flow&#x60; (in the URL query) and &#x60;email&#x60; (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header &#x60;Accept: application/json&#x60; 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 &#x60;Accept&#x60; or with &#x60;Accept: text/*&#x60; it returns a HTTP 303 See Other redirect to the Recovery UI URL with the Recovery Flow ID appended. &#x60;sent_email&#x60; is the success state after &#x60;choose_method&#x60; for the &#x60;link&#x60; 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 &#x60;choose_method&#x60; state. &#x60;passed_challenge&#x60; expects a &#x60;token&#x60; 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](../self-service/flows/account-recovery).

Parameters:

  • flow (String)

    The Recovery Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).

  • submit_self_service_recovery_flow_body (SubmitSelfServiceRecoveryFlowBody)
  • 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<(SelfServiceRecoveryFlow, Integer, Hash)>)

    SelfServiceRecoveryFlow data, response status code and response headers



2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2849

def submit_self_service_recovery_flow_with_http_info(flow, submit_self_service_recovery_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.submit_self_service_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 V0alpha2Api.submit_self_service_recovery_flow"
  end
  # verify the required parameter 'submit_self_service_recovery_flow_body' is set
  if @api_client.config.client_side_validation && submit_self_service_recovery_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'submit_self_service_recovery_flow_body' when calling V0alpha2Api.submit_self_service_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'])
  # 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(submit_self_service_recovery_flow_body)

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.submit_self_service_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: V0alpha2Api#submit_self_service_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_self_service_registration_flow(flow, submit_self_service_registration_flow_body, opts = {}) ⇒ SuccessfulSelfServiceRegistrationWithoutBrowser

Submit a 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • flow (String)

    The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).

  • submit_self_service_registration_flow_body (SubmitSelfServiceRegistrationFlowBody)
  • 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:



2916
2917
2918
2919
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2916

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

#submit_self_service_registration_flow_with_http_info(flow, submit_self_service_registration_flow_body, opts = {}) ⇒ Array<(SuccessfulSelfServiceRegistrationWithoutBrowser, Integer, Hash)>

Submit a Registration Flow Use this endpoint to complete a registration flow by sending an identity&#39;s traits and password. This endpoint behaves differently for API and browser flows. API flows expect &#x60;application/json&#x60; 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 &#x60;session&#x60; and &#x60;session_token&#x60; will also be included; HTTP 410 if the original flow expired with the appropriate error messages set and optionally a &#x60;use_flow_id&#x60; parameter in the body; HTTP 400 on form validation errors. Browser flows expect a Content-Type of &#x60;application/x-www-form-urlencoded&#x60; or &#x60;application/json&#x60; to be sent in the body and respond with a HTTP 303 redirect to the post/after registration URL or the &#x60;return_to&#x60; 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 &#x60;application/json&#x60; will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a &#x60;Set-Cookie&#x60; 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 &#x60;Accept: application/json&#x60; in the header, the response contains the flow without a redirect. In the case of an error, the &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;session_already_available&#x60;: The user is already signed in. &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;security_identity_mismatch&#x60;: The requested &#x60;?return_to&#x60; address is not allowed to be used. Adjust this in the configuration! &#x60;browser_location_change_required&#x60;: 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](www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](www.ory.sh/docs/kratos/self-service/flows/user-registration).

Parameters:

  • flow (String)

    The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).

  • submit_self_service_registration_flow_body (SubmitSelfServiceRegistrationFlowBody)
  • 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:



2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2928

def submit_self_service_registration_flow_with_http_info(flow, submit_self_service_registration_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.submit_self_service_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 V0alpha2Api.submit_self_service_registration_flow"
  end
  # verify the required parameter 'submit_self_service_registration_flow_body' is set
  if @api_client.config.client_side_validation && submit_self_service_registration_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'submit_self_service_registration_flow_body' when calling V0alpha2Api.submit_self_service_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'])
  # 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(submit_self_service_registration_flow_body)

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.submit_self_service_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: V0alpha2Api#submit_self_service_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_self_service_settings_flow(flow, submit_self_service_settings_flow_body, opts = {}) ⇒ SelfServiceSettingsFlow

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](../self-service/flows/user-settings).

Parameters:

  • flow (String)

    The Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).

  • submit_self_service_settings_flow_body (SubmitSelfServiceSettingsFlowBody)
  • 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:



2995
2996
2997
2998
# File 'lib/ory-client/api/v0alpha2_api.rb', line 2995

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

#submit_self_service_settings_flow_with_http_info(flow, submit_self_service_settings_flow_body, opts = {}) ⇒ Array<(SelfServiceSettingsFlow, Integer, Hash)>

Complete Settings Flow Use this endpoint to complete a settings flow by sending an identity&#39;s updated password. This endpoint behaves differently for API and browser flows. API-initiated flows expect &#x60;application/json&#x60; 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 &#x60;selfservice.flows.settings.privileged_session_max_age&#x60; was reached or the session&#39;s AAL is too low. Implies that the user needs to re-authenticate. Browser flows without HTTP Header &#x60;Accept&#x60; or with &#x60;Accept: text/*&#x60; respond with a HTTP 303 redirect to the post/after settings URL or the &#x60;return_to&#x60; 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 &#x60;selfservice.flows.settings.privileged_session_max_age&#x60; was reached or the session&#39;s AAL is too low. Browser flows with HTTP Header &#x60;Accept: application/json&#x60; respond with HTTP 200 and a application/json body with the signed in identity and a &#x60;Set-Cookie&#x60; 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&#39;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 &#x60;Accept: application/json&#x60; HTTP header, the response contains the flow without a redirect. In the case of an error, the &#x60;error.id&#x60; of the JSON response body can be one of: &#x60;session_refresh_required&#x60;: The identity requested to change something that needs a privileged session. Redirect the identity to the login init endpoint with query parameters &#x60;?refresh&#x3D;true&amp;return_to&#x3D;&lt;the-current-browser-url&gt;&#x60;, or initiate a refresh login flow otherwise. &#x60;security_csrf_violation&#x60;: Unable to fetch the flow because a CSRF violation occurred. &#x60;session_inactive&#x60;: No Ory Session was found - sign in a user first. &#x60;security_identity_mismatch&#x60;: The flow was interrupted with &#x60;session_refresh_required&#x60; but apparently some other identity logged in instead. &#x60;security_identity_mismatch&#x60;: The requested &#x60;?return_to&#x60; address is not allowed to be used. Adjust this in the configuration! &#x60;browser_location_change_required&#x60;: 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 &amp; Profile Management Documentation](../self-service/flows/user-settings).

Parameters:

  • flow (String)

    The Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).

  • submit_self_service_settings_flow_body (SubmitSelfServiceSettingsFlowBody)
  • 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<(SelfServiceSettingsFlow, Integer, Hash)>)

    SelfServiceSettingsFlow data, response status code and response headers



3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
# File 'lib/ory-client/api/v0alpha2_api.rb', line 3008

def submit_self_service_settings_flow_with_http_info(flow, submit_self_service_settings_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.submit_self_service_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 V0alpha2Api.submit_self_service_settings_flow"
  end
  # verify the required parameter 'submit_self_service_settings_flow_body' is set
  if @api_client.config.client_side_validation && submit_self_service_settings_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'submit_self_service_settings_flow_body' when calling V0alpha2Api.submit_self_service_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'])
  # 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(submit_self_service_settings_flow_body)

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.submit_self_service_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: V0alpha2Api#submit_self_service_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_self_service_verification_flow(flow, submit_self_service_verification_flow_body, opts = {}) ⇒ SelfServiceVerificationFlow

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](www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).

Parameters:

  • flow (String)

    The Verification Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).

  • submit_self_service_verification_flow_body (SubmitSelfServiceVerificationFlowBody)
  • 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:



3076
3077
3078
3079
# File 'lib/ory-client/api/v0alpha2_api.rb', line 3076

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

#submit_self_service_verification_flow_with_http_info(flow, submit_self_service_verification_flow_body, opts = {}) ⇒ Array<(SelfServiceVerificationFlow, 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: &#x60;choose_method&#x60; expects &#x60;flow&#x60; (in the URL query) and &#x60;email&#x60; (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header &#x60;Accept: application/json&#x60; 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 &#x60;Accept&#x60; or with &#x60;Accept: text/*&#x60; it returns a HTTP 303 See Other redirect to the Verification UI URL with the Verification Flow ID appended. &#x60;sent_email&#x60; is the success state after &#x60;choose_method&#x60; when using the &#x60;link&#x60; 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 &#x60;choose_method&#x60; state. &#x60;passed_challenge&#x60; expects a &#x60;token&#x60; 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](www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).

Parameters:

  • flow (String)

    The Verification Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).

  • submit_self_service_verification_flow_body (SubmitSelfServiceVerificationFlowBody)
  • 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<(SelfServiceVerificationFlow, Integer, Hash)>)

    SelfServiceVerificationFlow data, response status code and response headers



3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
# File 'lib/ory-client/api/v0alpha2_api.rb', line 3089

def submit_self_service_verification_flow_with_http_info(flow, submit_self_service_verification_flow_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.submit_self_service_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 V0alpha2Api.submit_self_service_verification_flow"
  end
  # verify the required parameter 'submit_self_service_verification_flow_body' is set
  if @api_client.config.client_side_validation && submit_self_service_verification_flow_body.nil?
    fail ArgumentError, "Missing the required parameter 'submit_self_service_verification_flow_body' when calling V0alpha2Api.submit_self_service_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'])
  # 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(submit_self_service_verification_flow_body)

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.submit_self_service_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: V0alpha2Api#submit_self_service_verification_flow\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. Additionally 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) “` 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 cooke 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.

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 &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.

  • :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: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.

Returns:



3155
3156
3157
3158
# File 'lib/ory-client/api/v0alpha2_api.rb', line 3155

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. Additionally when the request it successful it adds the user ID to the &#39;X-Kratos-Authenticated-Identity-Id&#39; header in the response. If you call this endpoint from a server-side application, you must forward the HTTP Cookie Header to this endpoint: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/protected-endpoint&#39;, async function (req, res) { const session &#x3D; await client.toSession(undefined, req.header(&#39;cookie&#39;)) console.log(session) }) &#x60;&#x60;&#x60; When calling this endpoint from a non-browser application (e.g. mobile app) you must include the session token: &#x60;&#x60;&#x60;js pseudo-code example … const session &#x3D; await client.toSession(&quot;the-session-token&quot;) console.log(session) &#x60;&#x60;&#x60; 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 &#x60;X-Session-Token&#x60; header! This endpoint authenticates users by checking if the &#x60;Cookie&#x60; HTTP header was set containing an Ory Kratos Session Cookie; if the &#x60;Authorization: bearer &lt;ory-session-token&gt;&#x60; HTTP header was set with a valid Ory Kratos Session Token; if the &#x60;X-Session-Token&#x60; HTTP header was set with a valid Ory Kratos Session Token. If none of these headers are set or the cooke or token are invalid, the endpoint returns a HTTP 401 status code. As explained above, this request may fail due to several reasons. The &#x60;error.id&#x60; can be one of: &#x60;session_inactive&#x60;: No active session was found in the request (e.g. no Ory Session Cookie / Ory Session Token). &#x60;session_aal2_required&#x60;: 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.

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 &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.

  • :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: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.

Returns:

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

    Session data, response status code and response headers



3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
# File 'lib/ory-client/api/v0alpha2_api.rb', line 3166

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

  # 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'])
  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 => :"V0alpha2Api.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: V0alpha2Api#to_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_project(project_id, opts = {}) ⇒ SuccessfulProjectUpdate

Update an Ory Cloud Project Configuration This endpoints allows you to update the Ory Cloud Project configuration for individual services (identity, permission, …). The configuration is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions). This endpoint expects the `version` key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version. If you have an older version of a configuration, you should set the version key in the payload! While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source. For configuration items that can not be translated to Ory Cloud, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed. Be aware that updating any service's configuration will completely override your current configuration for that service!

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Options Hash (opts):

Returns:



3218
3219
3220
3221
# File 'lib/ory-client/api/v0alpha2_api.rb', line 3218

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

#update_project_with_http_info(project_id, opts = {}) ⇒ Array<(SuccessfulProjectUpdate, Integer, Hash)>

Update an Ory Cloud Project Configuration This endpoints allows you to update the Ory Cloud Project configuration for individual services (identity, permission, …). The configuration is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions). This endpoint expects the &#x60;version&#x60; key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version. If you have an older version of a configuration, you should set the version key in the payload! While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source. For configuration items that can not be translated to Ory Cloud, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed. Be aware that updating any service&#39;s configuration will completely override your current configuration for that service!

Parameters:

  • project_id (String)

    Project ID The project&#39;s ID.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(SuccessfulProjectUpdate, Integer, Hash)>)

    SuccessfulProjectUpdate data, response status code and response headers



3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
# File 'lib/ory-client/api/v0alpha2_api.rb', line 3229

def update_project_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: V0alpha2Api.update_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling V0alpha2Api.update_project"
  end
  # resource path
  local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_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'])
  # 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(opts[:'update_project'])

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

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

  new_options = opts.merge(
    :operation => :"V0alpha2Api.update_project",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V0alpha2Api#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end