class OmniAuth::Strategies::Hydra1

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/hydra1.rb, line 15
def authorize_params
  super.tap do |params|
    %w[scope client_options].each do |v|
      params[v.to_sym] = request.params[v] if request.params[v]
    end
  end
end
callback_url() click to toggle source
# File lib/omniauth/strategies/hydra1.rb, line 23
def callback_url
  full_host + callback_path
end
email() click to toggle source
# File lib/omniauth/strategies/hydra1.rb, line 49
def email
  raw_info['email']
end
fullname() click to toggle source

use fullname to avoid clash with ‘name’

# File lib/omniauth/strategies/hydra1.rb, line 63
def fullname
  raw_info['name']
end
image() click to toggle source
# File lib/omniauth/strategies/hydra1.rb, line 67
def image
  # deserialise openid claim into auth schema
  raw_info['picture']
end
nickname() click to toggle source
# File lib/omniauth/strategies/hydra1.rb, line 58
def nickname
  raw_info['nickname']
end
raw_info() click to toggle source
# File lib/omniauth/strategies/hydra1.rb, line 45
def raw_info
  @raw_info ||= (JWT.decode access_token.params['id_token'], nil, false)[0]
end
username() click to toggle source

<13 accounts have username instead of email

# File lib/omniauth/strategies/hydra1.rb, line 54
def username
  raw_info['username']
end