Skip to content

Commit

Permalink
FI-3257: Use Custom Authorization Header Input in Invalid Token Test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
emichaud998 authored Oct 11, 2024
1 parent 621866b commit 15cbe43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/smart_app_launch/token_introspection_request_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ class SMARTTokenIntrospectionRequestGroup < Inferno::TestGroup

headers = { 'Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded' }
body = 'token=invalid_token_value'

if custom_authorization_header.present?
custom_headers = custom_authorization_header.split("\n")
custom_headers.each do |custom_header|
parsed_header = custom_header.split(':', 2)
assert parsed_header.length == 2,
'Incorrect custom HTTP header format input, expected: "<header name>: <header value>"'
headers[parsed_header[0]] = parsed_header[1].strip
end
end

post(well_known_introspection_url, body:, headers:)

assert_response_status(200)
Expand Down

0 comments on commit 15cbe43

Please # to comment.