Skip to content

Commit 32ea6c2

Browse files
committed
Small brush ups
1 parent f176724 commit 32ea6c2

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ OpenConext Stepup Second Factor Only Authproc Filter for SimpleSAMLphp
33

44
See [documentation](docs/stepupsfo.md).
55

6-
Copyright 2018 SURFnet B.V.
6+
Copyright 2018-2021 SURF B.V.
7+
78
Licensed under the CC-GNU LGPG version 2.1 or any later version.
89
See [COPYING](COPYING) for details.
910

docs/stepupsfo.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ The module requires the following:
99
1. Metadata for the SFO endpoint in saml20-idp-remote.
1010
1. Configuration of the authproc's own metadata.
1111
1. An attribute containing the full collabPersonId of the authenticated
12-
user o send to SFO.
12+
user to send to SFO.
1313

1414
You can get the metadata of the SFO endpoint from the party running that
1515
endpoint. In `saml20-idp-remote.php` it could look like this. Note that
1616
SHA-256 and signed authentication requests are mandatory. Optionally
1717
you can add the `sfo:selfserviceurl` config parameter used in the
1818
feedback message when a user does not have a token registered.
1919

20-
$metadata['https://gateway.pilot.stepup.surfconext.nl/second-factor-only/metadata'] = array (
20+
$metadata['https://gateway.pilot.stepup.surfconext.nl/second-factor-only/metadata'] = [
2121
'certificate' => 'sa_pilot_saml_signing_certificate_pem.crt',
2222
'metadata-set' => 'saml20-idp-remote',
2323
'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
24-
'SingleSignOnService' => array(
25-
0 => array(
24+
'SingleSignOnService' => [
25+
0 => [
2626
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
2727
'Location' => 'https://gateway.pilot.stepup.surfconext.nl/second-factor-only/single-sign-on',
28-
)),
28+
]],
2929
'redirect.sign' => true,
3030
// ssp has broken/fixed the fact that you could set this to null see #771
3131
//'NameIDPolicy' => null,
3232
3333
'sfo:selfserviceUrl' => 'https://selfservice.pilot.stepup.surfconext.nl/',
34-
);
34+
];
3535

3636
Configuration of the authproc filter could be done in any place that supports
3737
authproc filters, so it runs after the first factor has been authenticated.
@@ -45,17 +45,17 @@ attributes e.g. with the `core:AttributeAlter` filter. In the example the
4545
existing uid attribute is prefixed with the right urn and stored in the
4646
collabPersonId attribute. SFO is configured to read that attribute.
4747

48-
'authproc' => array(
48+
'authproc' => [
4949
// prepare attribute for sfo
50-
24 => array(
50+
24 => [
5151
'class' => 'core:AttributeAlter',
5252
'subject' => 'uid',
5353
'pattern' => '/^/',
5454
'replacement' => 'urn:collab:person:example.org:',
5555
'target' => 'collabPersonId'
56-
),
56+
],
5757
// fire off sfo
58-
25 => array(
58+
25 => [
5959
'class' => 'stepupsfo:SFO',
6060

6161
// attribute to use as identifier to the sfo idp
@@ -76,8 +76,8 @@ collabPersonId attribute. SFO is configured to read that attribute.
7676
// optional: list of remote entityids/requesterids for which SFO
7777
// should NOT be performed, instead they will just pass through.
7878
// 'skipentities' => [],
79-
),
80-
)
79+
],
80+
]
8181

8282
If you use the module to protect an IdP, you will want to exclude at least the
8383
token registration portal via the `skipentities` setting, if that portal uses

lib/Auth/Process/SFO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function process(&$state)
5454
$samlstateid = SimpleSAML_Auth_State::saveState($state, 'stepupsfo:pre');
5555

5656
if ( empty($state['Attributes'][$this->subjectidattribute]) ) {
57-
throw new Exception("Subjectid " . $this->subjectid . " not found in attributes.");
57+
throw new Exception("Subjectid " . $this->subjectidattribute . " not found in attributes.");
5858
}
5959

6060
$subjectid = $state['Attributes'][$this->subjectidattribute][0];

0 commit comments

Comments
 (0)