Class: SMARTAppLaunch::TokenRefreshSTU2Test

Inherits:
TokenRefreshTest show all
Includes:
TokenPayloadValidation
Defined in:
lib/smart_app_launch/token_refresh_stu2_test.rb

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

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

Methods inherited from TokenRefreshTest

#make_auth_token_request

Instance Method Details

#add_credentials_to_request(oauth2_headers, oauth2_params) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/smart_app_launch/token_refresh_stu2_test.rb', line 23

def add_credentials_to_request(oauth2_headers, oauth2_params)
  if smart_auth_info.asymmetric_auth?
    oauth2_params.merge!(
      client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
      client_assertion: ClientAssertionBuilder.build(
        iss: smart_auth_info.client_id,
        sub: smart_auth_info.client_id,
        aud: smart_auth_info.token_url,
        client_auth_encryption_method: smart_auth_info.encryption_algorithm,
        custom_jwks: smart_auth_info.jwks
      )
    )
  else
    super
  end
end