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."
22 lines
501 B
Ruby
22 lines
501 B
Ruby
module Api
|
|
module OpenidConnect
|
|
class PairwisePseudonymousIdentifier < ActiveRecord::Base
|
|
self.table_name = "ppid"
|
|
|
|
belongs_to :o_auth_application
|
|
belongs_to :user
|
|
|
|
validates :user, presence: true
|
|
validates :identifier, presence: true, uniqueness: {scope: :user}
|
|
validates :guid, presence: true, uniqueness: true
|
|
|
|
before_validation :setup, on: :create
|
|
|
|
private
|
|
|
|
def setup
|
|
self.guid = SecureRandom.hex(16)
|
|
end
|
|
end
|
|
end
|
|
end
|