@@ -15,6 +15,14 @@ public class IdPSsoDescriptor : SsoDescriptorType
1515 {
1616 const string elementName = Saml2MetadataConstants . Message . IdPSsoDescriptor ;
1717
18+ /// <summary>
19+ /// [Optional]
20+ /// Optional attribute that indicates to service providers whether or not they can expect an
21+ /// unsigned <AuthnRequest> message to be accepted by the identity provider.
22+ /// If omitted, the value is assumed to be false.
23+ /// </summary>
24+ public bool ? WantAuthnRequestsSigned { get ; set ; }
25+
1826 /// <summary>
1927 /// One or more elements of type EndpointType that describe endpoints that support the profiles of the
2028 /// Authentication Request protocol defined in [SAMLProf]. All identity providers support at least one
@@ -35,6 +43,11 @@ protected IEnumerable<XObject> GetXContent()
3543 {
3644 yield return new XAttribute ( Saml2MetadataConstants . Message . ProtocolSupportEnumeration , protocolSupportEnumeration ) ;
3745
46+ if ( WantAuthnRequestsSigned . HasValue )
47+ {
48+ yield return new XAttribute ( Saml2MetadataConstants . Message . WantAuthnRequestsSigned , WantAuthnRequestsSigned . Value ) ;
49+ }
50+
3851 if ( EncryptionCertificates != null )
3952 {
4053 foreach ( var encryptionCertificate in EncryptionCertificates )
@@ -78,6 +91,8 @@ protected IEnumerable<XObject> GetXContent()
7891
7992 protected internal IdPSsoDescriptor Read ( XmlElement xmlElement )
8093 {
94+ WantAuthnRequestsSigned = xmlElement . Attributes [ Saml2MetadataConstants . Message . WantAuthnRequestsSigned ] ? . Value . Equals ( true . ToString ( ) , StringComparison . InvariantCultureIgnoreCase ) ;
95+
8196 var signingKeyDescriptorElements = xmlElement . SelectNodes ( $ "*[local-name()='{ Saml2MetadataConstants . Message . KeyDescriptor } '][contains(@use,'{ Saml2MetadataConstants . KeyTypes . Signing } ') or not(@use)]") ;
8297 if ( signingKeyDescriptorElements != null )
8398 {
0 commit comments