Class: OmniAuth::Strategies::G5

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/g5.rb

Instance Method Summary collapse

Instance Method Details

#display_nameObject



35
36
37
# File 'lib/omniauth/strategies/g5.rb', line 35

def display_name
  "#{raw_info['first_name']} #{raw_info['last_name']}".strip
end

#raw_infoObject



31
32
33
# File 'lib/omniauth/strategies/g5.rb', line 31

def raw_info
  @raw_info ||= access_token.get('/v1/me.json').parsed
end

#rolesObject



39
40
41
42
43
# File 'lib/omniauth/strategies/g5.rb', line 39

def roles
  [raw_info['roles']].flatten.collect do |role|
    {name: role['name'], type: role['type'], urn: role['urn']}
  end
end