=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: v1.6.2 Contact: support@ory.sh Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.1 =end require 'cgi' module OryClient class OAuth2Api attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Accept OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell Ory 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 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 if the subject accepted or rejected the request. This endpoint tells Ory 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. The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please head over to the OAuth 2.0 documentation. # @param consent_challenge [String] OAuth 2.0 Consent Request Challenge # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2ConsentRequest] :accept_o_auth2_consent_request # @return [OAuth2RedirectTo] def accept_o_auth2_consent_request(consent_challenge, opts = {}) data, _status_code, _headers = accept_o_auth2_consent_request_with_http_info(consent_challenge, opts) data end # Accept OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell Ory 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 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 if the subject accepted or rejected the request. This endpoint tells Ory 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. The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please head over to the OAuth 2.0 documentation. # @param consent_challenge [String] OAuth 2.0 Consent Request Challenge # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2ConsentRequest] :accept_o_auth2_consent_request # @return [Array<(OAuth2RedirectTo, Integer, Hash)>] OAuth2RedirectTo data, response status code and response headers def accept_o_auth2_consent_request_with_http_info(consent_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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] || 'OAuth2RedirectTo' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"OAuth2Api.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: OAuth2Api#accept_o_auth2_consent_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Accept OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell the Ory OAuth2 Service about it. 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 that the subject has successfully authenticated and includes additional information such as the subject's ID and if Ory 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] OAuth 2.0 Login Request Challenge # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2LoginRequest] :accept_o_auth2_login_request # @return [OAuth2RedirectTo] def accept_o_auth2_login_request(login_challenge, opts = {}) data, _status_code, _headers = accept_o_auth2_login_request_with_http_info(login_challenge, opts) data end # Accept OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell the Ory OAuth2 Service about it. 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 that the subject has successfully authenticated and includes additional information such as the subject's ID and if Ory 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] OAuth 2.0 Login Request Challenge # @param [Hash] opts the optional parameters # @option opts [AcceptOAuth2LoginRequest] :accept_o_auth2_login_request # @return [Array<(OAuth2RedirectTo, Integer, Hash)>] OAuth2RedirectTo data, response status code and response headers def accept_o_auth2_login_request_with_http_info(login_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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] || 'OAuth2RedirectTo' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"OAuth2Api.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: OAuth2Api#accept_o_auth2_login_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Accept OAuth 2.0 Session Logout Request # When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, 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] OAuth 2.0 Logout Request Challenge # @param [Hash] opts the optional parameters # @return [OAuth2RedirectTo] def accept_o_auth2_logout_request(logout_challenge, opts = {}) data, _status_code, _headers = accept_o_auth2_logout_request_with_http_info(logout_challenge, opts) data end # Accept OAuth 2.0 Session Logout Request # When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, 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] OAuth 2.0 Logout Request Challenge # @param [Hash] opts the optional parameters # @return [Array<(OAuth2RedirectTo, Integer, Hash)>] OAuth2RedirectTo data, response status code and response headers def accept_o_auth2_logout_request_with_http_info(logout_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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] || 'OAuth2RedirectTo' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"OAuth2Api.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: OAuth2Api#accept_o_auth2_logout_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create 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. # @param o_auth2_client [OAuth2Client] OAuth 2.0 Client Request Body # @param [Hash] opts the optional parameters # @return [OAuth2Client] def create_o_auth2_client(o_auth2_client, opts = {}) data, _status_code, _headers = create_o_auth2_client_with_http_info(o_auth2_client, opts) data end # Create 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. # @param o_auth2_client [OAuth2Client] OAuth 2.0 Client Request Body # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def create_o_auth2_client_with_http_info(o_auth2_client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#create_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete 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 delete_o_auth2_client(id, opts = {}) delete_o_auth2_client_with_http_info(id, opts) nil end # Delete 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 delete_o_auth2_client_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#delete_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client # This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database. # @param client_id [String] OAuth 2.0 Client ID # @param [Hash] opts the optional parameters # @return [nil] def delete_o_auth2_token(client_id, opts = {}) delete_o_auth2_token_with_http_info(client_id, opts) nil end # Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client # This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database. # @param client_id [String] OAuth 2.0 Client ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_o_auth2_token_with_http_info(client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#delete_o_auth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete 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 delete_trusted_o_auth2_jwt_grant_issuer(id, opts = {}) delete_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts) nil end # Delete 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 delete_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#delete_trusted_o_auth2_jwt_grant_issuer\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 get_o_auth2_client(id, opts = {}) data, _status_code, _headers = 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 get_o_auth2_client_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#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 # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell Ory 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 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 if the subject accepted or rejected the request. The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please head over to the OAuth 2.0 documentation. # @param consent_challenge [String] OAuth 2.0 Consent Request Challenge # @param [Hash] opts the optional parameters # @return [OAuth2ConsentRequest] def get_o_auth2_consent_request(consent_challenge, opts = {}) data, _status_code, _headers = get_o_auth2_consent_request_with_http_info(consent_challenge, opts) data end # Get OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell Ory 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 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 if the subject accepted or rejected the request. The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please head over to the OAuth 2.0 documentation. # @param consent_challenge [String] OAuth 2.0 Consent Request Challenge # @param [Hash] opts the optional parameters # @return [Array<(OAuth2ConsentRequest, Integer, Hash)>] OAuth2ConsentRequest data, response status code and response headers def get_o_auth2_consent_request_with_http_info(consent_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#get_o_auth2_consent_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell the Ory OAuth2 Service about it. Per default, the login provider is Ory itself. You may use a different login provider which needs to be a 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] OAuth 2.0 Login Request Challenge # @param [Hash] opts the optional parameters # @return [OAuth2LoginRequest] def get_o_auth2_login_request(login_challenge, opts = {}) data, _status_code, _headers = get_o_auth2_login_request_with_http_info(login_challenge, opts) data end # Get OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell the Ory OAuth2 Service about it. Per default, the login provider is Ory itself. You may use a different login provider which needs to be a 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] OAuth 2.0 Login Request Challenge # @param [Hash] opts the optional parameters # @return [Array<(OAuth2LoginRequest, Integer, Hash)>] OAuth2LoginRequest data, response status code and response headers def get_o_auth2_login_request_with_http_info(login_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#get_o_auth2_login_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get OAuth 2.0 Session Logout Request # Use this endpoint to fetch an Ory OAuth 2.0 logout request. # @param logout_challenge [String] # @param [Hash] opts the optional parameters # @return [OAuth2LogoutRequest] def get_o_auth2_logout_request(logout_challenge, opts = {}) data, _status_code, _headers = get_o_auth2_logout_request_with_http_info(logout_challenge, opts) data end # Get OAuth 2.0 Session Logout Request # Use this endpoint to fetch an Ory OAuth 2.0 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 get_o_auth2_logout_request_with_http_info(logout_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#get_o_auth2_logout_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get 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 get_trusted_o_auth2_jwt_grant_issuer(id, opts = {}) data, _status_code, _headers = get_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts) data end # Get 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 get_trusted_o_auth2_jwt_grant_issuer_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#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 and 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 `session.access_token` during the consent flow. # @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 introspect_o_auth2_token(token, opts = {}) data, _status_code, _headers = introspect_o_auth2_token_with_http_info(token, opts) data end # Introspect OAuth2 Access and 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 `session.access_token` during the consent flow. # @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 introspect_o_auth2_token_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#introspect_o_auth2_token\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. # @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 list_o_auth2_clients(opts = {}) data, _status_code, _headers = 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. # @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 list_o_auth2_clients_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.list_o_auth2_clients ...' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OAuth2Api.list_o_auth2_clients, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#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. # @param subject [String] The subject to list the consent sessions for. # @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] :login_session_id The login session id to list the consent sessions for. # @return [Array] def list_o_auth2_consent_sessions(subject, opts = {}) data, _status_code, _headers = list_o_auth2_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. # @param subject [String] The subject to list the consent sessions for. # @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] :login_session_id The login session id to list the consent sessions for. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_o_auth2_consent_sessions_with_http_info(subject, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.list_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 OAuth2Api.list_o_auth2_consent_sessions" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OAuth2Api.list_o_auth2_consent_sessions, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OAuth2Api.list_o_auth2_consent_sessions, must be greater than or equal to 1.' end # resource path local_var_path = '/admin/oauth2/auth/sessions/consent' # query parameters query_params = opts[:query_params] || {} query_params[:'subject'] = subject 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[:'login_session_id'] = opts[:'login_session_id'] if !opts[:'login_session_id'].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 => :"OAuth2Api.list_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(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: OAuth2Api#list_o_auth2_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. # @return [Array] def list_trusted_o_auth2_jwt_grant_issuers(opts = {}) data, _status_code, _headers = 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. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_trusted_o_auth2_jwt_grant_issuers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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? # 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 => :"OAuth2Api.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: OAuth2Api#list_trusted_o_auth2_jwt_grant_issuers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # OAuth 2.0 Authorize Endpoint # Use open source libraries to perform OAuth 2.0 and OpenID Connect available for any programming language. You can find a list of libraries at https://oauth.net/code/ The Ory SDK is not yet able to this endpoint properly. # @param [Hash] opts the optional parameters # @return [ErrorOAuth2] def o_auth2_authorize(opts = {}) data, _status_code, _headers = o_auth2_authorize_with_http_info(opts) data end # OAuth 2.0 Authorize Endpoint # Use open source libraries to perform OAuth 2.0 and OpenID Connect available for any programming language. You can find a list of libraries at https://oauth.net/code/ The Ory SDK is not yet able to this endpoint properly. # @param [Hash] opts the optional parameters # @return [Array<(ErrorOAuth2, Integer, Hash)>] ErrorOAuth2 data, response status code and response headers def o_auth2_authorize_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.o_auth2_authorize ...' end # resource path local_var_path = '/oauth2/auth' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ErrorOAuth2' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"OAuth2Api.o_auth2_authorize", :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: OAuth2Api#o_auth2_authorize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # The OAuth 2.0 Token Endpoint # Use open source libraries to perform OAuth 2.0 and OpenID Connect available for any programming language. You can find a list of libraries here https://oauth.net/code/ The Ory SDK is not yet able to this endpoint properly. # @param grant_type [String] # @param [Hash] opts the optional parameters # @option opts [String] :client_id # @option opts [String] :code # @option opts [String] :redirect_uri # @option opts [String] :refresh_token # @return [OAuth2TokenExchange] def oauth2_token_exchange(grant_type, opts = {}) data, _status_code, _headers = oauth2_token_exchange_with_http_info(grant_type, opts) data end # The OAuth 2.0 Token Endpoint # Use open source libraries to perform OAuth 2.0 and OpenID Connect available for any programming language. You can find a list of libraries here https://oauth.net/code/ The Ory SDK is not yet able to this endpoint properly. # @param grant_type [String] # @param [Hash] opts the optional parameters # @option opts [String] :client_id # @option opts [String] :code # @option opts [String] :redirect_uri # @option opts [String] :refresh_token # @return [Array<(OAuth2TokenExchange, Integer, Hash)>] OAuth2TokenExchange data, response status code and response headers def oauth2_token_exchange_with_http_info(grant_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.oauth2_token_exchange ...' end # verify the required parameter 'grant_type' is set if @api_client.config.client_side_validation && grant_type.nil? fail ArgumentError, "Missing the required parameter 'grant_type' when calling OAuth2Api.oauth2_token_exchange" end # resource path local_var_path = '/oauth2/token' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['grant_type'] = grant_type form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil? form_params['code'] = opts[:'code'] if !opts[:'code'].nil? form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil? form_params['refresh_token'] = opts[:'refresh_token'] if !opts[:'refresh_token'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OAuth2TokenExchange' # auth_names auth_names = opts[:debug_auth_names] || ['basic', 'oauth2'] new_options = opts.merge( :operation => :"OAuth2Api.oauth2_token_exchange", :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: OAuth2Api#oauth2_token_exchange\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch OAuth 2.0 Client # Patch an existing OAuth 2.0 Client using JSON Patch. 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] OAuth 2.0 Client JSON Patch Body # @param [Hash] opts the optional parameters # @return [OAuth2Client] def patch_o_auth2_client(id, json_patch, opts = {}) data, _status_code, _headers = patch_o_auth2_client_with_http_info(id, json_patch, opts) data end # Patch OAuth 2.0 Client # Patch an existing OAuth 2.0 Client using JSON Patch. 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] OAuth 2.0 Client JSON Patch Body # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def patch_o_auth2_client_with_http_info(id, json_patch, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#patch_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reject OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell Ory 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 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 if the subject accepted or rejected the request. This endpoint tells Ory 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. The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please head over to the OAuth 2.0 documentation. # @param consent_challenge [String] OAuth 2.0 Consent Request Challenge # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [OAuth2RedirectTo] def reject_o_auth2_consent_request(consent_challenge, opts = {}) data, _status_code, _headers = reject_o_auth2_consent_request_with_http_info(consent_challenge, opts) data end # Reject OAuth 2.0 Consent Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell Ory 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 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 if the subject accepted or rejected the request. This endpoint tells Ory 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. The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please head over to the OAuth 2.0 documentation. # @param consent_challenge [String] OAuth 2.0 Consent Request Challenge # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [Array<(OAuth2RedirectTo, Integer, Hash)>] OAuth2RedirectTo data, response status code and response headers def reject_o_auth2_consent_request_with_http_info(consent_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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] || 'OAuth2RedirectTo' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"OAuth2Api.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: OAuth2Api#reject_o_auth2_consent_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reject OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell the Ory OAuth2 Service about it. 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 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] OAuth 2.0 Login Request Challenge # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [OAuth2RedirectTo] def reject_o_auth2_login_request(login_challenge, opts = {}) data, _status_code, _headers = reject_o_auth2_login_request_with_http_info(login_challenge, opts) data end # Reject OAuth 2.0 Login Request # When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider to authenticate the subject and then tell the Ory OAuth2 Service about it. 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 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] OAuth 2.0 Login Request Challenge # @param [Hash] opts the optional parameters # @option opts [RejectOAuth2Request] :reject_o_auth2_request # @return [Array<(OAuth2RedirectTo, Integer, Hash)>] OAuth2RedirectTo data, response status code and response headers def reject_o_auth2_login_request_with_http_info(login_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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] || 'OAuth2RedirectTo' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"OAuth2Api.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: OAuth2Api#reject_o_auth2_login_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reject OAuth 2.0 Session Logout Request # When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this endpoint is used to deny that logout request. No HTTP request 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 # @return [nil] def reject_o_auth2_logout_request(logout_challenge, opts = {}) reject_o_auth2_logout_request_with_http_info(logout_challenge, opts) nil end # Reject OAuth 2.0 Session Logout Request # When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this endpoint is used to deny that logout request. No HTTP request 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 # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def reject_o_auth2_logout_request_with_http_info(logout_challenge, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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']) # 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 => :"OAuth2Api.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: OAuth2Api#reject_o_auth2_logout_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revoke OAuth 2.0 Consent Sessions of a Subject # This endpoint revokes a subject's granted consent sessions and invalidates all associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0 Client ID. # @param subject [String] OAuth 2.0 Consent Subject The subject whose consent sessions should be deleted. # @param [Hash] opts the optional parameters # @option opts [String] :client OAuth 2.0 Client ID If set, deletes only those consent sessions that have been granted to the specified OAuth 2.0 Client ID. # @option opts [Boolean] :all Revoke All Consent Sessions If set to `true` deletes all consent sessions by the Subject that have been granted. # @return [nil] def revoke_o_auth2_consent_sessions(subject, opts = {}) revoke_o_auth2_consent_sessions_with_http_info(subject, opts) nil end # Revoke OAuth 2.0 Consent Sessions of a Subject # This endpoint revokes a subject's granted consent sessions and invalidates all associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0 Client ID. # @param subject [String] OAuth 2.0 Consent Subject The subject whose consent sessions should be deleted. # @param [Hash] opts the optional parameters # @option opts [String] :client OAuth 2.0 Client ID If set, deletes only those consent sessions that have been granted to the specified OAuth 2.0 Client ID. # @option opts [Boolean] :all Revoke All Consent Sessions 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 revoke_o_auth2_consent_sessions_with_http_info(subject, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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 OAuth2Api.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 => :"OAuth2Api.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: OAuth2Api#revoke_o_auth2_consent_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revokes OAuth 2.0 Login Sessions by either a Subject or a SessionID # This endpoint invalidates authentication sessions. After revoking the authentication session(s), the subject has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens. If you send the subject in a query param, all authentication sessions that belong to that subject are revoked. No OpenID Connect Front- or Back-channel logout is performed in this case. Alternatively, you can send a SessionID via `sid` query param, in which case, only the session that is connected to that SessionID is revoked. OpenID Connect Back-channel logout is performed in this case. # @param [Hash] opts the optional parameters # @option opts [String] :subject OAuth 2.0 Subject The subject to revoke authentication sessions for. # @option opts [String] :sid OAuth 2.0 Subject The subject to revoke authentication sessions for. # @return [nil] def revoke_o_auth2_login_sessions(opts = {}) revoke_o_auth2_login_sessions_with_http_info(opts) nil end # Revokes OAuth 2.0 Login Sessions by either a Subject or a SessionID # This endpoint invalidates authentication sessions. After revoking the authentication session(s), the subject has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens. If you send the subject in a query param, all authentication sessions that belong to that subject are revoked. No OpenID Connect Front- or Back-channel logout is performed in this case. Alternatively, you can send a SessionID via `sid` query param, in which case, only the session that is connected to that SessionID is revoked. OpenID Connect Back-channel logout is performed in this case. # @param [Hash] opts the optional parameters # @option opts [String] :subject OAuth 2.0 Subject The subject to revoke authentication sessions for. # @option opts [String] :sid OAuth 2.0 Subject The subject to revoke authentication sessions for. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def revoke_o_auth2_login_sessions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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'] = opts[:'subject'] if !opts[:'subject'].nil? query_params[:'sid'] = opts[:'sid'] if !opts[:'sid'].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 => :"OAuth2Api.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: OAuth2Api#revoke_o_auth2_login_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revoke OAuth 2.0 Access or Refresh Token # Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. # @param token [String] # @param [Hash] opts the optional parameters # @option opts [String] :client_id # @option opts [String] :client_secret # @return [nil] def revoke_o_auth2_token(token, opts = {}) revoke_o_auth2_token_with_http_info(token, opts) nil end # Revoke OAuth 2.0 Access or Refresh Token # Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. # @param token [String] # @param [Hash] opts the optional parameters # @option opts [String] :client_id # @option opts [String] :client_secret # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def revoke_o_auth2_token_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.revoke_o_auth2_token ...' end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OAuth2Api.revoke_o_auth2_token" end # resource path local_var_path = '/oauth2/revoke' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['token'] = token form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil? form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['basic', 'oauth2'] new_options = opts.merge( :operation => :"OAuth2Api.revoke_o_auth2_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: OAuth2Api#revoke_o_auth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set OAuth 2.0 Client # Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, 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] OAuth 2.0 Client ID # @param o_auth2_client [OAuth2Client] OAuth 2.0 Client Request Body # @param [Hash] opts the optional parameters # @return [OAuth2Client] def set_o_auth2_client(id, o_auth2_client, opts = {}) data, _status_code, _headers = set_o_auth2_client_with_http_info(id, o_auth2_client, opts) data end # Set OAuth 2.0 Client # Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, 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] OAuth 2.0 Client ID # @param o_auth2_client [OAuth2Client] OAuth 2.0 Client Request Body # @param [Hash] opts the optional parameters # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def set_o_auth2_client_with_http_info(id, o_auth2_client, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.set_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 OAuth2Api.set_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 OAuth2Api.set_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 => :"OAuth2Api.set_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: OAuth2Api#set_o_auth2_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set OAuth2 Client Token Lifespans # Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other fields. # @param id [String] OAuth 2.0 Client ID # @param [Hash] opts the optional parameters # @option opts [OAuth2ClientTokenLifespans] :o_auth2_client_token_lifespans # @return [OAuth2Client] def set_o_auth2_client_lifespans(id, opts = {}) data, _status_code, _headers = set_o_auth2_client_lifespans_with_http_info(id, opts) data end # Set OAuth2 Client Token Lifespans # Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other fields. # @param id [String] OAuth 2.0 Client ID # @param [Hash] opts the optional parameters # @option opts [OAuth2ClientTokenLifespans] :o_auth2_client_token_lifespans # @return [Array<(OAuth2Client, Integer, Hash)>] OAuth2Client data, response status code and response headers def set_o_auth2_client_lifespans_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.set_o_auth2_client_lifespans ...' 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 OAuth2Api.set_o_auth2_client_lifespans" end # resource path local_var_path = '/admin/clients/{id}/lifespans'.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[:'o_auth2_client_token_lifespans']) # return_type return_type = opts[:debug_return_type] || 'OAuth2Client' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"OAuth2Api.set_o_auth2_client_lifespans", :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: OAuth2Api#set_o_auth2_client_lifespans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Trust 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 [TrustOAuth2JwtGrantIssuer] :trust_o_auth2_jwt_grant_issuer # @return [TrustedOAuth2JwtGrantIssuer] def trust_o_auth2_jwt_grant_issuer(opts = {}) data, _status_code, _headers = trust_o_auth2_jwt_grant_issuer_with_http_info(opts) data end # Trust 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 [TrustOAuth2JwtGrantIssuer] :trust_o_auth2_jwt_grant_issuer # @return [Array<(TrustedOAuth2JwtGrantIssuer, Integer, Hash)>] TrustedOAuth2JwtGrantIssuer data, response status code and response headers def trust_o_auth2_jwt_grant_issuer_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OAuth2Api.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[:'trust_o_auth2_jwt_grant_issuer']) # return_type return_type = opts[:debug_return_type] || 'TrustedOAuth2JwtGrantIssuer' # auth_names auth_names = opts[:debug_auth_names] || ['oryAccessToken'] new_options = opts.merge( :operation => :"OAuth2Api.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: OAuth2Api#trust_o_auth2_jwt_grant_issuer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end