Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FI-3257: Use Custom Authorization Header Input in Invalid Token Test #81

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading