Skip to content

Commit 37753dd

Browse files
committed
FEATURE: Pass on policy parameter
Used for Azure B2C tenants
1 parent 473e152 commit 37753dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/omniauth_open_id_connect.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class OpenIDConnect < OmniAuth::Strategies::OAuth2
66
option :scope, "openid"
77
option :discovery, true
88
option :cache, lambda { |key, &blk| blk.call } # Default no-op cache
9+
option :authorize_options, [:p]
910

1011
option :client_options,
1112
site: 'https://op.com/',
@@ -31,6 +32,10 @@ def request_phase
3132

3233
def authorize_params
3334
super.tap do |params|
35+
options[:authorize_options].each do |k|
36+
params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])
37+
end
38+
3439
params[:scope] = options[:scope]
3540
session['omniauth.nonce'] = params[:nonce] = SecureRandom.hex(32)
3641
end

0 commit comments

Comments
 (0)