Class: Doorkeeper::OpenidConnect::UserInfo
- Inherits:
-
Object
- Object
- Doorkeeper::OpenidConnect::UserInfo
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/doorkeeper/openid_connect/user_info.rb
Instance Method Summary collapse
- #as_json(*_) ⇒ Object
- #claims ⇒ Object
-
#initialize(access_token) ⇒ UserInfo
constructor
A new instance of UserInfo.
Constructor Details
#initialize(access_token) ⇒ UserInfo
Returns a new instance of UserInfo.
8 9 10 |
# File 'lib/doorkeeper/openid_connect/user_info.rb', line 8 def initialize(access_token) @access_token = access_token end |
Instance Method Details
#as_json(*_) ⇒ Object
21 22 23 |
# File 'lib/doorkeeper/openid_connect/user_info.rb', line 21 def as_json(*_) claims.reject { |_, value| value.nil? || value == "" } end |
#claims ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/doorkeeper/openid_connect/user_info.rb', line 12 def claims # NOTE: `sub` is merged last so a custom claim block cannot override # the canonical subject identifier (which would defeat pairwise / # subject-type guarantees). ClaimsBuilder.generate(@access_token, :user_info).merge( sub: subject ) end |