As according to http://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg: "If the Client has not provided a value for sector_identifier_uri in Dynamic Client Registration [OpenID.Registration], the Sector Identifier used for pairwise identifier calculation is the host component of the registered redirect_uri."
20 lines
448 B
Ruby
20 lines
448 B
Ruby
class UserInfoSerializer < ActiveModel::Serializer
|
|
attributes :sub, :nickname, :profile, :picture
|
|
|
|
def sub
|
|
auth = serialization_options[:authorization]
|
|
Api::OpenidConnect::SubjectIdentifierCreator.createSub(auth)
|
|
end
|
|
|
|
def nickname
|
|
object.name
|
|
end
|
|
|
|
def profile
|
|
File.join(AppConfig.environment.url, "people", object.guid).to_s
|
|
end
|
|
|
|
def picture
|
|
File.join(AppConfig.environment.url, object.image_url).to_s
|
|
end
|
|
end
|