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

Added support for (optional) acr_values request parameter #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions lib/omniauth/strategies/openid_connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def authorize_uri
state: new_state,
nonce: (new_nonce if options.send_nonce),
hd: options.hd,
acr_values: options.acr_values
}
client.authorization_uri(opts.reject{|k,v| v.nil?})
end
Expand Down
10 changes: 10 additions & 0 deletions test/lib/omniauth/strategies/openid_connect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,16 @@ def test_option_send_nonce
assert(!(strategy.authorize_uri =~ /nonce=/), "URI must not contain nonce")
end

def test_option_acr_values
strategy.options.client_options[:host] = 'foobar.com'

assert(!(strategy.authorize_uri =~ /acr_values=/), 'URI must not contain acr_values')

strategy.options.acr_values = 'urn:mace:incommon:iap:silver'
assert(strategy.authorize_uri =~ /acr_values=/, 'URI must contain acr_values')
end


def test_failure_endpoint_redirect
OmniAuth.config.stubs(:failure_raise_out_environments).returns([])
strategy.stubs(:env).returns({})
Expand Down