main
 1class Principal
 2  attr_reader :id, :email
 3
 4  def initialize(id:, email:)
 5    @id = id
 6    @email = email
 7  end
 8
 9  def name_id_for(name_id_format)
10    Saml::Kit::Namespaces::PERSISTENT == name_id_format ? id : email
11  end
12
13  def assertion_attributes_for(request)
14    request.trusted? ? { access_token: SecureRandom.uuid } : {}
15  end
16end