在Simplesamlphp中,IdP应该检查SP请求的NameIDFormat,并尝试发送回该格式。

问题描述 投票:0回答:1

我在saml20-sp-hosted.php中配置了多个SP,我想让其中一个SP使用mail属性作为nameid。

saml20-sp-hosted.php

$metadata['entityId1'] = array ( 'entityid1' => 'entityId', 'contacts' => array ( 0 => array ( 'contactType' => 'technical', 'givenName' => 'XXX', 'surName' => 'XXX', 'emailAddress' => array ( 0 => '[email protected]', ), ), ), 'metadata-set' => 'saml20-sp-remote', 'attributes' => array('mail', 'sn', 'givenName', 'uid'), 'AssertionConsumerService' => array ( 0 => array ( 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', 'Location' => 'http://www.XXXYYY.com/SSO/ACS.aspx', 'index' => 0, ), ), 'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', ); 对于上面给定的SP,我想使用 "mail "属性作为nameid,但是我在下面给定的idp文件中定义了'uid'属性,所以它覆盖了这个属性。如果我试图在saml20-sp-hosted.php文件中覆盖'mail'属性,它就会发布瞬时的nameid。

saml20-idp-hosted.php

   'authproc' => array(

    3 => array(
      'class' => 'saml:AttributeNameID',
      'attribute' => 'uid',
      'Format' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
    ),
       50 => array(
           'class' => 'core:AttributeMap',
              'mail' => 'Email',
              'sn' => 'Lastname',
              'givenName' => 'Firstname',
             // 'memberOf' => 'Groups',
              'uid' => 'Username'
    //'cn' => array('name', 'displayName', 'sn'),
),
),
php single-sign-on saml saml-2.0 simplesamlphp
1个回答
0
投票

你确定你的IdP端文件是saml20-idp-hosted.php,而不是saml20-sp-remote.php?

© www.soinside.com 2019 - 2024. All rights reserved.