Skip to content

Commit efd2e5b

Browse files
committed
AuthnClassRef in authsources can be array of strings
Deal with this in multiauth and document that this is the case
1 parent c2d0a1e commit efd2e5b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

modules/multiauth/src/Auth/Source/MultiAuth.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public function authenticate(array &$state): void
9999
{
100100
$state[self::AUTHID] = $this->authId;
101101
$state[self::SOURCESID] = $this->sources;
102+
$arrayUtils = new Utils\Arrays();
102103

103104
if (!array_key_exists('multiauth:preselect', $state) && isset($this->preselect)) {
104105
$state['multiauth:preselect'] = $this->preselect;
@@ -111,7 +112,8 @@ public function authenticate(array &$state): void
111112
$refs = array_values($state['saml:RequestedAuthnContext']['AuthnContextClassRef']);
112113
$new_sources = [];
113114
foreach ($this->sources as $source) {
114-
if (count(array_intersect($source['AuthnContextClassRef'], $refs)) >= 1) {
115+
$config_refs = $arrayUtils->arrayize($source['AuthnContextClassRef']);
116+
if (count(array_intersect($config_refs, $refs)) >= 1) {
115117
$new_sources[] = $source;
116118
}
117119
}

modules/saml/docs/sp.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ The following attributes are available:
135135
: The attributes should still be present in `attributes`.
136136

137137
`AuthnContextClassRef`
138-
: The SP can request authentication with a specific authentication context class.
138+
: The SP can request authentication with one or more specific authentication context classses.
139139
One example of usage could be if the IdP supports both username/password authentication as well as software-PKI.
140+
Set this to a string for one class identifier or an array of requested class identifiers.
140141

141142
`AuthnContextComparison`
142143
: The Comparison attribute of the AuthnContext that will be sent in the login request.

0 commit comments

Comments
 (0)