summaryrefslogtreecommitdiff
path: root/lib/gitlab/saml/auth_hash.rb
blob: 3414d24ca731780892b31657f0a4be1265aee452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Gitlab
  module Saml
    class AuthHash < Gitlab::OAuth::AuthHash

      def groups
        get_raw(Gitlab::Saml::Config.groups)
      end

      private

      def get_raw(key)
        # Needs to call `all` because of https://github.com/onelogin/ruby-saml/blob/master/lib/onelogin/ruby-saml/attributes.rb#L78
        # otherwise just the first value is returned
        auth_hash.extra[:raw_info].all[key]
      end

    end
  end
end