Skip to content

Commit 5e48aaf

Browse files
authored
Merge pull request #116 from kpadmanabhan/requested-attribute-compliance
Requested attribute compliance
2 parents bd76b1c + 7aeba6d commit 5e48aaf

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/ITfoxtec.Identity.Saml2/Schemas/Metadata/EntityDescriptor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ protected IEnumerable<XObject> GetXContent()
135135
yield return new XAttribute(Saml2MetadataConstants.Message.ValidUntil, DateTimeOffset.UtcNow.AddDays(ValidUntil.Value).UtcDateTime.ToString(Saml2Constants.DateTimeFormat, CultureInfo.InvariantCulture));
136136
}
137137
yield return new XAttribute(Saml2MetadataConstants.MetadataNamespaceNameX, Saml2MetadataConstants.MetadataNamespace);
138+
yield return new XAttribute(Saml2MetadataConstants.SamlAssertionNamespaceNameX, Saml2MetadataConstants.SamlAssertionNamespace);
138139

139140
if (SPSsoDescriptor != null)
140141
{

src/ITfoxtec.Identity.Saml2/Schemas/Metadata/RequestedAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected IEnumerable<XObject> GetXContent()
4444
yield return new XAttribute(Saml2MetadataConstants.Message.IsRequired, IsRequired);
4545

4646
if (AttributeValue != null) {
47-
var attribVal = new XElement(Saml2MetadataConstants.AttributeValueNameSpace + Saml2MetadataConstants.Message.AttributeValue) {
47+
var attribVal = new XElement(Saml2MetadataConstants.SamlAssertionNamespaceNameX + Saml2MetadataConstants.Message.AttributeValue) {
4848
Value = AttributeValue
4949
};
5050
yield return new XElement(attribVal);

src/ITfoxtec.Identity.Saml2/Schemas/Metadata/Saml2MetadataConstants.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ public class Saml2MetadataConstants
99
/// The XML namespace of the Metadata.
1010
/// </summary>
1111
internal static readonly Uri MetadataNamespace = new Uri("urn:oasis:names:tc:SAML:2.0:metadata");
12+
13+
/// <summary>
14+
/// The XML namespace Uri of saml assertion
15+
/// </summary>
16+
internal static readonly Uri SamlAssertionNamespace = new Uri("urn:oasis:names:tc:SAML:2.0:assertion");
17+
1218
/// <summary>
1319
/// The XML namespace of the Metadata.
1420
/// </summary>
@@ -17,11 +23,20 @@ public class Saml2MetadataConstants
1723
/// <summary>
1824
/// The XML namespace Name of the Metadata.
1925
/// </summary>
20-
public static readonly XName MetadataNamespaceNameX = XNamespace.Xmlns + "m";
26+
public static readonly XName MetadataNamespaceNameX = XNamespace.Xmlns + "m";
27+
28+
/// <summary>
29+
/// The XML namespace of saml assertion
30+
/// </summary>
31+
public static readonly XNamespace SamlAssertionNamespaceX = XNamespace.Get(SamlAssertionNamespace.OriginalString);
32+
33+
/// <summary>
34+
/// The XML namespace Name of the saml assertion.
35+
/// </summary>
36+
public static readonly XName SamlAssertionNamespaceNameX = XNamespace.Xmlns + "saml";
2137

2238
public const string AttributeNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
2339
public const string AttributeNameFormatUri = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri";
24-
public const string AttributeValueNameSpace = "saml:";
2540

2641
public class Message
2742
{

0 commit comments

Comments
 (0)