class Oidc::Client

def authorization_uri(params = {})

def authorization_uri(params = {})
  params[:scope] = setup_required_scope params[:scope]
  params[:prompt] = Array(params[:prompt]).join(' ')
  super
end

def handle_success_response(response)

def handle_success_response(response)
  token_hash = response.body.with_indifferent_access
  token_type = (@forced_token_type || token_hash[:token_type]).try(:downcase)
  case token_type
  when 'bearer'
    AccessToken.new token_hash.merge(client: self)
  else
    raise Exception.new("Unexpected Token Type: #{token_type}")
  end
end

def initialize(attributes = {})

def initialize(attributes = {})
  super attributes
  self.userinfo_endpoint ||= '/userinfo'
end

def setup_required_scope(scopes)

def setup_required_scope(scopes)
  _scopes_ = Array(scopes).join(' ').split(' ')
  _scopes_ << 'openid' unless _scopes_.include?('openid')
  _scopes_
end

def userinfo_uri

def userinfo_uri
  absolute_uri_for userinfo_endpoint
end