class OmniAuth::Strategies::Hydra0

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/hydra0.rb, line 11
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
basic_auth_header() click to toggle source
# File lib/omniauth/strategies/hydra0.rb, line 24
def basic_auth_header
 'Basic ' + Base64.strict_encode64("#{options[:client_id]}:#{options[:client_secret]}")
end
build_access_token() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/hydra0.rb, line 19
def build_access_token
   options.token_params[:headers] = { 'Authorization' => basic_auth_header }
   super
 end
callback_url() click to toggle source
# File lib/omniauth/strategies/hydra0.rb, line 28
def callback_url
  full_host + callback_path
end
email() click to toggle source
# File lib/omniauth/strategies/hydra0.rb, line 54
def email
  raw_info['email']
end
fullname() click to toggle source

use fullname to avoid clash with ‘name’

# File lib/omniauth/strategies/hydra0.rb, line 68
def fullname
  raw_info['name']
end
image() click to toggle source
# File lib/omniauth/strategies/hydra0.rb, line 72
def image
  # deserialise openid claim into auth schema
  raw_info['picture']
end
nickname() click to toggle source
# File lib/omniauth/strategies/hydra0.rb, line 63
def nickname
  raw_info['nickname']
end
raw_info() click to toggle source
# File lib/omniauth/strategies/hydra0.rb, line 50
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/hydra0.rb, line 59
def username
  raw_info['username']
end