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."
17 lines
562 B
Ruby
17 lines
562 B
Ruby
module Api
|
|
module OpenidConnect
|
|
class SubjectIdentifierCreator
|
|
def self.createSub(auth)
|
|
if auth.o_auth_application.ppid?
|
|
identifier = auth.o_auth_application.sector_identifier_uri ||
|
|
URI.parse(auth.o_auth_application.redirect_uris[0]).host
|
|
pairwise_pseudonymous_identifier =
|
|
auth.user.pairwise_pseudonymous_identifiers.find_or_create_by(identifier: identifier)
|
|
pairwise_pseudonymous_identifier.guid
|
|
else
|
|
auth.user.diaspora_handle
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|