diff options
author | Vincent Fazio <vfazio@xes-inc.com> | 2019-07-15 14:56:24 -0500 |
---|---|---|
committer | Vincent Fazio <vfazio@xes-inc.com> | 2019-07-15 14:56:24 -0500 |
commit | f280cc1c9b669932a6a157a99ac1ac748f5f2506 (patch) | |
tree | 957fb31809a17afd96e9a2f841a4d403767790da /spec/lib/gitlab/omniauth_initializer_spec.rb | |
parent | 60e5f8db1a69719677b0c996f42231ec612b4af2 (diff) | |
download | gitlab-ce-f280cc1c9b669932a6a157a99ac1ac748f5f2506.tar.gz |
Add client_auth_method test cases for OIDC
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Diffstat (limited to 'spec/lib/gitlab/omniauth_initializer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/omniauth_initializer_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/gitlab/omniauth_initializer_spec.rb b/spec/lib/gitlab/omniauth_initializer_spec.rb index f9c0daf1ef1..ef5c93e5c6b 100644 --- a/spec/lib/gitlab/omniauth_initializer_spec.rb +++ b/spec/lib/gitlab/omniauth_initializer_spec.rb @@ -83,5 +83,33 @@ describe Gitlab::OmniauthInitializer do subject.execute([cas3_config]) end + + it 'converts client_auth_method to a Symbol for openid_connect' do + openid_connect_config = { + 'name' => 'openid_connect', + 'args' => { name: 'openid_connect', client_auth_method: 'basic' } + } + + expect(devise_config).to receive(:omniauth).with( + :openid_connect, + { name: 'openid_connect', client_auth_method: :basic } + ) + + subject.execute([openid_connect_config]) + end + + it 'converts client_auth_method to a Symbol for strategy_class OpenIDConnect' do + openid_connect_config = { + 'name' => 'openid_connect', + 'args' => { strategy_class: OmniAuth::Strategies::OpenIDConnect, client_auth_method: 'jwt_bearer' } + } + + expect(devise_config).to receive(:omniauth).with( + :openid_connect, + { strategy_class: OmniAuth::Strategies::OpenIDConnect, client_auth_method: :jwt_bearer } + ) + + subject.execute([openid_connect_config]) + end end end |