Class: OryClient::PublicApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PublicApi

Returns a new instance of PublicApi.



19
20
21
# File 'lib/ory-client/api/public_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/public_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#disconnect_user(opts = {}) ⇒ nil

OpenID Connect Front-Backchannel Enabled Logout This endpoint initiates and completes user logout at Ory Hydra and initiates OpenID Connect Front-/Back-channel logout: openid.net/specs/openid-connect-frontchannel-1_0.html openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


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

def disconnect_user(opts = {})
  disconnect_user_with_http_info(opts)
  nil
end

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

OpenID Connect Front-Backchannel Enabled Logout This endpoint initiates and completes user logout at Ory Hydra and initiates OpenID Connect Front-/Back-channel logout: openid.net/specs/openid-connect-frontchannel-1_0.html openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def disconnect_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.disconnect_user ...'
  end
  # resource path
  local_var_path = '/oauth2/sessions/logout'

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

  # header parameters
  header_params = opts[:header_params] || {}

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

#discover_open_id_configuration(opts = {}) ⇒ WellKnown

OpenID Connect Discovery The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage you to not roll your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn more on this flow at openid.net/specs/openid-connect-discovery-1_0.html . Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang), and others. For a full list of clients go here: openid.net/developers/certified/

Parameters:

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

    the optional parameters

Returns:



81
82
83
84
# File 'lib/ory-client/api/public_api.rb', line 81

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

#discover_open_id_configuration_with_http_info(opts = {}) ⇒ Array<(WellKnown, Integer, Hash)>

OpenID Connect Discovery The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage you to not roll your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn more on this flow at openid.net/specs/openid-connect-discovery-1_0.html . Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang), and others. For a full list of clients go here: openid.net/developers/certified/

Parameters:

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

    the optional parameters

Returns:

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

    WellKnown data, response status code and response headers



90
91
92
93
94
95
96
97
98
99
100
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
# File 'lib/ory-client/api/public_api.rb', line 90

def discover_open_id_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.discover_open_id_configuration ...'
  end
  # resource path
  local_var_path = '/.well-known/openid-configuration'

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

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

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

#dynamic_client_registration_create_o_auth2_client(o_auth2_client, opts = {}) ⇒ OAuth2Client

Register an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. Please note that using this endpoint you are not able to choose the `client_secret` nor the `client_id` as those values will be server generated when specifying `token_endpoint_auth_method` as `client_secret_basic` or `client_secret_post`. The `client_secret` will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe.

Parameters:

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

    the optional parameters

Returns:



139
140
141
142
# File 'lib/ory-client/api/public_api.rb', line 139

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

#dynamic_client_registration_create_o_auth2_client_with_http_info(o_auth2_client, opts = {}) ⇒ Array<(OAuth2Client, Integer, Hash)>

