Class: OmniAuth::Strategies::Hydra1

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

Direct Known Subclasses

Rpi

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



15
16
17
18
19
20
21
# File 'lib/omniauth/strategies/hydra1.rb', line 15

def authorize_params
  super.tap do |params|
    %w[scope client_options login_options].each do |v|
      params[v.to_sym] = request.params[v] if request.params[v]
    end
  end
end

#callback_urlObject



23
24
25
# File 'lib/omniauth/strategies/hydra1.rb', line 23

def callback_url
  full_host + callback_path
end

#emailObject



49
50
51
# File 'lib/omniauth/strategies/hydra1.rb', line 49

def email
  raw_info['email']
end

#fullnameObject

use fullname to avoid clash with ‘name’



63
64
65
# File 'lib/omniauth/strategies/hydra1.rb', line 63

def fullname
  raw_info['name']
end

#imageObject



67
68
69
70
# File 'lib/omniauth/strategies/hydra1.rb', line 67

def image
  # deserialise openid claim into auth schema
  raw_info['picture']
end

#nicknameObject



58
59
60
# File 'lib/omniauth/strategies/hydra1.rb', line 58

def nickname
  raw_info['nickname']
end

#raw_infoObject



45
46
47
# File 'lib/omniauth/strategies/hydra1.rb', line 45

def raw_info
  @raw_info ||= (JWT.decode access_token.params['id_token'], nil, false)[0]
end

#usernameObject

<13 accounts have username instead of email



54
55
56
# File 'lib/omniauth/strategies/hydra1.rb', line 54

def username
  raw_info['username']
end