~fkooman/php-saml-sp

7274524a077eaee9418fff1bdeb4bdd84b9a7c49 — Fran├žois Kooman 27 days ago c3c93a4
ignore entries in idpList that are not in IdP source

before, and error would be throw if any of the (explicitly)
listed IdP entity IDs was not available from the IdP source,
i.e. metadata. Now it is simply ignored.

References: https://codeberg.org/fkooman/php-saml-sp/issues/5
1 files changed, 5 insertions(+), 4 deletions(-)

M src/Web/Service.php
M src/Web/Service.php => src/Web/Service.php +5 -4
@@ 300,13 300,14 @@ class Service
            return $this->sp->getIdpSource()->getAll();
        }

        // only a subset of IdPs can be used for authentication
        // only a subset of IdPs can be used for authentication, get a list of
        // the IdPs that are explicitly mentioned and that are available in the
        // IdP source
        $availableIdpInfoList = [];
        foreach ($configIdpList as $entityId) {
            if (null === $idpInfo = $this->sp->getIdpSource()->get($entityId)) {
                throw new HttpException(500, \sprintf('no metadata for IdP "%s" available', $entityId));
            if (null !== $idpInfo = $this->sp->getIdpSource()->get($entityId)) {
                $availableIdpInfoList[$entityId] = $idpInfo;
            }
            $availableIdpInfoList[$entityId] = $idpInfo;
        }

        return $availableIdpInfoList;