Skip to content

Commit 80328ec

Browse files
committed
Metadata element order bug solved.
1 parent 97c372e commit 80328ec

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ protected IEnumerable<XObject> GetXContent()
3535
{
3636
yield return new XAttribute(Saml2MetadataConstants.Message.ProtocolSupportEnumeration, protocolSupportEnumeration);
3737

38-
if (SigningCertificates != null)
39-
{
40-
foreach (var signingCertificate in SigningCertificates)
41-
{
42-
yield return KeyDescriptor(signingCertificate, Saml2MetadataConstants.KeyTypes.Signing);
43-
}
44-
}
45-
4638
if (EncryptionCertificates != null)
4739
{
4840
foreach (var encryptionCertificate in EncryptionCertificates)
@@ -51,11 +43,11 @@ protected IEnumerable<XObject> GetXContent()
5143
}
5244
}
5345

54-
if (SingleSignOnServices != null)
46+
if (SigningCertificates != null)
5547
{
56-
foreach (var singleSignOnService in SingleSignOnServices)
48+
foreach (var signingCertificate in SigningCertificates)
5749
{
58-
yield return singleSignOnService.ToXElement();
50+
yield return KeyDescriptor(signingCertificate, Saml2MetadataConstants.KeyTypes.Signing);
5951
}
6052
}
6153

@@ -73,7 +65,15 @@ protected IEnumerable<XObject> GetXContent()
7365
{
7466
yield return new XElement(Saml2MetadataConstants.MetadataNamespaceX + Saml2MetadataConstants.Message.NameIDFormat, nameIDFormat.OriginalString);
7567
}
76-
}
68+
}
69+
70+
if (SingleSignOnServices != null)
71+
{
72+
foreach (var singleSignOnService in SingleSignOnServices)
73+
{
74+
yield return singleSignOnService.ToXElement();
75+
}
76+
}
7777
}
7878

7979
protected internal IdPSsoDescriptor Read(XmlElement xmlElement)

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ protected IEnumerable<XObject> GetXContent()
6868
yield return new XAttribute(Saml2MetadataConstants.Message.WantAssertionsSigned, WantAssertionsSigned.Value);
6969
}
7070

71+
if (EncryptionCertificates != null)
72+
{
73+
foreach(var encryptionCertificate in EncryptionCertificates)
74+
{
75+
yield return KeyDescriptor(encryptionCertificate, Saml2MetadataConstants.KeyTypes.Encryption);
76+
}
77+
}
78+
7179
if (SigningCertificates != null)
7280
{
7381
foreach (var signingCertificate in SigningCertificates)
@@ -76,14 +84,6 @@ protected IEnumerable<XObject> GetXContent()
7684
}
7785
}
7886

79-
if (EncryptionCertificates != null)
80-
{
81-
foreach(var encryptionCertificate in EncryptionCertificates)
82-
{
83-
yield return KeyDescriptor(encryptionCertificate, Saml2MetadataConstants.KeyTypes.Encryption);
84-
}
85-
}
86-
8787
if (SingleLogoutServices != null)
8888
{
8989
foreach (var singleLogoutService in SingleLogoutServices)

0 commit comments

Comments
 (0)