Skip to content
Snippets Groups Projects
Commit 80b8a827 authored by Olav Morken's avatar Olav Morken
Browse files

saml: Add NameIDPolicy option which replaces the NameIDFormat option.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1797 44740490-163a-0410-bde0-09ae8108e29a
parent c311e37e
No related branches found
No related tags found
No related merge requests found
......@@ -347,10 +347,18 @@ class sspmod_saml2_Message {
$ar = new SAML2_AuthnRequest();
$ar->setNameIdPolicy(array(
'Format' => $spMetadata->getString('NameIDFormat', SAML2_Const::NAMEID_TRANSIENT),
'AllowCreate' => TRUE,
if ($spMetadata->hasValue('NameIDPolicy')) {
$nameIdPolicy = $spMetadata->getString('NameIDPolicy', NULL);
} else {
$nameIdPolicy = $spMetadata->getString('NameIDFormat', SAML2_Const::NAMEID_TRANSIENT);
}
if ($nameIdPolicy !== NULL) {
$ar->setNameIdPolicy(array(
'Format' => $nameIdPolicy,
'AllowCreate' => TRUE,
));
}
$ar->setIssuer($spMetadata->getString('entityid'));
$ar->setDestination($idpMetadata->getString('SingleSignOnService'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment