Skip to content

Commit 1d4bfc3

Browse files
thijskhtvdijen
authored andcommitted
Keep the ACS url as it was in 1.19. (#1698)
But implement it in a way that still does not require any legacy www scripts.
1 parent 7e3eebb commit 1d4bfc3

8 files changed

Lines changed: 21 additions & 27 deletions

File tree

docs/simplesamlphp-artifact-idp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ In general, that should look something like:
7070
'AssertionConsumerService' => [
7171
[
7272
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
73-
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
73+
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
7474
'index' => 0,
7575
],
7676
[
7777
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
78-
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
78+
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
7979
'index' => 2,
8080
],
8181
],

docs/simplesamlphp-hok-idp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ In general, this should look like the following code:
6666
'AssertionConsumerService' => [
6767
[
6868
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
69-
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
69+
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
7070
'index' => 0,
7171
],
7272
[
7373
'Binding' => 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser',
74-
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
74+
'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
7575
'index' => 4,
7676
],
7777
],

docs/simplesamlphp-idp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ This is a minimal example of a `metadata/saml20-sp-remote.php` metadata file for
182182
<?php
183183

184184
$metadata['https://sp.example.org/simplesaml/module.php/saml/sp/metadata.php/default-sp'] = [
185-
'AssertionConsumerService' => 'https://sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
186-
'SingleLogoutService' => 'https://sp.example.org/simplesaml/module.php/saml/sp/singleLogoutService/default-sp',
185+
'AssertionConsumerService' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
186+
'SingleLogoutService' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp',
187187
];
188188
```
189189

metadata-templates/saml20-sp-remote.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Example SimpleSAMLphp SAML 2.0 SP
1111
*/
1212
$metadata['https://saml2sp.example.org'] = [
13-
'AssertionConsumerService' => 'https://saml2.example.org/module.php/saml/sp/assertionConsumerService/default-sp',
14-
'SingleLogoutService' => 'https://saml2sp.example.org/module.php/saml/sp/singleLogoutService/default-sp',
13+
'AssertionConsumerService' => 'https://saml2.example.org/module.php/saml/sp/saml2-acs.php/default-sp',
14+
'SingleLogoutService' => 'https://saml2sp.example.org/module.php/saml/sp/saml2-logout.php/default-sp',
1515
];
1616

1717
/*

modules/core/docs/authproc_attributelimit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ like this:
8585
Then, add the allowed attributes to each service provider metadata, in the `attributes` option:
8686

8787
$metadata['https://saml2sp.example.org'] = [
88-
'AssertionConsumerService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
89-
'SingleLogoutService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/singleLogoutService/default-sp',
88+
'AssertionConsumerService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
89+
'SingleLogoutService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp',
9090
...
9191
'attributes' => ['cn', 'mail'],
9292
...
@@ -96,8 +96,8 @@ Now, let's look to a couple of examples on how to filter out attribute values. F
9696
to be used by a service provider (among other attributes):
9797

9898
$metadata['https://saml2sp.example.org'] = [
99-
'AssertionConsumerService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/assertionConsumerService/default-sp',
100-
'SingleLogoutService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/singleLogoutService/default-sp',
99+
'AssertionConsumerService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
100+
'SingleLogoutService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp',
101101
...
102102
'attributes' => [
103103
'uid',

modules/saml/routing/routes/routes.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,14 @@ saml-sp-wrongAuthnContextClassRef:
1111
path: /sp/wrongAuthnContextClassRef
1212
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::wrongAuthnContextClassRef' }
1313
saml-sp-assertionConsumerService:
14-
path: /sp/assertionConsumerService/{sourceId}
14+
path: /sp/saml2-acs.php/{sourceId}
1515
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::assertionConsumerService' }
1616
saml-sp-singleLogoutService:
17-
path: /sp/singleLogoutService/{sourceId}
17+
path: /sp/saml2-logout.php/{sourceId}
1818
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::singleLogoutService' }
1919
saml-sp-metadata:
2020
path: /sp/metadata/{sourceId}
2121
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::metadata' }
22-
saml-legacy-sp-assertionConsumerService:
23-
path: /sp/saml2-acs.php/{sourceId}
24-
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::assertionConsumerService', path: /saml/sp/assertionConsumerService, permanent: true }
25-
saml-legacy-sp-singleLogoutService:
26-
path: /sp/saml2-logout.php/{sourceId}
27-
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::singleLogoutService', path: /saml/sp/singleLogoutService, permanent: true }
2822
saml-legacy-sp-metadata:
2923
path: /sp/metadata.php/{sourceId}
3024
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::metadata', path: /saml/sp/metadata, permanent: true }

modules/saml/src/Auth/Source/SP.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,19 +357,19 @@ private function getACSEndpoints(): array
357357
case Constants::BINDING_HTTP_POST:
358358
$acs = [
359359
'Binding' => Constants::BINDING_HTTP_POST,
360-
'Location' => Module::getModuleURL('saml/sp/assertionConsumerService/' . $this->getAuthId()),
360+
'Location' => Module::getModuleURL('saml/sp/saml2-acs.php/' . $this->getAuthId()),
361361
];
362362
break;
363363
case Constants::BINDING_HTTP_ARTIFACT:
364364
$acs = [
365365
'Binding' => Constants::BINDING_HTTP_ARTIFACT,
366-
'Location' => Module::getModuleURL('saml/sp/assertionConsumerService/' . $this->getAuthId()),
366+
'Location' => Module::getModuleURL('saml/sp/saml2-acs.php/' . $this->getAuthId()),
367367
];
368368
break;
369369
case Constants::BINDING_HOK_SSO:
370370
$acs = [
371371
'Binding' => Constants::BINDING_HOK_SSO,
372-
'Location' => Module::getModuleURL('saml/sp/assertionConsumerService/' . $this->getAuthId()),
372+
'Location' => Module::getModuleURL('saml/sp/saml2-acs.php/' . $this->getAuthId()),
373373
'hoksso:ProtocolBinding' => Constants::BINDING_HTTP_REDIRECT,
374374
];
375375
break;
@@ -404,7 +404,7 @@ private function getSLOEndpoints(): array
404404
Constants::BINDING_SOAP,
405405
]
406406
);
407-
$defaultLocation = Module::getModuleURL('saml/sp/singleLogoutService/' . $this->getAuthId());
407+
$defaultLocation = Module::getModuleURL('saml/sp/saml2-logout.php/' . $this->getAuthId());
408408
$location = $this->metadata->getOptionalString('SingleLogoutServiceLocation', $defaultLocation);
409409

410410
$endpoints = [];
@@ -439,7 +439,7 @@ private function startSSO2(Configuration $idpMetadata, array $state): void
439439

440440
$ar = Module\saml\Message::buildAuthnRequest($this->metadata, $idpMetadata);
441441

442-
$ar->setAssertionConsumerServiceURL(Module::getModuleURL('saml/sp/assertionConsumerService/' . $this->authId));
442+
$ar->setAssertionConsumerServiceURL(Module::getModuleURL('saml/sp/saml2-acs.php/' . $this->authId));
443443

444444
if (isset($state['\SimpleSAML\Auth\Source.ReturnURL'])) {
445445
$ar->setRelayState($state['\SimpleSAML\Auth\Source.ReturnURL']);

tests/modules/saml/src/Auth/Source/SPTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ public function testMetadataHostedBasicConfig(): void
462462
$this->assertIsArray($md['AssertionConsumerService']);
463463
foreach ($md['AssertionConsumerService'] as $acs) {
464464
$this->assertEquals(
465-
'http://localhost/simplesaml/module.php/saml/sp/assertionConsumerService/' . $spId,
465+
'http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/' . $spId,
466466
$acs['Location']
467467
);
468468
$this->assertStringStartsWith('urn:oasis:names:tc:SAML:2.0:bindings', $acs['Binding']);
@@ -1382,7 +1382,7 @@ public function testMetadataHolderOfKeyViaProtocolBindingIsInMetadata(): void
13821382
$this->assertIsArray($hok);
13831383
$this->assertEquals('urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', $hok['Binding']);
13841384
$this->assertEquals(
1385-
'http://localhost/simplesaml/module.php/saml/sp/assertionConsumerService/' . $spId,
1385+
'http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/' . $spId,
13861386
$hok['Location']
13871387
);
13881388
$this->assertEquals(2, $hok['index']);

0 commit comments

Comments
 (0)