From 59163e5e8875088bb2b28e457c7e7c9434654063 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 fb9dff3ae..4f90c32f8 100644
--- a/modules/saml/docs/sp.md
+++ b/modules/saml/docs/sp.md
@@ -330,6 +330,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 98ef637fd..991cb7228 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -599,6 +599,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