class UltracartClient::SsoApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/ultracart_api/api/sso_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end
new_using_api_key(simple_key, verify_ssl = true, debugging = false) click to toggle source
# File lib/ultracart_api/api/sso_api.rb, line 23
def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::SsoApi.new(api_client)
end

Public Instance Methods

get_sso_session_user(opts = {}) click to toggle source

Get single sign on session user This is the equivalent of logging out of the single sign on session @param [Hash] opts the optional parameters @return [User]

# File lib/ultracart_api/api/sso_api.rb, line 39
def get_sso_session_user(opts = {})
  data, _status_code, _headers = get_sso_session_user_with_http_info(opts)
  data
end
get_sso_session_user_with_http_info(opts = {}) click to toggle source

Get single sign on session user This is the equivalent of logging out of the single sign on session @param [Hash] opts the optional parameters @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers

# File lib/ultracart_api/api/sso_api.rb, line 48
def get_sso_session_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.get_sso_session_user ...'
  end
  # resource path
  local_var_path = '/sso/session/user'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'User')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SsoApi#get_sso_session_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sso_authorize(authorization_request, opts = {}) click to toggle source

Authorize a single sign on session Starts the process of authorizing a single sign on session. @param authorization_request Authorization request @param [Hash] opts the optional parameters @return [SingleSignOnAuthorizeResponse]

# File lib/ultracart_api/api/sso_api.rb, line 89
def sso_authorize(authorization_request, opts = {})
  data, _status_code, _headers = sso_authorize_with_http_info(authorization_request, opts)
  data
end
sso_authorize_with_http_info(authorization_request, opts = {}) click to toggle source

Authorize a single sign on session Starts the process of authorizing a single sign on session. @param authorization_request Authorization request @param [Hash] opts the optional parameters @return [Array<(SingleSignOnAuthorizeResponse, Fixnum, Hash)>] SingleSignOnAuthorizeResponse data, response status code and response headers

# File lib/ultracart_api/api/sso_api.rb, line 99
def sso_authorize_with_http_info(authorization_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.sso_authorize ...'
  end
  # verify the required parameter 'authorization_request' is set
  if @api_client.config.client_side_validation && authorization_request.nil?
    fail ArgumentError, "Missing the required parameter 'authorization_request' when calling SsoApi.sso_authorize"
  end
  # resource path
  local_var_path = '/sso/authorize'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(authorization_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SingleSignOnAuthorizeResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SsoApi#sso_authorize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sso_session_revoke(opts = {}) click to toggle source

Revoke single sign on session This is the equivalent of logging out of the single sign on session @param [Hash] opts the optional parameters @return [nil]

# File lib/ultracart_api/api/sso_api.rb, line 143
def sso_session_revoke(opts = {})
  sso_session_revoke_with_http_info(opts)
  nil
end
sso_session_revoke_with_http_info(opts = {}) click to toggle source

Revoke single sign on session This is the equivalent of logging out of the single sign on session @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/ultracart_api/api/sso_api.rb, line 152
def sso_session_revoke_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.sso_session_revoke ...'
  end
  # resource path
  local_var_path = '/sso/session/revoke'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SsoApi#sso_session_revoke\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sso_token(token_request, opts = {}) click to toggle source

Exchange a single sign on code for a simple key token Called by your application after receiving the code back on the redirect URI to obtain a simple key token to make API calls with @param token_request Token request @param [Hash] opts the optional parameters @return [SingleSignOnTokenResponse]

# File lib/ultracart_api/api/sso_api.rb, line 192
def sso_token(token_request, opts = {})
  data, _status_code, _headers = sso_token_with_http_info(token_request, opts)
  data
end
sso_token_with_http_info(token_request, opts = {}) click to toggle source

Exchange a single sign on code for a simple key token Called by your application after receiving the code back on the redirect URI to obtain a simple key token to make API calls with @param token_request Token request @param [Hash] opts the optional parameters @return [Array<(SingleSignOnTokenResponse, Fixnum, Hash)>] SingleSignOnTokenResponse data, response status code and response headers

# File lib/ultracart_api/api/sso_api.rb, line 202
def sso_token_with_http_info(token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.sso_token ...'
  end
  # verify the required parameter 'token_request' is set
  if @api_client.config.client_side_validation && token_request.nil?
    fail ArgumentError, "Missing the required parameter 'token_request' when calling SsoApi.sso_token"
  end
  # resource path
  local_var_path = '/sso/token'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(token_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SingleSignOnTokenResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SsoApi#sso_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end