Class: RSAML::Protocol::NameIdPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/rsaml/protocol/name_id_policy.rb

Overview

Tailors the name identifier in the subjects of assertions resulting from an authentication request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allow_createObject

A Boolean value used to indicate whether the identity provider is allowed, in the course of fulfilling the request, to create a new identifier to represent the principal. Defaults to “false”. When “false”, the requester constrains the identity provider to only issue an assertion to it if an acceptable identifier for the principal has already been established. Note that this does not prevent the identity provider from creating such identifiers outside the context of this specific request (for example, in advance for a large number of principals).



19
20
21
# File 'lib/rsaml/protocol/name_id_policy.rb', line 19

def allow_create
  @allow_create
end

#formatObject

Specifies the URI reference corresponding to a name identifier format



6
7
8
# File 'lib/rsaml/protocol/name_id_policy.rb', line 6

def format
  @format
end

#sp_name_qualifierObject

Optionally specifies that the assertion subject’s identifier be returned (or created) in the namespace of a service provider other than the requester, or in the namespace of an affiliation group of service providers.



11
12
13
# File 'lib/rsaml/protocol/name_id_policy.rb', line 11

def sp_name_qualifier
  @sp_name_qualifier
end

Instance Method Details

#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object

Construct an XML fragment representing the name id policy



22
23
24
25
26
27
28
# File 'lib/rsaml/protocol/name_id_policy.rb', line 22

def to_xml(xml=Builder::XmlMarkup.new)
  attributes = {}
  attributes['Format'] = format unless format.nil?
  attributes['SPNameQualifier'] = sp_name_qualifier unless sp_name_qualifier.nil?
  attributes['AllowCreate'] = allow_create unless allow_create.nil?
  xml.tag!('samlp:NameIDPolicy', attributes)
end