Class: OmniAuth::Strategies::CMU

Inherits:
Pubcookie show all
Includes:
Pubcookie::CMULdap
Defined in:
lib/omniauth/strategies/cmu.rb

Constant Summary

Constants included from Pubcookie

Pubcookie::VERSION

Instance Method Summary collapse

Methods included from Pubcookie::CMULdap

#lookup_andrew_id

Instance Method Details

#raw_infoObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/omniauth/strategies/cmu.rb', line 32

def raw_info
  if @raw_info.nil?
    username  = extract_username(request)
    andrew_id = username.match(/^(.*)@/)[1]
    attrs     = lookup_andrew_id andrew_id

    @raw_info = {
      :username   => andrew_id,
      :name       => attrs[:cn],
      :email      => attrs[:mail],
      :nickname   => attrs[:nickname],
      :first_name => attrs[:givenname],
      :last_name  => attrs[:sn],
      :class      => attrs[:cmustudentclass],
      :department => attrs[:cmudepartment],
      :location   => attrs[:cmucampus],
      :ldap_attrs => attrs
    }
  end

  @raw_info
end