Skip to content

Commit

Permalink
Added support to read sp_sign_assertions key to remove hardcoded valu…
Browse files Browse the repository at this point in the history
…e (#1107)

Co-authored-by: Lucas Michot <[email protected]>
  • Loading branch information
bruno-farias and lucasmichot authored Nov 7, 2023
1 parent 6ac55d6 commit ae108f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public static function additionalConfigKeys(): array
'sp_org_url',
'sp_default_binding_method',
'sp_name_id_format',
'sp_sign_assertions',
'idp_binding_method',
'attribute_map',
];
Expand Down Expand Up @@ -368,7 +369,9 @@ public function getIdentityProviderEntityDescriptor(): EntityDescriptor
public function getServiceProviderEntityDescriptor(): EntityDescriptor
{
$spSsoDescriptor = new SpSsoDescriptor();
$spSsoDescriptor->setWantAssertionsSigned(true)->addNameIDFormat($this->getNameIDFormat());
$spSsoDescriptor
->setWantAssertionsSigned((bool) $this->getConfig('sp_sign_assertions', true))
->addNameIDFormat($this->getNameIDFormat());

foreach ([SamlConstants::BINDING_SAML2_HTTP_REDIRECT, SamlConstants::BINDING_SAML2_HTTP_POST] as $binding) {
$acsRoute = $this->getAssertionConsumerServiceRoute();
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ SAML2 supports the signing and encryption of messages and assertions. Many Ident
'sp_certificate' => file_get_contents('path/to/sp_saml.crt'),
'sp_private_key' => file_get_contents('path/to/sp_saml.pem'),
'sp_private_key_passphrase' => 'passphrase to your private key, provide it only if you have one',
'sp_sign_assertions' => true, // or false to disable assertion signing
],
```

Expand Down

0 comments on commit ae108f5

Please sign in to comment.