Register an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (&#x60;createOAuth2Client&#x60;) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. Please note that using this endpoint you are not able to choose the &#x60;client_secret&#x60; nor the &#x60;client_id&#x60; as those values will be server generated when specifying &#x60;token_endpoint_auth_method&#x60; as &#x60;client_secret_basic&#x60; or &#x60;client_secret_post&#x60;. The &#x60;client_secret&#x60; will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe.

Parameters:

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

    the optional parameters

Returns:

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

    OAuth2Client data, response status code and response headers



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
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
# File 'lib/ory-client/api/public_api.rb', line 149

def dynamic_client_registration_create_o_auth2_client_with_http_info(o_auth2_client, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.dynamic_client_registration_create_o_auth2_client ...'
  end
  # verify the required parameter 'o_auth2_client' is set
  if @api_client.config.client_side_validation && o_auth2_client.nil?
    fail ArgumentError, "Missing the required parameter 'o_auth2_client' when calling PublicApi.dynamic_client_registration_create_o_auth2_client"
  end
  # resource path
  local_var_path = '/connect/register'

  # 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(o_auth2_client)

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

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

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

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

Deletes an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.

Parameters:

  • id (String)

    The id of the OAuth 2.0 Client.

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

    the optional parameters

Returns:

  • (nil)


207
208
209
210
# File 'lib/ory-client/api/public_api.rb', line 207

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

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

Deletes an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (&#x60;deleteOAuth2Client&#x60;) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. To use this endpoint, you will need to present the client&#39;s authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method &#x60;client_secret_post&#x60;, you need to present the client secret in the URL query. If it uses &#x60;client_secret_basic&#x60;, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.

Parameters:

  • id (String)

    The id of the OAuth 2.0 Client.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



217
218
219
220
221
222
223
224
225
226
227
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
# File 'lib/ory-client/api/public_api.rb', line 217

def dynamic_client_registration_delete_o_auth2_client_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.dynamic_client_registration_delete_o_auth2_client ...'
  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 PublicApi.dynamic_client_registration_delete_o_auth2_client"
  end
  # resource path
  local_var_path = '/connect/register/{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 => :"PublicApi.dynamic_client_registration_delete_o_auth2_client",
    :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: PublicApi#dynamic_client_registration_delete_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#dynamic_client_registration_get_o_auth2_client(id, opts = {}) ⇒ OAuth2Client

Get an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.

Parameters:

  • id (String)

    The id of the OAuth 2.0 Client.

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

    the optional parameters

Returns:



270
271
272
273
# File 'lib/ory-client/api/public_api.rb', line 270

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

#dynamic_client_registration_get_o_auth2_client_with_http_info(id, opts = {}) ⇒ Array<(OAuth2Client, Integer, Hash)>

Get an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (&#x60;getOAuth2Client&#x60;) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. To use this endpoint, you will need to present the client&#39;s authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method &#x60;client_secret_post&#x60;, you need to present the client secret in the URL query. If it uses &#x60;client_secret_basic&#x60;, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.

Parameters:

  • id (String)

    The id of the OAuth 2.0 Client.

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

    the optional parameters

Returns:

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

    OAuth2Client data, response status code and response headers



280
281
282
283
284
285
286
287
288
289
290
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
# File 'lib/ory-client/api/public_api.rb', line 280

def dynamic_client_registration_get_o_auth2_client_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.dynamic_client_registration_get_o_auth2_client ...'
  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 PublicApi.dynamic_client_registration_get_o_auth2_client"
  end
  # resource path
  local_var_path = '/connect/register/{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] || 'OAuth2Client'

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

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

#dynamic_client_registration_update_o_auth2_client(id, o_auth2_client, opts = {}) ⇒ OAuth2Client

Update an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.

Parameters:

  • id (String)

    The id of the OAuth 2.0 Client.

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

    the optional parameters

Returns:



334
335
336
337
# File 'lib/ory-client/api/public_api.rb', line 334

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

#dynamic_client_registration_update_o_auth2_client_with_http_info(id, o_auth2_client, opts = {}) ⇒ Array<(OAuth2Client, Integer, Hash)>

Update an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (&#x60;updateOAuth2Client&#x60;) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. If you pass &#x60;client_secret&#x60; the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. To use this endpoint, you will need to present the client&#39;s authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method &#x60;client_secret_post&#x60;, you need to present the client secret in the URL query. If it uses &#x60;client_secret_basic&#x60;, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.

Parameters:

  • id (String)

    The id of the OAuth 2.0 Client.

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

    the optional parameters

Returns:

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

    OAuth2Client data, response status code and response headers



345
346
347
348
349
350
351
352
353
354
355
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
# File 'lib/ory-client/api/public_api.rb', line 345

def dynamic_client_registration_update_o_auth2_client_with_http_info(id, o_auth2_client, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.dynamic_client_registration_update_o_auth2_client ...'
  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 PublicApi.dynamic_client_registration_update_o_auth2_client"
  end
  # verify the required parameter 'o_auth2_client' is set
  if @api_client.config.client_side_validation && o_auth2_client.nil?
    fail ArgumentError, "Missing the required parameter 'o_auth2_client' when calling PublicApi.dynamic_client_registration_update_o_auth2_client"
  end
  # resource path
  local_var_path = '/connect/register/{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(o_auth2_client)

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

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

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

#oauth2_token(grant_type, opts = {}) ⇒ Oauth2TokenResponse

The OAuth 2.0 Token Endpoint The client makes a request to the token endpoint by sending the following parameters using the "application/x-www-form-urlencoded" HTTP request entity-body. > Do not implement a client for this endpoint yourself. Use a library. There are many libraries > available for any programming language. You can find a list of libraries here: oauth.net/code/ > > Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above!

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :code (String)
  • :redirect_uri (String)
  • :refresh_token (String)

Returns:



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

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

#oauth2_token_with_http_info(grant_type, opts = {}) ⇒ Array<(Oauth2TokenResponse, Integer, Hash)>

The OAuth 2.0 Token Endpoint The client makes a request to the token endpoint by sending the following parameters using the &quot;application/x-www-form-urlencoded&quot; HTTP request entity-body. &gt; Do not implement a client for this endpoint yourself. Use a library. There are many libraries &gt; available for any programming language. You can find a list of libraries here: oauth.net/code/ &gt; &gt; Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above!

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :code (String)
  • :redirect_uri (String)
  • :refresh_token (String)

Returns:

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

    Oauth2TokenResponse data, response status code and response headers



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
479
480
481
# File 'lib/ory-client/api/public_api.rb', line 425

def oauth2_token_with_http_info(grant_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.oauth2_token ...'
  end
  # verify the required parameter 'grant_type' is set
  if @api_client.config.client_side_validation && grant_type.nil?
    fail ArgumentError, "Missing the required parameter 'grant_type' when calling PublicApi.oauth2_token"
  end
  # resource path
  local_var_path = '/oauth2/token'

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

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

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['grant_type'] = grant_type
  form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
  form_params['code'] = opts[:'code'] if !opts[:'code'].nil?
  form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
  form_params['refresh_token'] = opts[:'refresh_token'] if !opts[:'refresh_token'].nil?

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basic', 'oauth2']

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

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

#oauth_auth(opts = {}) ⇒ nil

The OAuth 2.0 Authorize Endpoint This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. OAuth2 is a very popular protocol and a library for your programming language will exists. To learn more about this flow please refer to the specification: tools.ietf.org/html/rfc6749

Parameters:

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

    the optional parameters

Returns:

  • (nil)


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

def oauth_auth(opts = {})
  oauth_auth_with_http_info(opts)
  nil
end

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

The OAuth 2.0 Authorize Endpoint This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. OAuth2 is a very popular protocol and a library for your programming language will exists. To learn more about this flow please refer to the specification: tools.ietf.org/html/rfc6749

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



496
497
498
499
500
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
# File 'lib/ory-client/api/public_api.rb', line 496

def oauth_auth_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.oauth_auth ...'
  end
  # resource path
  local_var_path = '/oauth2/auth'

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

#revoke_o_auth2_token(token, opts = {}) ⇒ nil

Revoke OAuth2 Tokens Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


545
546
547
548
# File 'lib/ory-client/api/public_api.rb', line 545

def revoke_o_auth2_token(token, opts = {})
  revoke_o_auth2_token_with_http_info(token, opts)
  nil
end

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

Revoke OAuth2 Tokens Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
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
# File 'lib/ory-client/api/public_api.rb', line 555

def revoke_o_auth2_token_with_http_info(token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.revoke_o_auth2_token ...'
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling PublicApi.revoke_o_auth2_token"
  end
  # resource path
  local_var_path = '/oauth2/revoke'

  # 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/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basic', 'oauth2']

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

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

#userinfo(opts = {}) ⇒ UserinfoResponse

OpenID Connect Userinfo This endpoint returns the payload of the ID Token, including the idTokenExtra values, of the provided OAuth 2.0 Access Token. For more information please [refer to the spec](openid.net/specs/openid-connect-core-1_0.html#UserInfo). In the case of authentication error, a WWW-Authenticate header might be set in the response with more information about the error. See [the spec](datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format.

Parameters:

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

    the optional parameters

Returns:



613
614
615
616
# File 'lib/ory-client/api/public_api.rb', line 613

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

#userinfo_with_http_info(opts = {}) ⇒ Array<(UserinfoResponse, Integer, Hash)>

OpenID Connect Userinfo This endpoint returns the payload of the ID Token, including the idTokenExtra values, of the provided OAuth 2.0 Access Token. For more information please [refer to the spec](openid.net/specs/openid-connect-core-1_0.html#UserInfo). In the case of authentication error, a WWW-Authenticate header might be set in the response with more information about the error. See [the spec](datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format.

Parameters:

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

    the optional parameters

Returns:

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

    UserinfoResponse data, response status code and response headers



622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'lib/ory-client/api/public_api.rb', line 622

def userinfo_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.userinfo ...'
  end
  # resource path
  local_var_path = '/userinfo'

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

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

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

#well_known(opts = {}) ⇒ JSONWebKeySet

JSON Web Keys Discovery This endpoint returns JSON Web Keys to be used as public keys for verifying OpenID Connect ID Tokens and, if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like [node-jwks-rsa](github.com/auth0/node-jwks-rsa) among others.

Parameters:

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

    the optional parameters

Returns:



670
671
672
673
# File 'lib/ory-client/api/public_api.rb', line 670

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

#well_known_with_http_info(opts = {}) ⇒ Array<(JSONWebKeySet, Integer, Hash)>

JSON Web Keys Discovery This endpoint returns JSON Web Keys to be used as public keys for verifying OpenID Connect ID Tokens and, if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like [node-jwks-rsa](github.com/auth0/node-jwks-rsa) among others.

Parameters:

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

    the optional parameters

Returns:

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

    JSONWebKeySet data, response status code and response headers



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/ory-client/api/public_api.rb', line 679

def well_known_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PublicApi.well_known ...'
  end
  # resource path
  local_var_path = '/.well-known/jwks.json'

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

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

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