Symbolize client_auth_method for quirked providers
Providers such as OpenIDConnect ultimately leverage the rack-oauth2 gem which requires the client_auth_method value to be defined as a symbol in order to correctly select the authorization method used. Derivative providers that specify OmniAuth::Strategies::OpenIDConnect as their strategy_class will also convert this value to a symbol. Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
This commit is contained in:
parent
f69232d506
commit
83a870bf1a
|
@ -52,6 +52,16 @@ module Gitlab
|
||||||
args[:strategy_class] = args[:strategy_class].constantize
|
args[:strategy_class] = args[:strategy_class].constantize
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Providers that are known to depend on rack-oauth2, like those using
|
||||||
|
# Omniauth::Strategies::OpenIDConnect, need to be quirked so the
|
||||||
|
# client_auth_method argument value is passed as a symbol.
|
||||||
|
if (args[:strategy_class] == OmniAuth::Strategies::OpenIDConnect ||
|
||||||
|
args[:name] == 'openid_connect') &&
|
||||||
|
args[:client_auth_method].is_a?(String)
|
||||||
|
|
||||||
|
args[:client_auth_method] = args[:client_auth_method].to_sym
|
||||||
|
end
|
||||||
|
|
||||||
args
|
args
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue