File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,13 @@ The following SAML 2.0 options are available:
142142
143143` assertion.encryption `
144144: Whether assertions sent from this IdP should be encrypted. The default
145- value is ` FALSE ` .
145+ value is ` FALSE ` . When set to ` TRUE ` encryption will be enforced for all
146+ remote SP's and an exception is thrown if encryption fails.
146147
147148: Note that this option can be set for each SP in the SP-remote metadata.
148149
150+ : Note that enforcement can be disabled by setting ` encryption.optional ` to ` TRUE ` .
151+
149152` attributeencodings `
150153: What encoding should be used for the different attributes. This is
151154 an array which maps attribute names to attribute encodings. There
@@ -190,6 +193,10 @@ The following SAML 2.0 options are available:
190193 any value in the SP-remote metadata overrides the one configured
191194 in the IdP metadata.
192195
196+ ` encryption.optional `
197+ : Whether or not we may continue to send an unencrypted assertion if the SP has no encryption certificate.
198+ The default value is ` FALSE ` .
199+
193200` encryption.blacklisted-algorithms `
194201: Blacklisted encryption algorithms. This is an array containing the algorithm identifiers.
195202
Original file line number Diff line number Diff line change @@ -1414,7 +1414,7 @@ private static function encryptAssertion(
14141414 Configuration $ idpMetadata ,
14151415 Configuration $ spMetadata ,
14161416 Assertion $ assertion ,
1417- ) {
1417+ ): Assertion | EncryptedAssertion {
14181418 $ encryptAssertion = $ spMetadata ->getOptionalBoolean ('assertion.encryption ' , null );
14191419 if ($ encryptAssertion === null ) {
14201420 $ encryptAssertion = $ idpMetadata ->getOptionalBoolean ('assertion.encryption ' , false );
@@ -1452,6 +1452,8 @@ private static function encryptAssertion(
14521452 // extract the public key from the certificate for encryption
14531453 $ key = new XMLSecurityKey (XMLSecurityKey::RSA_OAEP_MGF1P , ['type ' => 'public ' ]);
14541454 $ key ->loadKey ($ pemKey );
1455+ } elseif ($ idpMetadata ->getOptionalBoolean ('encryption.optional ' , false ) === true ) {
1456+ return $ assertion ;
14551457 } else {
14561458 throw new Error \ConfigurationError (
14571459 'Missing encryption key for entity ` ' . $ spMetadata ->getString ('entityid ' ) . '` ' ,
You can’t perform that action at this time.
0 commit comments