Class: OIDCProvider::AccountToUserInfo
- Inherits:
-
Object
- Object
- OIDCProvider::AccountToUserInfo
- Defined in:
- lib/oidc_provider/account_to_user_info.rb
Instance Method Summary collapse
Instance Method Details
#call(account, scope_names) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/oidc_provider/account_to_user_info.rb', line 3 def call(account, scope_names) scopes = scope_names.map { |name| OIDCProvider.supported_scopes.detect { |scope| scope.name == name } }.compact OpenIDConnect::ResponseObject::UserInfo.new(sub: account.send(OIDCProvider.account_identifier)).tap do |user_info| scopes.each do |scope| UserInfoBuilder.new(user_info, account).run(&scope.work) end end end |