Class: StytchB2B::Organizations::Members::ConnectedApps

Inherits:
Object
  • Object
show all
Includes:
Stytch::RequestHelper
Defined in:
lib/stytch/b2b_organizations.rb

Defined Under Namespace

Classes: RevokeRequestOptions

Instance Method Summary collapse

Methods included from Stytch::RequestHelper

#delete_request, #get_request, #post_request, #put_request, #request_with_query_params

Constructor Details

#initialize(connection) ⇒ ConnectedApps

Returns a new instance of ConnectedApps.



2051
2052
2053
# File 'lib/stytch/b2b_organizations.rb', line 2051

def initialize(connection)
  @connection = connection
end

Instance Method Details

#revoke(organization_id:, member_id:, connected_app_id:, method_options: nil) ⇒ Object

Revoke Connected App revokes a Connected App’s access to a Member and revokes all active tokens that have been created on the Member’s behalf. New tokens cannot be created until the Member completes a new authorization flow with the Connected App.

Parameters:

organization_id

Globally unique UUID that identifies a specific Organization. The ‘organization_id` is critical to perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id here as a convenience. The type of this field is String.

member_id

Globally unique UUID that identifies a specific Member. The ‘member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. The type of this field is String.

connected_app_id

The ID of the Connected App. The type of this field is String.

Returns:

An object with the following fields:

request_id

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. The type of this field is String.

status_code

(no documentation yet) The type of this field is Integer.

Method Options:

This method supports an optional StytchB2B::Organizations::Members::ConnectedApps::RevokeRequestOptions object which will modify the headers sent in the HTTP request.



2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
# File 'lib/stytch/b2b_organizations.rb', line 2081

def revoke(
  organization_id:,
  member_id:,
  connected_app_id:,
  method_options: nil
)
  headers = {}
  headers = headers.merge(method_options.to_headers) unless method_options.nil?
  request = {}

  post_request("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/connected_apps/#{connected_app_id}/revoke", request, headers)
end