=begin #Ory APIs #Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. The version of the OpenAPI document: v0.2.0-alpha.60 Contact: support@ory.sh Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.1 =end require 'cgi' module OryClient class V0alpha2Api attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Accept an OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access resources on his/her behalf. The consent provider includes additional information, such as session data for access and ID tokens, and if the consent request should be used as basis for future requests. The response contains a redirect URL which the consent provider should redirect the user-agent to. # @param consent_challenge [String] # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2ConsentRequest] :accept_o_auth2_consent_request # @return [SuccessfulOAuth2RequestResponse] def admin_accept_o_auth2_consent_request(consent_challenge, opts = {}) data, _status_code, _headers = admin_accept_o_auth2_consent_request_with_http_info(consent_challenge, opts) data end # Accept an OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access resources on his/her behalf. The consent provider includes additional information, such as session data for access and ID tokens, and if the consent request should be used as basis for future requests. The response contains a redirect URL which the consent provider should redirect the user-agent to. # @param consent_challenge [String] # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2ConsentRequest] :accept_o_auth2_consent_request # @return [Array<(SuccessfulOAuth2RequestResponse, Integer, Hash)>] SuccessfulOAuth2RequestResponse data, response status code and response headers def admin_accept_o_auth2_consent_request_with_http_info(consent_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_accept_o_auth2_consent_request ...' end # verify the required parameter 'consent_challenge' is set if @api_client.config.client_side_validation && consent_challenge.nil? fail ArgumentError, "Missing the required parameter 'consent_challenge' when calling V0alpha2Api.admin_accept_o_auth2_consent_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/consent/accept' # query parameters query_params = opts[:query_params] || {} query_params[:'consent_challenge'] = consent_challenge # 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[:'accept_o_auth2_consent_request']) # return_type return_type = opts[:debug_return_type] || 'SuccessfulOAuth2RequestResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_accept_o_auth2_consent_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_accept_o_auth2_consent_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Accept an OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell Ory Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. This endpoint tells ORY Hydra that the subject has successfully authenticated and includes additional information such as the subject's ID and if ORY Hydra should remember the subject's subject agent for future authentication attempts by setting a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to. # @param login_challenge [String] # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2LoginRequest] :accept_o_auth2_login_request # @return [SuccessfulOAuth2RequestResponse] def admin_accept_o_auth2_login_request(login_challenge, opts = {}) data, _status_code, _headers = admin_accept_o_auth2_login_request_with_http_info(login_challenge, opts) data end # Accept an OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell Ory Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. This endpoint tells ORY Hydra that the subject has successfully authenticated and includes additional information such as the subject's ID and if ORY Hydra should remember the subject's subject agent for future authentication attempts by setting a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to. # @param login_challenge [String] # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2LoginRequest] :accept_o_auth2_login_request # @return [Array<(SuccessfulOAuth2RequestResponse, Integer, Hash)>] SuccessfulOAuth2RequestResponse data, response status code and response headers def admin_accept_o_auth2_login_request_with_http_info(login_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_accept_o_auth2_login_request ...' end # verify the required parameter 'login_challenge' is set if @api_client.config.client_side_validation && login_challenge.nil? fail ArgumentError, "Missing the required parameter 'login_challenge' when calling V0alpha2Api.admin_accept_o_auth2_login_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/login/accept' # query parameters query_params = opts[:query_params] || {} query_params[:'login_challenge'] = login_challenge # 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[:'accept_o_auth2_login_request']) # return_type return_type = opts[:debug_return_type] || 'SuccessfulOAuth2RequestResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_accept_o_auth2_login_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_accept_o_auth2_login_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Accept an OAuth 2.0 Logout Request # When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm that logout request. The response contains a redirect URL which the consent provider should redirect the user-agent to. # @param logout_challenge [String] # @param [Hash] opts the optional parameters # @return [SuccessfulOAuth2RequestResponse] def admin_accept_o_auth2_logout_request(logout_challenge, opts = {}) data, _status_code, _headers = admin_accept_o_auth2_logout_request_with_http_info(logout_challenge, opts) data end # Accept an OAuth 2.0 Logout Request # When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm that logout request. The response contains a redirect URL which the consent provider should redirect the user-agent to. # @param logout_challenge [String] # @param [Hash] opts the optional parameters # @return [Array<(SuccessfulOAuth2RequestResponse, Integer, Hash)>] SuccessfulOAuth2RequestResponse data, response status code and response headers def admin_accept_o_auth2_logout_request_with_http_info(logout_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_accept_o_auth2_logout_request ...' end # verify the required parameter 'logout_challenge' is set if @api_client.config.client_side_validation && logout_challenge.nil? fail ArgumentError, "Missing the required parameter 'logout_challenge' when calling V0alpha2Api.admin_accept_o_auth2_logout_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/logout/accept' # query parameters query_params = opts[:query_params] || {} query_params[:'logout_challenge'] = logout_challenge # 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] || 'SuccessfulOAuth2RequestResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_accept_o_auth2_logout_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_accept_o_auth2_logout_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an Identity # This endpoint creates an identity. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [AdminCreateIdentityBody] :admin_create_identity_body # @return [Identity] def admin_create_identity(opts = {}) data, _status_code, _headers = admin_create_identity_with_http_info(opts) data end # Create an Identity # This endpoint creates an identity. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [AdminCreateIdentityBody] :admin_create_identity_body # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers 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 # Generate a New JSON Web Key # This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys (RS256, ECDSA). If the specified JSON Web Key Set does not exist, it will be created. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param admin_create_json_web_key_set_body [AdminCreateJsonWebKeySetBody] # @param [Hash] opts the optional parameters # @return [JsonWebKeySet] def admin_create_json_web_key_set(set, admin_create_json_web_key_set_body, opts = {}) data, _status_code, _headers = admin_create_json_web_key_set_with_http_info(set, admin_create_json_web_key_set_body, opts) data end # Generate a New JSON Web Key # This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys (RS256, ECDSA). If the specified JSON Web Key Set does not exist, it will be created. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param admin_create_json_web_key_set_body [AdminCreateJsonWebKeySetBody] # @param [Hash] opts the optional parameters # @return [Array<(JsonWebKeySet, Integer, Hash)>] JsonWebKeySet data, response status code and response headers def admin_create_json_web_key_set_with_http_info(set, admin_create_json_web_key_set_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_create_json_web_key_set ...' end # verify the required parameter 'set' is set if @api_client.config.client_side_validation && set.nil? fail ArgumentError, "Missing the required parameter 'set' when calling V0alpha2Api.admin_create_json_web_key_set" end # verify the required parameter 'admin_create_json_web_key_set_body' is set if @api_client.config.client_side_validation && admin_create_json_web_key_set_body.nil? fail ArgumentError, "Missing the required parameter 'admin_create_json_web_key_set_body' when calling V0alpha2Api.admin_create_json_web_key_set" end # resource path local_var_path = '/admin/keys/{set}'.sub('{' + 'set' + '}', CGI.escape(set.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(admin_create_json_web_key_set_body) # return_type return_type = opts[:debug_return_type] || 'JsonWebKeySet' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_create_json_web_key_set", :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_json_web_key_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an OAuth 2.0 Client # Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random secret is generated. The secret is echoed in the response. It is not possible to retrieve it later on. 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. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [OAuth2Client] def admin_create_o_auth2_client(o_auth2_client, opts = {}) data, _status_code, _headers = admin_create_o_auth2_client_with_http_info(o_auth2_client, opts) data end # Create an OAuth 2.0 Client # Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random secret is generated. The secret is echoed in the response. It is not possible to retrieve it later on. 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. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def admin_create_o_auth2_client_with_http_info(o_auth2_client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_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 V0alpha2Api.admin_create_o_auth2_client" end # resource path local_var_path = '/admin/clients' # 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] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_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: V0alpha2Api#admin_create_o_auth2_client\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 code which should be given to the user in order for them to recover (or activate) their account. # @param [Hash] opts the optional parameters # @option opts [AdminCreateSelfServiceRecoveryCodeBody] :admin_create_self_service_recovery_code_body # @return [SelfServiceRecoveryCode] def admin_create_self_service_recovery_code(opts = {}) data, _status_code, _headers = admin_create_self_service_recovery_code_with_http_info(opts) data end # Create a Recovery Link # This endpoint creates a recovery code which should be given to the user in order for them to recover (or activate) their account. # @param [Hash] opts the optional parameters # @option opts [AdminCreateSelfServiceRecoveryCodeBody] :admin_create_self_service_recovery_code_body # @return [Array<(SelfServiceRecoveryCode, Integer, Hash)>] SelfServiceRecoveryCode data, response status code and response headers def admin_create_self_service_recovery_code_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_create_self_service_recovery_code ...' end # resource path local_var_path = '/admin/recovery/code' # 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_code_body']) # return_type return_type = opts[:debug_return_type] || 'SelfServiceRecoveryCode' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_create_self_service_recovery_code", :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_code\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. # @param [Hash] opts the optional parameters # @option opts [AdminCreateSelfServiceRecoveryLinkBody] :admin_create_self_service_recovery_link_body # @return [SelfServiceRecoveryLink] 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. # @param [Hash] opts the optional parameters # @option opts [AdminCreateSelfServiceRecoveryLinkBody] :admin_create_self_service_recovery_link_body # @return [Array<(SelfServiceRecoveryLink, Integer, Hash)>] SelfServiceRecoveryLink data, response status code and response headers 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 # 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](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @return [nil] def admin_delete_identity(id, opts = {}) admin_delete_identity_with_http_info(id, opts) nil end # 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](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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 # 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 # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @return [nil] def admin_delete_identity_sessions(id, opts = {}) admin_delete_identity_sessions_with_http_info(id, opts) nil end # 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 # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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 # Delete a JSON Web Key # Use this endpoint to delete a single JSON Web Key. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param kid [String] The JSON Web Key ID (kid) # @param [Hash] opts the optional parameters # @return [nil] def admin_delete_json_web_key(set, kid, opts = {}) admin_delete_json_web_key_with_http_info(set, kid, opts) nil end # Delete a JSON Web Key # Use this endpoint to delete a single JSON Web Key. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param kid [String] The JSON Web Key ID (kid) # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_delete_json_web_key_with_http_info(set, kid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_delete_json_web_key ...' end # verify the required parameter 'set' is set if @api_client.config.client_side_validation && set.nil? fail ArgumentError, "Missing the required parameter 'set' when calling V0alpha2Api.admin_delete_json_web_key" end # verify the required parameter 'kid' is set if @api_client.config.client_side_validation && kid.nil? fail ArgumentError, "Missing the required parameter 'kid' when calling V0alpha2Api.admin_delete_json_web_key" end # resource path local_var_path = '/admin/keys/{set}/{kid}'.sub('{' + 'set' + '}', CGI.escape(set.to_s)).sub('{' + 'kid' + '}', CGI.escape(kid.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_json_web_key", :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_json_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a JSON Web Key Set # Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param [Hash] opts the optional parameters # @return [nil] def admin_delete_json_web_key_set(set, opts = {}) admin_delete_json_web_key_set_with_http_info(set, opts) nil end # Delete a JSON Web Key Set # Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_delete_json_web_key_set_with_http_info(set, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_delete_json_web_key_set ...' end # verify the required parameter 'set' is set if @api_client.config.client_side_validation && set.nil? fail ArgumentError, "Missing the required parameter 'set' when calling V0alpha2Api.admin_delete_json_web_key_set" end # resource path local_var_path = '/admin/keys/{set}'.sub('{' + 'set' + '}', CGI.escape(set.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_json_web_key_set", :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_json_web_key_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes an OAuth 2.0 Client # Delete an existing OAuth 2.0 Client by its ID. 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. Make sure that this endpoint is well protected and only callable by first-party components. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [nil] def admin_delete_o_auth2_client(id, opts = {}) admin_delete_o_auth2_client_with_http_info(id, opts) nil end # Deletes an OAuth 2.0 Client # Delete an existing OAuth 2.0 Client by its ID. 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. Make sure that this endpoint is well protected and only callable by first-party components. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_delete_o_auth2_client_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_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 V0alpha2Api.admin_delete_o_auth2_client" end # resource path local_var_path = '/admin/clients/{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_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: V0alpha2Api#admin_delete_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete OAuth2 Access Tokens from a Client # This endpoint deletes OAuth2 access tokens issued for a client from the database # @param client_id [String] # @param [Hash] opts the optional parameters # @return [nil] def admin_delete_o_auth2_token(client_id, opts = {}) admin_delete_o_auth2_token_with_http_info(client_id, opts) nil end # Delete OAuth2 Access Tokens from a Client # This endpoint deletes OAuth2 access tokens issued for a client from the database # @param client_id [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_delete_o_auth2_token_with_http_info(client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_delete_o_auth2_token ...' end # verify the required parameter 'client_id' is set if @api_client.config.client_side_validation && client_id.nil? fail ArgumentError, "Missing the required parameter 'client_id' when calling V0alpha2Api.admin_delete_o_auth2_token" end # resource path local_var_path = '/admin/oauth2/tokens' # query parameters query_params = opts[:query_params] || {} query_params[:'client_id'] = client_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] # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_delete_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(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_delete_o_auth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Trusted OAuth2 JWT Bearer Grant Type Issuer # Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you created the trust relationship. Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grant. # @param id [String] The id of the desired grant # @param [Hash] opts the optional parameters # @return [nil] def admin_delete_trusted_o_auth2_jwt_grant_issuer(id, opts = {}) admin_delete_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts) nil end # Delete a Trusted OAuth2 JWT Bearer Grant Type Issuer # Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you created the trust relationship. Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grant. # @param id [String] The id of the desired grant # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_delete_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_delete_trusted_o_auth2_jwt_grant_issuer ...' 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_trusted_o_auth2_jwt_grant_issuer" end # resource path local_var_path = '/admin/trust/grants/jwt-bearer/issuers/{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_trusted_o_auth2_jwt_grant_issuer", :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_trusted_o_auth2_jwt_grant_issuer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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. # @param id [String] ID is the session's ID. # @param [Hash] opts the optional parameters # @return [Session] def admin_extend_session(id, opts = {}) data, _status_code, _headers = admin_extend_session_with_http_info(id, opts) data end # 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. # @param id [String] ID is the session's ID. # @param [Hash] opts the optional parameters # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers 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 # Get an Identity # Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to get # @param [Hash] opts the optional parameters # @option opts [Array] :include_credential DeclassifyCredentials will declassify one or more identity's credentials Currently, only `oidc` is supported. This will return the initial OAuth 2.0 Access, Refresh and (optionally) OpenID Connect ID Token. # @return [Identity] def admin_get_identity(id, opts = {}) data, _status_code, _headers = admin_get_identity_with_http_info(id, opts) data end # Get an Identity # Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to get # @param [Hash] opts the optional parameters # @option opts [Array] :include_credential DeclassifyCredentials will declassify one or more identity's credentials Currently, only `oidc` is supported. This will return the initial OAuth 2.0 Access, Refresh and (optionally) OpenID Connect ID Token. # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers 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 # Fetch a JSON Web Key # This endpoint returns a singular JSON Web Key. It is identified by the set and the specific key ID (kid). # @param set [String] The JSON Web Key Set # @param kid [String] The JSON Web Key ID (kid) # @param [Hash] opts the optional parameters # @return [JsonWebKeySet] def admin_get_json_web_key(set, kid, opts = {}) data, _status_code, _headers = admin_get_json_web_key_with_http_info(set, kid, opts) data end # Fetch a JSON Web Key # This endpoint returns a singular JSON Web Key. It is identified by the set and the specific key ID (kid). # @param set [String] The JSON Web Key Set # @param kid [String] The JSON Web Key ID (kid) # @param [Hash] opts the optional parameters # @return [Array<(JsonWebKeySet, Integer, Hash)>] JsonWebKeySet data, response status code and response headers def admin_get_json_web_key_with_http_info(set, kid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_get_json_web_key ...' end # verify the required parameter 'set' is set if @api_client.config.client_side_validation && set.nil? fail ArgumentError, "Missing the required parameter 'set' when calling V0alpha2Api.admin_get_json_web_key" end # verify the required parameter 'kid' is set if @api_client.config.client_side_validation && kid.nil? fail ArgumentError, "Missing the required parameter 'kid' when calling V0alpha2Api.admin_get_json_web_key" end # resource path local_var_path = '/admin/keys/{set}/{kid}'.sub('{' + 'set' + '}', CGI.escape(set.to_s)).sub('{' + 'kid' + '}', CGI.escape(kid.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] || 'JsonWebKeySet' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_get_json_web_key", :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_json_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a JSON Web Key Set # This endpoint can be used to retrieve JWK Sets stored in ORY Hydra. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param [Hash] opts the optional parameters # @return [JsonWebKeySet] def admin_get_json_web_key_set(set, opts = {}) data, _status_code, _headers = admin_get_json_web_key_set_with_http_info(set, opts) data end # Retrieve a JSON Web Key Set # This endpoint can be used to retrieve JWK Sets stored in ORY Hydra. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param [Hash] opts the optional parameters # @return [Array<(JsonWebKeySet, Integer, Hash)>] JsonWebKeySet data, response status code and response headers def admin_get_json_web_key_set_with_http_info(set, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_get_json_web_key_set ...' end # verify the required parameter 'set' is set if @api_client.config.client_side_validation && set.nil? fail ArgumentError, "Missing the required parameter 'set' when calling V0alpha2Api.admin_get_json_web_key_set" end # resource path local_var_path = '/admin/keys/{set}'.sub('{' + 'set' + '}', CGI.escape(set.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] || 'JsonWebKeySet' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_get_json_web_key_set", :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_json_web_key_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an OAuth 2.0 Client # Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [OAuth2Client] def admin_get_o_auth2_client(id, opts = {}) data, _status_code, _headers = admin_get_o_auth2_client_with_http_info(id, opts) data end # Get an OAuth 2.0 Client # Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def admin_get_o_auth2_client_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_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 V0alpha2Api.admin_get_o_auth2_client" end # resource path local_var_path = '/admin/clients/{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] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_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: V0alpha2Api#admin_get_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get OAuth 2.0 Consent Request Information # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. # @param consent_challenge [String] # @param [Hash] opts the optional parameters # @return [OAuth2ConsentRequest] def admin_get_o_auth2_consent_request(consent_challenge, opts = {}) data, _status_code, _headers = admin_get_o_auth2_consent_request_with_http_info(consent_challenge, opts) data end # Get OAuth 2.0 Consent Request Information # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. # @param consent_challenge [String] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2ConsentRequest, Integer, Hash)>] OAuth2ConsentRequest data, response status code and response headers def admin_get_o_auth2_consent_request_with_http_info(consent_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_get_o_auth2_consent_request ...' end # verify the required parameter 'consent_challenge' is set if @api_client.config.client_side_validation && consent_challenge.nil? fail ArgumentError, "Missing the required parameter 'consent_challenge' when calling V0alpha2Api.admin_get_o_auth2_consent_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/consent' # query parameters query_params = opts[:query_params] || {} query_params[:'consent_challenge'] = consent_challenge # 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] || 'OAuth2ConsentRequest' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_get_o_auth2_consent_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_get_o_auth2_consent_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. # @param login_challenge [String] # @param [Hash] opts the optional parameters # @return [OAuth2LoginRequest] def admin_get_o_auth2_login_request(login_challenge, opts = {}) data, _status_code, _headers = admin_get_o_auth2_login_request_with_http_info(login_challenge, opts) data end # Get an OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. # @param login_challenge [String] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2LoginRequest, Integer, Hash)>] OAuth2LoginRequest data, response status code and response headers def admin_get_o_auth2_login_request_with_http_info(login_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_get_o_auth2_login_request ...' end # verify the required parameter 'login_challenge' is set if @api_client.config.client_side_validation && login_challenge.nil? fail ArgumentError, "Missing the required parameter 'login_challenge' when calling V0alpha2Api.admin_get_o_auth2_login_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/login' # query parameters query_params = opts[:query_params] || {} query_params[:'login_challenge'] = login_challenge # 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] || 'OAuth2LoginRequest' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_get_o_auth2_login_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_get_o_auth2_login_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an OAuth 2.0 Logout Request # Use this endpoint to fetch a logout request. # @param logout_challenge [String] # @param [Hash] opts the optional parameters # @return [OAuth2LogoutRequest] def admin_get_o_auth2_logout_request(logout_challenge, opts = {}) data, _status_code, _headers = admin_get_o_auth2_logout_request_with_http_info(logout_challenge, opts) data end # Get an OAuth 2.0 Logout Request # Use this endpoint to fetch a logout request. # @param logout_challenge [String] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2LogoutRequest, Integer, Hash)>] OAuth2LogoutRequest data, response status code and response headers def admin_get_o_auth2_logout_request_with_http_info(logout_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_get_o_auth2_logout_request ...' end # verify the required parameter 'logout_challenge' is set if @api_client.config.client_side_validation && logout_challenge.nil? fail ArgumentError, "Missing the required parameter 'logout_challenge' when calling V0alpha2Api.admin_get_o_auth2_logout_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/logout' # query parameters query_params = opts[:query_params] || {} query_params[:'logout_challenge'] = logout_challenge # 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] || 'OAuth2LogoutRequest' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_get_o_auth2_logout_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_get_o_auth2_logout_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a Trusted OAuth2 JWT Bearer Grant Type Issuer # Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you created the trust relationship. # @param id [String] The id of the desired grant # @param [Hash] opts the optional parameters # @return [TrustedOAuth2JwtGrantIssuer] def admin_get_trusted_o_auth2_jwt_grant_issuer(id, opts = {}) data, _status_code, _headers = admin_get_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts) data end # Get a Trusted OAuth2 JWT Bearer Grant Type Issuer # Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you created the trust relationship. # @param id [String] The id of the desired grant # @param [Hash] opts the optional parameters # @return [Array<(TrustedOAuth2JwtGrantIssuer, Integer, Hash)>] TrustedOAuth2JwtGrantIssuer data, response status code and response headers def admin_get_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_get_trusted_o_auth2_jwt_grant_issuer ...' 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_trusted_o_auth2_jwt_grant_issuer" end # resource path local_var_path = '/admin/trust/grants/jwt-bearer/issuers/{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] || 'TrustedOAuth2JwtGrantIssuer' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_get_trusted_o_auth2_jwt_grant_issuer", :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_trusted_o_auth2_jwt_grant_issuer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Introspect OAuth2 Access or Refresh Tokens # The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. You can set additional data for a token by setting `accessTokenExtra` during the consent flow. For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/). # @param token [String] The string value of the token. For access tokens, this is the \\\"access_token\\\" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the \\\"refresh_token\\\" value returned. # @param [Hash] opts the optional parameters # @option opts [String] :scope An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false. # @return [IntrospectedOAuth2Token] def admin_introspect_o_auth2_token(token, opts = {}) data, _status_code, _headers = admin_introspect_o_auth2_token_with_http_info(token, opts) data end # Introspect OAuth2 Access or Refresh Tokens # The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. You can set additional data for a token by setting `accessTokenExtra` during the consent flow. For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/). # @param token [String] The string value of the token. For access tokens, this is the \\\"access_token\\\" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the \\\"refresh_token\\\" value returned. # @param [Hash] opts the optional parameters # @option opts [String] :scope An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false. # @return [Array<(IntrospectedOAuth2Token, Integer, Hash)>] IntrospectedOAuth2Token data, response status code and response headers def admin_introspect_o_auth2_token_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_introspect_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 V0alpha2Api.admin_introspect_o_auth2_token" end # resource path local_var_path = '/admin/oauth2/introspect' # 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 form_params['scope'] = opts[:'scope'] if !opts[:'scope'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IntrospectedOAuth2Token' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_introspect_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: V0alpha2Api#admin_introspect_o_auth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Messages # Lists all messages by given status and recipient. # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 250) # @option opts [Integer] :page 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) # @option opts [CourierMessageStatus] :status Status filters out messages based on status. If no value is provided, it doesn't take effect on filter. # @option opts [String] :recipient Recipient filters out messages based on recipient. If no value is provided, it doesn't take effect on filter. # @return [Array] def admin_list_courier_messages(opts = {}) data, _status_code, _headers = admin_list_courier_messages_with_http_info(opts) data end # List Messages # Lists all messages by given status and recipient. # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 250) # @option opts [Integer] :page 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) # @option opts [CourierMessageStatus] :status Status filters out messages based on status. If no value is provided, it doesn't take effect on filter. # @option opts [String] :recipient Recipient filters out messages based on recipient. If no value is provided, it doesn't take effect on filter. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def admin_list_courier_messages_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_list_courier_messages ...' 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_courier_messages, 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_courier_messages, 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_courier_messages, must be greater than or equal to 1.' end # resource path local_var_path = '/admin/courier/messages' # 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[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'recipient'] = opts[:'recipient'] if !opts[:'recipient'].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' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_list_courier_messages", :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_courier_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Identities # Lists all identities. Does not support search at the moment. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 250) # @option opts [Integer] :page 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) # @return [Array] def admin_list_identities(opts = {}) data, _status_code, _headers = admin_list_identities_with_http_info(opts) data end # List Identities # Lists all identities. Does not support search at the moment. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 250) # @option opts [Integer] :page 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) # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers 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' # 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 # 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. # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 250) # @option opts [Integer] :page 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) # @option opts [Boolean] :active Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned. # @return [Array] def admin_list_identity_sessions(id, opts = {}) data, _status_code, _headers = admin_list_identity_sessions_with_http_info(id, opts) data end # 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. # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 250) # @option opts [Integer] :page 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) # @option opts [Boolean] :active Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers 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' # 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 # List OAuth 2.0 Clients # This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects. 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. The \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Items per page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250) # @option opts [String] :page_token Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (default to '1') # @option opts [String] :client_name The name of the clients to filter by. # @option opts [String] :owner The owner of the clients to filter by. # @return [Array] def admin_list_o_auth2_clients(opts = {}) data, _status_code, _headers = admin_list_o_auth2_clients_with_http_info(opts) data end # List OAuth 2.0 Clients # This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects. 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. The \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '<https://project-slug.projects.oryapis.com/admin/clients?limit={limit}&offset={offset}>; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Items per page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250) # @option opts [String] :page_token Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (default to '1') # @option opts [String] :client_name The name of the clients to filter by. # @option opts [String] :owner The owner of the clients to filter by. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def admin_list_o_auth2_clients_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_list_o_auth2_clients ...' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling V0alpha2Api.admin_list_o_auth2_clients, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling V0alpha2Api.admin_list_o_auth2_clients, must be greater than or equal to 1.' end # resource path local_var_path = '/admin/clients' # query parameters query_params = opts[:query_params] || {} query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil? query_params[:'client_name'] = opts[:'client_name'] if !opts[:'client_name'].nil? query_params[:'owner'] = opts[:'owner'] if !opts[:'owner'].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' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_list_o_auth2_clients", :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_o_auth2_clients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List OAuth 2.0 Consent Sessions of a Subject # This endpoint lists all subject's granted consent sessions, including client and granted scope. If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an empty JSON array with status code 200 OK. The \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. # @param subject [String] The subject to list the consent sessions for. # @param [Hash] opts the optional parameters # @option opts [String] :link The link header contains pagination links. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). # @option opts [String] :x_total_count The total number of clients. # @return [Array] def admin_list_o_auth2_subject_consent_sessions(subject, opts = {}) data, _status_code, _headers = admin_list_o_auth2_subject_consent_sessions_with_http_info(subject, opts) data end # List OAuth 2.0 Consent Sessions of a Subject # This endpoint lists all subject's granted consent sessions, including client and granted scope. If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an empty JSON array with status code 200 OK. The \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '<https://hydra-url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. # @param subject [String] The subject to list the consent sessions for. # @param [Hash] opts the optional parameters # @option opts [String] :link The link header contains pagination links. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). # @option opts [String] :x_total_count The total number of clients. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def admin_list_o_auth2_subject_consent_sessions_with_http_info(subject, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_list_o_auth2_subject_consent_sessions ...' end # verify the required parameter 'subject' is set if @api_client.config.client_side_validation && subject.nil? fail ArgumentError, "Missing the required parameter 'subject' when calling V0alpha2Api.admin_list_o_auth2_subject_consent_sessions" end # resource path local_var_path = '/admin/oauth2/auth/sessions/consent' # query parameters query_params = opts[:query_params] || {} query_params[:'subject'] = subject # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'link'] = opts[:'link'] if !opts[:'link'].nil? header_params[:'x-total-count'] = opts[:'x_total_count'] if !opts[:'x_total_count'].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' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_list_o_auth2_subject_consent_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_o_auth2_subject_consent_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Trusted OAuth2 JWT Bearer Grant Type Issuers # Use this endpoint to list all trusted JWT Bearer Grant Type Issuers. # @param [Hash] opts the optional parameters # @option opts [Integer] :max_items # @option opts [Integer] :default_items # @option opts [String] :issuer If optional \"issuer\" is supplied, only jwt-bearer grants with this issuer will be returned. # @option opts [Integer] :limit The maximum amount of policies returned, upper bound is 500 policies # @option opts [Integer] :offset The offset from where to start looking. # @return [Array] def admin_list_trusted_o_auth2_jwt_grant_issuers(opts = {}) data, _status_code, _headers = admin_list_trusted_o_auth2_jwt_grant_issuers_with_http_info(opts) data end # List Trusted OAuth2 JWT Bearer Grant Type Issuers # Use this endpoint to list all trusted JWT Bearer Grant Type Issuers. # @param [Hash] opts the optional parameters # @option opts [Integer] :max_items # @option opts [Integer] :default_items # @option opts [String] :issuer If optional \"issuer\" is supplied, only jwt-bearer grants with this issuer will be returned. # @option opts [Integer] :limit The maximum amount of policies returned, upper bound is 500 policies # @option opts [Integer] :offset The offset from where to start looking. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def admin_list_trusted_o_auth2_jwt_grant_issuers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_list_trusted_o_auth2_jwt_grant_issuers ...' end # resource path local_var_path = '/admin/trust/grants/jwt-bearer/issuers' # query parameters query_params = opts[:query_params] || {} query_params[:'MaxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil? query_params[:'DefaultItems'] = opts[:'default_items'] if !opts[:'default_items'].nil? query_params[:'issuer'] = opts[:'issuer'] if !opts[:'issuer'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_list_trusted_o_auth2_jwt_grant_issuers", :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_trusted_o_auth2_jwt_grant_issuers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch an Identity # Partially updates an Identity's field using [JSON Patch](https://jsonpatch.com/) NOTE: The fields `id`, `stateChangedAt` and `credentials` are not updateable. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to update # @param [Hash] opts the optional parameters # @option opts [Array] :json_patch # @return [Identity] def admin_patch_identity(id, opts = {}) data, _status_code, _headers = admin_patch_identity_with_http_info(id, opts) data end # Patch an Identity # Partially updates an Identity's field using [JSON Patch](https://jsonpatch.com/) NOTE: The fields `id`, `stateChangedAt` and `credentials` are not updateable. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to update # @param [Hash] opts the optional parameters # @option opts [Array] :json_patch # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers 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 # Patch an OAuth 2.0 Client # Patch an existing OAuth 2.0 Client. 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. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param json_patch [Array] # @param [Hash] opts the optional parameters # @return [OAuth2Client] def admin_patch_o_auth2_client(id, json_patch, opts = {}) data, _status_code, _headers = admin_patch_o_auth2_client_with_http_info(id, json_patch, opts) data end # Patch an OAuth 2.0 Client # Patch an existing OAuth 2.0 Client. 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. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param json_patch [Array] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def admin_patch_o_auth2_client_with_http_info(id, json_patch, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_patch_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 V0alpha2Api.admin_patch_o_auth2_client" end # verify the required parameter 'json_patch' is set if @api_client.config.client_side_validation && json_patch.nil? fail ArgumentError, "Missing the required parameter 'json_patch' when calling V0alpha2Api.admin_patch_o_auth2_client" end # resource path local_var_path = '/admin/clients/{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(json_patch) # return_type return_type = opts[:debug_return_type] || 'OAuth2Client' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_patch_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(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_patch_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reject an OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access resources on his/her behalf. The consent provider must include a reason why the consent was not granted. The response contains a redirect URL which the consent provider should redirect the user-agent to. # @param consent_challenge [String] # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [SuccessfulOAuth2RequestResponse] def admin_reject_o_auth2_consent_request(consent_challenge, opts = {}) data, _status_code, _headers = admin_reject_o_auth2_consent_request_with_http_info(consent_challenge, opts) data end # Reject an OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access resources on his/her behalf. The consent provider must include a reason why the consent was not granted. The response contains a redirect URL which the consent provider should redirect the user-agent to. # @param consent_challenge [String] # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [Array<(SuccessfulOAuth2RequestResponse, Integer, Hash)>] SuccessfulOAuth2RequestResponse data, response status code and response headers def admin_reject_o_auth2_consent_request_with_http_info(consent_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_reject_o_auth2_consent_request ...' end # verify the required parameter 'consent_challenge' is set if @api_client.config.client_side_validation && consent_challenge.nil? fail ArgumentError, "Missing the required parameter 'consent_challenge' when calling V0alpha2Api.admin_reject_o_auth2_consent_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/consent/reject' # query parameters query_params = opts[:query_params] || {} query_params[:'consent_challenge'] = consent_challenge # 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[:'reject_o_auth2_request']) # return_type return_type = opts[:debug_return_type] || 'SuccessfulOAuth2RequestResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_reject_o_auth2_consent_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_reject_o_auth2_consent_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reject an OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the authentication was denied. The response contains a redirect URL which the login provider should redirect the user-agent to. # @param login_challenge [String] # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [SuccessfulOAuth2RequestResponse] def admin_reject_o_auth2_login_request(login_challenge, opts = {}) data, _status_code, _headers = admin_reject_o_auth2_login_request_with_http_info(login_challenge, opts) data end # Reject an OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the authentication was denied. The response contains a redirect URL which the login provider should redirect the user-agent to. # @param login_challenge [String] # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [Array<(SuccessfulOAuth2RequestResponse, Integer, Hash)>] SuccessfulOAuth2RequestResponse data, response status code and response headers def admin_reject_o_auth2_login_request_with_http_info(login_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_reject_o_auth2_login_request ...' end # verify the required parameter 'login_challenge' is set if @api_client.config.client_side_validation && login_challenge.nil? fail ArgumentError, "Missing the required parameter 'login_challenge' when calling V0alpha2Api.admin_reject_o_auth2_login_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/login/reject' # query parameters query_params = opts[:query_params] || {} query_params[:'login_challenge'] = login_challenge # 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[:'reject_o_auth2_request']) # return_type return_type = opts[:debug_return_type] || 'SuccessfulOAuth2RequestResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_reject_o_auth2_login_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_reject_o_auth2_login_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reject an OAuth 2.0 Logout Request # When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny that logout request. No body is required. The response is empty as the logout provider has to chose what action to perform next. # @param logout_challenge [String] # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [nil] def admin_reject_o_auth2_logout_request(logout_challenge, opts = {}) admin_reject_o_auth2_logout_request_with_http_info(logout_challenge, opts) nil end # Reject an OAuth 2.0 Logout Request # When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny that logout request. No body is required. The response is empty as the logout provider has to chose what action to perform next. # @param logout_challenge [String] # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_reject_o_auth2_logout_request_with_http_info(logout_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_reject_o_auth2_logout_request ...' end # verify the required parameter 'logout_challenge' is set if @api_client.config.client_side_validation && logout_challenge.nil? fail ArgumentError, "Missing the required parameter 'logout_challenge' when calling V0alpha2Api.admin_reject_o_auth2_logout_request" end # resource path local_var_path = '/admin/oauth2/auth/requests/logout/reject' # query parameters query_params = opts[:query_params] || {} query_params[:'logout_challenge'] = logout_challenge # 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 # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'reject_o_auth2_request']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_reject_o_auth2_logout_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: V0alpha2Api#admin_reject_o_auth2_logout_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revokes OAuth 2.0 Consent Sessions of a Subject for a Specific OAuth 2.0 Client # This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and invalidates all associated OAuth 2.0 Access Tokens. # @param subject [String] The subject (Subject) whose consent sessions should be deleted. # @param [Hash] opts the optional parameters # @option opts [String] :client If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID # @option opts [Boolean] :all If set to `true` deletes all consent sessions by the Subject that have been granted. # @return [nil] def admin_revoke_o_auth2_consent_sessions(subject, opts = {}) admin_revoke_o_auth2_consent_sessions_with_http_info(subject, opts) nil end # Revokes OAuth 2.0 Consent Sessions of a Subject for a Specific OAuth 2.0 Client # This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and invalidates all associated OAuth 2.0 Access Tokens. # @param subject [String] The subject (Subject) whose consent sessions should be deleted. # @param [Hash] opts the optional parameters # @option opts [String] :client If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID # @option opts [Boolean] :all If set to `true` deletes all consent sessions by the Subject that have been granted. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_revoke_o_auth2_consent_sessions_with_http_info(subject, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_revoke_o_auth2_consent_sessions ...' end # verify the required parameter 'subject' is set if @api_client.config.client_side_validation && subject.nil? fail ArgumentError, "Missing the required parameter 'subject' when calling V0alpha2Api.admin_revoke_o_auth2_consent_sessions" end # resource path local_var_path = '/admin/oauth2/auth/sessions/consent' # query parameters query_params = opts[:query_params] || {} query_params[:'subject'] = subject query_params[:'client'] = opts[:'client'] if !opts[:'client'].nil? query_params[:'all'] = opts[:'all'] if !opts[:'all'].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] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_revoke_o_auth2_consent_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_revoke_o_auth2_consent_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Invalidates All OAuth 2.0 Login Sessions of a Certain User # This endpoint invalidates a subject's authentication session. After revoking the authentication session, the subject has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work with OpenID Connect Front- or Back-channel logout. # @param subject [String] The subject to revoke authentication sessions for. # @param [Hash] opts the optional parameters # @return [nil] def admin_revoke_o_auth2_login_sessions(subject, opts = {}) admin_revoke_o_auth2_login_sessions_with_http_info(subject, opts) nil end # Invalidates All OAuth 2.0 Login Sessions of a Certain User # This endpoint invalidates a subject's authentication session. After revoking the authentication session, the subject has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work with OpenID Connect Front- or Back-channel logout. # @param subject [String] The subject to revoke authentication sessions for. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def admin_revoke_o_auth2_login_sessions_with_http_info(subject, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_revoke_o_auth2_login_sessions ...' end # verify the required parameter 'subject' is set if @api_client.config.client_side_validation && subject.nil? fail ArgumentError, "Missing the required parameter 'subject' when calling V0alpha2Api.admin_revoke_o_auth2_login_sessions" end # resource path local_var_path = '/admin/oauth2/auth/sessions/login' # query parameters query_params = opts[:query_params] || {} query_params[:'subject'] = subject # 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_revoke_o_auth2_login_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_revoke_o_auth2_login_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Trust an OAuth2 JWT Bearer Grant Type Issuer # Use this endpoint to establish a trust relationship for a JWT issuer to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523). # @param [Hash] opts the optional parameters # @option opts [AdminTrustOAuth2JwtGrantIssuerBody] :admin_trust_o_auth2_jwt_grant_issuer_body # @return [TrustedOAuth2JwtGrantIssuer] def admin_trust_o_auth2_jwt_grant_issuer(opts = {}) data, _status_code, _headers = admin_trust_o_auth2_jwt_grant_issuer_with_http_info(opts) data end # Trust an OAuth2 JWT Bearer Grant Type Issuer # Use this endpoint to establish a trust relationship for a JWT issuer to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523). # @param [Hash] opts the optional parameters # @option opts [AdminTrustOAuth2JwtGrantIssuerBody] :admin_trust_o_auth2_jwt_grant_issuer_body # @return [Array<(TrustedOAuth2JwtGrantIssuer, Integer, Hash)>] TrustedOAuth2JwtGrantIssuer data, response status code and response headers def admin_trust_o_auth2_jwt_grant_issuer_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_trust_o_auth2_jwt_grant_issuer ...' end # resource path local_var_path = '/admin/trust/grants/jwt-bearer/issuers' # 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_trust_o_auth2_jwt_grant_issuer_body']) # return_type return_type = opts[:debug_return_type] || 'TrustedOAuth2JwtGrantIssuer' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_trust_o_auth2_jwt_grant_issuer", :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_trust_o_auth2_jwt_grant_issuer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to update # @param [Hash] opts the optional parameters # @option opts [AdminUpdateIdentityBody] :admin_update_identity_body # @return [Identity] def admin_update_identity(id, opts = {}) data, _status_code, _headers = admin_update_identity_with_http_info(id, opts) data end # 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](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to update # @param [Hash] opts the optional parameters # @option opts [AdminUpdateIdentityBody] :admin_update_identity_body # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers 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 # Update a JSON Web Key # Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param kid [String] The JSON Web Key ID (kid) # @param [Hash] opts the optional parameters # @option opts [JsonWebKey] :json_web_key # @return [JsonWebKey] def admin_update_json_web_key(set, kid, opts = {}) data, _status_code, _headers = admin_update_json_web_key_with_http_info(set, kid, opts) data end # Update a JSON Web Key # Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param kid [String] The JSON Web Key ID (kid) # @param [Hash] opts the optional parameters # @option opts [JsonWebKey] :json_web_key # @return [Array<(JsonWebKey, Integer, Hash)>] JsonWebKey data, response status code and response headers def admin_update_json_web_key_with_http_info(set, kid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_update_json_web_key ...' end # verify the required parameter 'set' is set if @api_client.config.client_side_validation && set.nil? fail ArgumentError, "Missing the required parameter 'set' when calling V0alpha2Api.admin_update_json_web_key" end # verify the required parameter 'kid' is set if @api_client.config.client_side_validation && kid.nil? fail ArgumentError, "Missing the required parameter 'kid' when calling V0alpha2Api.admin_update_json_web_key" end # resource path local_var_path = '/admin/keys/{set}/{kid}'.sub('{' + 'set' + '}', CGI.escape(set.to_s)).sub('{' + 'kid' + '}', CGI.escape(kid.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_web_key']) # return_type return_type = opts[:debug_return_type] || 'JsonWebKey' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_update_json_web_key", :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_json_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a JSON Web Key Set # Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param [Hash] opts the optional parameters # @option opts [JsonWebKeySet] :json_web_key_set # @return [JsonWebKeySet] def admin_update_json_web_key_set(set, opts = {}) data, _status_code, _headers = admin_update_json_web_key_set_with_http_info(set, opts) data end # Update a JSON Web Key Set # Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. # @param set [String] The JSON Web Key Set # @param [Hash] opts the optional parameters # @option opts [JsonWebKeySet] :json_web_key_set # @return [Array<(JsonWebKeySet, Integer, Hash)>] JsonWebKeySet data, response status code and response headers def admin_update_json_web_key_set_with_http_info(set, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_update_json_web_key_set ...' end # verify the required parameter 'set' is set if @api_client.config.client_side_validation && set.nil? fail ArgumentError, "Missing the required parameter 'set' when calling V0alpha2Api.admin_update_json_web_key_set" end # resource path local_var_path = '/admin/keys/{set}'.sub('{' + 'set' + '}', CGI.escape(set.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_web_key_set']) # return_type return_type = opts[:debug_return_type] || 'JsonWebKeySet' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_update_json_web_key_set", :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_json_web_key_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an OAuth 2.0 Client # Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret is used, otherwise a random secret is generated. The secret is echoed in the response. It is not possible to retrieve it later on. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [OAuth2Client] def admin_update_o_auth2_client(id, o_auth2_client, opts = {}) data, _status_code, _headers = admin_update_o_auth2_client_with_http_info(id, o_auth2_client, opts) data end # Update an OAuth 2.0 Client # Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret is used, otherwise a random secret is generated. The secret is echoed in the response. It is not possible to retrieve it later on. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def admin_update_o_auth2_client_with_http_info(id, o_auth2_client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.admin_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 V0alpha2Api.admin_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 V0alpha2Api.admin_update_o_auth2_client" end # resource path local_var_path = '/admin/clients/{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] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.admin_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: V0alpha2Api#admin_update_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a Project # Creates a new project. # @param [Hash] opts the optional parameters # @option opts [CreateProjectBody] :create_project_body # @return [Project] def create_project(opts = {}) data, _status_code, _headers = create_project_with_http_info(opts) data end # Create a Project # Creates a new project. # @param [Hash] opts the optional parameters # @option opts [CreateProjectBody] :create_project_body # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers 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 API Token # Create an API token for a project. # @param project [String] The Project ID or Project slug # @param [Hash] opts the optional parameters # @option opts [CreateProjectApiKeyRequest] :create_project_api_key_request # @return [ProjectApiKey] def create_project_api_key(project, opts = {}) data, _status_code, _headers = create_project_api_key_with_http_info(project, opts) data end # Create API Token # Create an API token for a project. # @param project [String] The Project ID or Project slug # @param [Hash] opts the optional parameters # @option opts [CreateProjectApiKeyRequest] :create_project_api_key_request # @return [Array<(ProjectApiKey, Integer, Hash)>] ProjectApiKey data, response status code and response headers def create_project_api_key_with_http_info(project, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.create_project_api_key ...' end # verify the required parameter 'project' is set if @api_client.config.client_side_validation && project.nil? fail ArgumentError, "Missing the required parameter 'project' when calling V0alpha2Api.create_project_api_key" end # resource path local_var_path = '/projects/{project}/tokens'.sub('{' + 'project' + '}', CGI.escape(project.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[:'create_project_api_key_request']) # return_type return_type = opts[:debug_return_type] || 'ProjectApiKey' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"V0alpha2Api.create_project_api_key", :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_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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. # @param [Hash] opts the optional parameters # @option opts [String] :cookie HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request. # @return [SelfServiceLogoutUrl] 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 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. # @param [Hash] opts the optional parameters # @option opts [String] :cookie HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request. # @return [Array<(SelfServiceLogoutUrl, Integer, Hash)>] SelfServiceLogoutUrl data, response status code and response headers 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 # Delete API Token # Deletes an API Token and immediately removes it. # @param project [String] The Project ID or Project slug # @param token_id [String] The Token ID # @param [Hash] opts the optional parameters # @return [nil] def delete_project_api_key(project, token_id, opts = {}) delete_project_api_key_with_http_info(project, token_id, opts) nil end # Delete API Token # Deletes an API Token and immediately removes it. # @param project [String] The Project ID or Project slug # @param token_id [String] The Token ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_project_api_key_with_http_info(project, token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.delete_project_api_key ...' end # verify the required parameter 'project' is set if @api_client.config.client_side_validation && project.nil? fail ArgumentError, "Missing the required parameter 'project' when calling V0alpha2Api.delete_project_api_key" end # verify the required parameter 'token_id' is set if @api_client.config.client_side_validation && token_id.nil? fail ArgumentError, "Missing the required parameter 'token_id' when calling V0alpha2Api.delete_project_api_key" end # resource path local_var_path = '/projects/{project}/tokens/{token_id}'.sub('{' + 'project' + '}', CGI.escape(project.to_s)).sub('{' + 'token_id' + '}', CGI.escape(token_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.delete_project_api_key", :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#delete_project_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Discover JSON Web Keys # This endpoint returns JSON Web Keys required to 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](https://github.com/auth0/node-jwks-rsa) among others. # @param [Hash] opts the optional parameters # @return [JsonWebKeySet] def discover_json_web_keys(opts = {}) data, _status_code, _headers = discover_json_web_keys_with_http_info(opts) data end # Discover JSON Web Keys # This endpoint returns JSON Web Keys required to 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](https://github.com/auth0/node-jwks-rsa) among others. # @param [Hash] opts the optional parameters # @return [Array<(JsonWebKeySet, Integer, Hash)>] JsonWebKeySet data, response status code and response headers def discover_json_web_keys_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.discover_json_web_keys ...' 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 => :"V0alpha2Api.discover_json_web_keys", :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#discover_json_web_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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 https://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: https://openid.net/developers/certified/ # @param [Hash] opts the optional parameters # @return [OidcConfiguration] def discover_oidc_configuration(opts = {}) data, _status_code, _headers = discover_oidc_configuration_with_http_info(opts) data end # 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 https://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: https://openid.net/developers/certified/ # @param [Hash] opts the optional parameters # @return [Array<(OidcConfiguration, Integer, Hash)>] OidcConfiguration data, response status code and response headers def discover_oidc_configuration_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.discover_oidc_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] || 'OidcConfiguration' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"V0alpha2Api.discover_oidc_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: V0alpha2Api#discover_oidc_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [OAuth2Client] 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 # 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. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers 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: V0alpha2Api.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 V0alpha2Api.dynamic_client_registration_create_o_auth2_client" end # resource path local_var_path = '/oauth2/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 => :"V0alpha2Api.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: V0alpha2Api#dynamic_client_registration_create_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [nil] def dynamic_client_registration_delete_o_auth2_client(id, opts = {}) dynamic_client_registration_delete_o_auth2_client_with_http_info(id, opts) nil end # 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. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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: V0alpha2Api.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 V0alpha2Api.dynamic_client_registration_delete_o_auth2_client" end # resource path local_var_path = '/oauth2/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] || ['bearer'] new_options = opts.merge( :operation => :"V0alpha2Api.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: V0alpha2Api#dynamic_client_registration_delete_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [OAuth2Client] 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 # 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. # @param id [String] The id of the OAuth 2.0 Client. # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers 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: V0alpha2Api.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 V0alpha2Api.dynamic_client_registration_get_o_auth2_client" end # resource path local_var_path = '/oauth2/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] || ['bearer'] new_options = opts.merge( :operation => :"V0alpha2Api.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: V0alpha2Api#dynamic_client_registration_get_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # 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 is used, otherwise a random secret is generated. The secret is echoed in the response. It is not possible to retrieve it later on. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [OAuth2Client] 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 # 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 is used, otherwise a random secret is generated. The secret is echoed in the response. It is not possible to retrieve it later on. 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. # @param id [String] The id of the OAuth 2.0 Client. # @param o_auth2_client [OAuth2Client] # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers 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: V0alpha2Api.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 V0alpha2Api.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 V0alpha2Api.dynamic_client_registration_update_o_auth2_client" end # resource path local_var_path = '/oauth2/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] || ['bearer'] new_options = opts.merge( :operation => :"V0alpha2Api.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: V0alpha2Api#dynamic_client_registration_update_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a JSON Schema # @param id [String] ID must be set to the ID of schema you want to get # @param [Hash] opts the optional parameters # @return [Object] def get_identity_schema(id, opts = {}) data, _status_code, _headers = get_identity_schema_with_http_info(id, opts) data end # Get a JSON Schema # @param id [String] ID must be set to the ID of schema you want to get # @param [Hash] opts the optional parameters # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers 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] || 'Object' # 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 # 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](http://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](https://datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format. # @param [Hash] opts the optional parameters # @return [OidcUserInfo] def get_oidc_user_info(opts = {}) data, _status_code, _headers = get_oidc_user_info_with_http_info(opts) data end # 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](http://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](https://datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format. # @param [Hash] opts the optional parameters # @return [Array<(OidcUserInfo, Integer, Hash)>] OidcUserInfo data, response status code and response headers def get_oidc_user_info_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: V0alpha2Api.get_oidc_user_info ...' 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] || 'OidcUserInfo' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"V0alpha2Api.get_oidc_user_info", :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_oidc_user_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a Project # Get a projects you have access to by its ID. # @param project_id [String] Project ID The project's ID. # @param [Hash] opts the optional parameters # @return [Project] def get_project(project_id, opts = {}) data, _status_code, _headers = get_project_with_http_info(project_id, opts) data end # Get a Project # Get a projects you have access to by its ID. # @param project_id [String] Project ID The project's ID. # @param [Hash] opts the optional parameters # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers 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 all members associated with this project. # This endpoint requires the user to be a member of the project with the role `OWNER` or `DEVELOPER`. # @param project_id [String] Project ID The project's ID. # @param [Hash] opts the optional parameters # @return [Array] def get_project_members(project_id, opts = {}) data, _status_code, _headers = get_project_members_with_http_info(project_id, opts) data end # 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`. # @param project_id [String] Project ID The project's ID. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers 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' # 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 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](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). # @param id [String] Error is the error's ID # @param [Hash] opts the optional parameters # @return [SelfServiceError] 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 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](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). # @param id [String] Error is the error's ID # @param [Hash] opts the optional parameters # @return [Array<(SelfServiceError, Integer, Hash)>] SelfServiceError data, response status code and response headers 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 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['flow']) res.render('login', flow) }) ``` This request may fail due to several reasons. The `error.id` can be one of: `session_already_available`: The user is already signed in. `self_service_flow_expired`: The flow is expired and you should request a new one. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration). # @param id [String] The Login Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/login?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie 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. # @return [SelfServiceLoginFlow] def get_self_service_login_flow(id, opts = {}) data, _status_code, _headers = get_self_service_login_flow_with_http_info(id, opts) data end # 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['flow']) res.render('login', flow) }) ``` This request may fail due to several reasons. The `error.id` can be one of: `session_already_available`: The user is already signed in. `self_service_flow_expired`: The flow is expired and you should request a new one. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration). # @param id [String] The Login Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/login?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie 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. # @return [Array<(SelfServiceLoginFlow, Integer, Hash)>] SelfServiceLoginFlow data, response status code and response headers def get_self_service_login_flow_with_http_info(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 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['flow']) res.render('recovery', flow) }) ``` More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/recovery?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie 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. # @return [SelfServiceRecoveryFlow] 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 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['flow']) res.render('recovery', flow) }) ``` More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/recovery?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie 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. # @return [Array<(SelfServiceRecoveryFlow, Integer, Hash)>] SelfServiceRecoveryFlow data, response status code and response headers 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 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['flow']) res.render('registration', flow) }) ``` This request may fail due to several reasons. The `error.id` can be one of: `session_already_available`: The user is already signed in. `self_service_flow_expired`: The flow is expired and you should request a new one. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration). # @param id [String] The Registration Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie 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. # @return [SelfServiceRegistrationFlow] 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 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['flow']) res.render('registration', flow) }) ``` This request may fail due to several reasons. The `error.id` can be one of: `session_already_available`: The user is already signed in. `self_service_flow_expired`: The flow is expired and you should request a new one. More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration). # @param id [String] The Registration Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie 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. # @return [Array<(SelfServiceRegistrationFlow, Integer, Hash)>] SelfServiceRegistrationFlow data, response status code and response headers 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 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). # @param id [String] ID is the Settings Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/settings?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :x_session_token The Session Token When using the SDK in an app without a browser, please include the session token here. # @option opts [String] :cookie 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. # @return [SelfServiceSettingsFlow] 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 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). # @param id [String] ID is the Settings Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/settings?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :x_session_token The Session Token When using the SDK in an app without a browser, please include the session token here. # @option opts [String] :cookie 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. # @return [Array<(SelfServiceSettingsFlow, Integer, Hash)>] SelfServiceSettingsFlow data, response status code and response headers 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 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['flow']) res.render('verification', flow) }) More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/verification?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here. # @return [SelfServiceVerificationFlow] 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 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['flow']) res.render('verification', flow) }) More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/verification?flow=abcde`). # @param [Hash] opts the optional parameters # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here. # @return [Array<(SelfServiceVerificationFlow, Integer, Hash)>] SelfServiceVerificationFlow data, response status code and response headers 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 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