diaspora/app/serializers/user_info_serializer.rb
theworldbright a76f51a6a5 Use redirect_uri if no sector identifier for ppid
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."
2016-01-04 16:49:55 +09:00

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