Sha256: b6a7586d35866a496f9c4c7bea7e225ab863b11faa64d0028e400746f7500467
Contents?: true
Size: 834 Bytes
Versions: 15
Compression:
Stored size: 834 Bytes
Contents
# frozen_string_literal: true module Doorkeeper module OpenidConnect class UserInfo include ActiveModel::Validations def initialize(access_token) @access_token = access_token end def claims { sub: subject }.merge ClaimsBuilder.generate(@access_token, :user_info) end def as_json(*_) claims.reject { |_, value| value.nil? || value == '' } end private def subject Doorkeeper::OpenidConnect.configuration.subject.call(resource_owner, application).to_s end def resource_owner @resource_owner ||= Doorkeeper::OpenidConnect.configuration.resource_owner_from_access_token.call(@access_token) end def application @application ||= @access_token.application end end end end
Version data entries
15 entries across 15 versions & 1 rubygems