Skip to content

Commit

Permalink
Saml2 - Custom Service Entity Id (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
peppeocchi authored Jul 26, 2021
1 parent 8543b39 commit 8a24335
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static function additionalConfigKeys(): array
'entityid',
'certificate',
'sp_acs',
'sp_entityid',
];
}

Expand Down Expand Up @@ -218,7 +219,7 @@ public function getServiceProviderEntityDescriptor(): EntityDescriptor
{
$entityDescriptor = new EntityDescriptor();
$entityDescriptor
->setEntityID(URL::to('auth/saml2'))
->setEntityID($this->getConfig('sp_entityid', URL::to('auth/saml2')))
->addItem(
(new SpSsoDescriptor())
->setWantAssertionsSigned(true)
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ the ACS route should be configured in `config/services.php` as:
],
```

The default entity ID of the service provider is a url to '/auth/saml2' (for example `https://your.domain.com/auth/saml2`), if you need it can be manually configured in `config/services.php` as:
```php
'saml2' => [
'metadata' => 'https://idp.co/metadata/xml',
'sp_entityid' => 'https://my.domain.com/my/custom/entityid',
],
```

The entity ID and assertion consumer URL of the service provider can also be programmatically retrieved using:

```php
Expand Down

0 comments on commit 8a24335

Please sign in to comment.