Skip to content

Commit

Permalink
chore: Add test case for PKCE support
Browse files Browse the repository at this point in the history
  • Loading branch information
bajajneha27 committed Jan 30, 2024
1 parent f1d6a77 commit 829a7d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/signet/oauth_2/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,12 @@ def build_form_encoded_response payload
})
end

it "should use code_verifier if passed in additional_parameters when generating authorization_uri" do
@client.update! additional_parameters: { code_verifier: "IeJRY4uem0581Lcw6CiZ3fNwngg" }
expect(@client.additional_parameters).to eq ({ code_verifier: "IeJRY4uem0581Lcw6CiZ3fNwngg" })
expect(@client.authorization_uri.query).to match (/code_verifier=/)
end

it "should merge new authorization_uri custom parameters" do
expect(@client.authorization_uri(additional_parameters: { "type" => "new_type", "new_param" => "new_val" }).query_values).to eql({ "access_type" => "offline", "client_id" => "s6BhdRkqt3", "new_param" => "new_val", "response_type" => "code", "redirect_uri" => "https://example.client.com/callback", "type" => "new_type" })
end
Expand Down

0 comments on commit 829a7d0

Please sign in to comment.