Class: SMARTAppLaunch::TokenExchangeTest

Inherits:
Inferno::Test
  • Object
show all
Defined in:
lib/smart_app_launch/token_exchange_test.rb

Direct Known Subclasses

TokenExchangeSTU2Test

Instance Method Summary collapse

Instance Method Details

#add_credentials_to_request(oauth2_params, oauth2_headers) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/smart_app_launch/token_exchange_test.rb', line 29

def add_credentials_to_request(oauth2_params, oauth2_headers)
  if smart_auth_info.symmetric_auth?
    client_credentials = "#{smart_auth_info.client_id}:#{smart_auth_info.client_secret}"
    oauth2_headers['Authorization'] = "Basic #{Base64.strict_encode64(client_credentials)}"
  else
    oauth2_params[:client_id] = smart_auth_info.client_id
  end
end

#default_redirect_uriObject



21
22
23
# File 'lib/smart_app_launch/token_exchange_test.rb', line 21

def default_redirect_uri
  "#{Inferno::Application['base_url']}/custom/smart/redirect"
end

#redirect_uriObject



25
26
27
# File 'lib/smart_app_launch/token_exchange_test.rb', line 25

def redirect_uri
  config.options[:redirect_uri].presence || default_redirect_uri
end