Class: RSAML::Identifier::Name
- Defined in:
- lib/rsaml/identifier/name.rb
Overview
A Name identifier.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#format ⇒ Object
The format of the name.
-
#sp_provided_id ⇒ Object
A name identifier established by a service provider or affiliation of providers for the entity, if different from the primary name identifier given.
-
#value ⇒ Object
The value of the identifier.
Attributes inherited from Base
#name_qualifier, #sp_name_qualifier
Class Method Summary collapse
-
.formats ⇒ Object
The following identifiers MAY be used to refer to the classification of the attribute name for purposes of interpreting the name.
- .from_xml(element) ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ Name
constructor
Initialize the identifier with the given value.
-
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the name.
Constructor Details
#initialize(value) ⇒ Name
Initialize the identifier with the given value
31 32 33 |
# File 'lib/rsaml/identifier/name.rb', line 31 def initialize(value) @value = value end |
Instance Attribute Details
#format ⇒ Object
The format of the name.
21 22 23 |
# File 'lib/rsaml/identifier/name.rb', line 21 def format @format end |
#sp_provided_id ⇒ Object
A name identifier established by a service provider or affiliation of providers for the entity, if different from the primary name identifier given
25 26 27 |
# File 'lib/rsaml/identifier/name.rb', line 25 def sp_provided_id @sp_provided_id end |
#value ⇒ Object
The value of the identifier
28 29 30 |
# File 'lib/rsaml/identifier/name.rb', line 28 def value @value end |
Class Method Details
.formats ⇒ Object
The following identifiers MAY be used to refer to the classification of the attribute name for purposes of interpreting the name.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rsaml/identifier/name.rb', line 7 def self.formats { :unspecified => 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', :email_address => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', :x509_subject_name => 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName', :windows_domain_qualified_name => 'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName', :kerberos => 'urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos', :entity => 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity', :persistent => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent', :transient => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' } end |
Instance Method Details
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the name
41 42 43 44 45 46 47 |
# File 'lib/rsaml/identifier/name.rb', line 41 def to_xml(xml=Builder::XmlMarkup.new) attributes = {'Format' => format} attributes['NameQualifier'] = name_qualifier unless name_qualifier.nil? attributes['SPNameQualifier'] = sp_name_qualifier unless sp_name_qualifier.nil? attributes['SPProvidedID'] = sp_provided_id unless sp_provided_id.nil? xml.tag!('saml:NameID', value, attributes) end |