From ab156a4c9be71630853711df9aa80a50f63d342f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20P=C3=A9rez=20Crespo?= <jaime.perez@uninett.no>
Date: Mon, 9 Dec 2013 12:40:38 +0000
Subject: [PATCH] Generate NameIDFormat in metadata for SPs with a NameIDPolicy
 set.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3311 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/saml/www/sp/metadata.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/saml/www/sp/metadata.php b/modules/saml/www/sp/metadata.php
index 6a9a153dc..b20788ec4 100644
--- a/modules/saml/www/sp/metadata.php
+++ b/modules/saml/www/sp/metadata.php
@@ -118,6 +118,11 @@ if ($certInfo !== NULL && array_key_exists('certData', $certInfo)) {
 	$certData = NULL;
 }
 
+$format = $spconfig->getString('NameIDPolicy', NULL);
+if ($format !== NULL) {
+    $metaArray20['NameIDFormat'] = $format;
+}
+
 $name = $spconfig->getLocalizedString('name', NULL);
 $attributes = $spconfig->getArray('attributes', array());
 
-- 
GitLab