From d56e1d20e4dc2906d0a95fc7ce9068553dfd3c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sim=C3=A3o=20Martins?= <Lasering@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:28:21 +0100 Subject: [PATCH] Provider name (#1348) * Configurable ProviderName Co-authored-by: Tim van Dijen <tvdijen@gmail.com> Closes #1346 --- modules/saml/docs/sp.md | 5 +++++ modules/saml/lib/Auth/Source/SP.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/modules/saml/docs/sp.md b/modules/saml/docs/sp.md index 45da3fb1a..c65baae6c 100644 --- a/modules/saml/docs/sp.md +++ b/modules/saml/docs/sp.md @@ -326,6 +326,11 @@ Options : *Note*: SAML 2 specific. +`ProviderName` +: Human readable name of the local SP sent with the authentication request. + +: *Note*: SAML 2 specific. + `ProtocolBinding` : The binding that should be used for SAML2 authentication responses. This option controls the binding that is requested through the AuthnRequest message to the IdP. diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php index 99ce51a67..2fd436b2b 100644 --- a/modules/saml/lib/Auth/Source/SP.php +++ b/modules/saml/lib/Auth/Source/SP.php @@ -651,6 +651,11 @@ class SP extends \SimpleSAML\Auth\Source if (isset($state['saml:Extensions'])) { $ar->setExtensions($state['saml:Extensions']); } + + $providerName = $this->metadata->getString("ProviderName", null); + if ($providerName !== null) { + $ar->setProviderName($providerName); + } // save IdP entity ID as part of the state $state['ExpectedIssuer'] = $idpMetadata->getString('entityid'); -- GitLab