Class: SMARTAppLaunch::TokenRefreshTest
- Inherits:
-
Inferno::Test
- Object
- Inferno::Test
- SMARTAppLaunch::TokenRefreshTest
- Includes:
- TokenPayloadValidation
- Defined in:
- lib/smart_app_launch/token_refresh_test.rb
Direct Known Subclasses
Constant Summary
Constants included from TokenPayloadValidation
SMARTAppLaunch::TokenPayloadValidation::FHIR_ID_REGEX, SMARTAppLaunch::TokenPayloadValidation::FHIR_RESOURCE_TYPES, SMARTAppLaunch::TokenPayloadValidation::NUMERIC_FIELDS, SMARTAppLaunch::TokenPayloadValidation::STRING_FIELDS
Instance Method Summary collapse
- #add_credentials_to_request(oauth2_headers, oauth2_params) ⇒ Object
- #make_auth_token_request(smart_token_url, oauth2_params, oauth2_headers) ⇒ Object
Methods included from TokenPayloadValidation
#check_fhir_context_canonical, #check_fhir_context_identifier, #check_fhir_context_reference, #check_for_missing_scopes, #validate_fhir_context, #validate_fhir_context_stu2_2, #validate_required_fields_present, #validate_scope_subset, #validate_token_field_types, #validate_token_type
Instance Method Details
#add_credentials_to_request(oauth2_headers, oauth2_params) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/smart_app_launch/token_refresh_test.rb', line 24 def add_credentials_to_request(oauth2_headers, oauth2_params) if client_secret.present? credentials = Base64.strict_encode64("#{client_id}:#{client_secret}") oauth2_headers['Authorization'] = "Basic #{credentials}" else oauth2_params['client_id'] = client_id end end |
#make_auth_token_request(smart_token_url, oauth2_params, oauth2_headers) ⇒ Object
33 34 35 |
# File 'lib/smart_app_launch/token_refresh_test.rb', line 33 def make_auth_token_request(smart_token_url, oauth2_params, oauth2_headers) post(smart_token_url, body: oauth2_params, name: :token_refresh, headers: oauth2_headers) end |