Class: SMARTAppLaunch::TokenExchangeTest
- Inherits:
-
Inferno::Test
- Object
- Inferno::Test
- SMARTAppLaunch::TokenExchangeTest
- Defined in:
- lib/smart_app_launch/token_exchange_test.rb
Direct Known Subclasses
Instance Method Summary collapse
- #add_credentials_to_request(oauth2_params, oauth2_headers) ⇒ Object
- #default_redirect_uri ⇒ Object
- #redirect_uri ⇒ Object
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_uri ⇒ Object
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_uri ⇒ Object
25 26 27 |
# File 'lib/smart_app_launch/token_exchange_test.rb', line 25 def redirect_uri config.[:redirect_uri].presence || default_redirect_uri end |