Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SimpleSamlphp:在另一个属性中添加属性_Php_Simplesamlphp - Fatal编程技术网

SimpleSamlphp:在另一个属性中添加属性

SimpleSamlphp:在另一个属性中添加属性,php,simplesamlphp,Php,Simplesamlphp,我实际使用的是在我的网站上创建一个身份验证,所以我在我的网站上安装了一个服务提供商,我也安装了一个身份提供商,直到他们没有问题为止。我的服务提供商连接到我的身份提供商,connexion工作正常 文件“config/authsources.php”中有我的不同用户: $config = array( ... 'example-userpass' => array( 'userTest:pwd' => array( 'uid' =

我实际使用的是在我的网站上创建一个身份验证,所以我在我的网站上安装了一个服务提供商,我也安装了一个身份提供商,直到他们没有问题为止。我的服务提供商连接到我的身份提供商,connexion工作正常

文件“config/authsources.php”中有我的不同用户:

$config = array(
    ...
    'example-userpass' => array(
        'userTest:pwd' => array(
            'uid' => array('userTest'),
            'NameIdentifier' => 'Test',
            'Attribut1' => 'att1',
            'Attribut2' => 'att2'
        )
    ),
    ...
),
...
我的问题是,我想在一个属性中有一个属性,其中包含多个属性,例如:

$config = array(
    ...
    'example-userpass' => array(
        'userTest:pwd' => array(
            'uid' => array('userTest'),
            'NameIdentifier' => 'Test',
            'Attribut1' => 'att1',
            'Attribut2' => array(
                'Attribut21' =>  'att21',
                'Attribut22' => 'att22',
                 ...    
            )
        )
    ),
    ...
),
...
但当我这样做时,我有一个错误:

SimpleSAML_Error_Error: UNHANDLEDEXCEPTION
Backtrace:
1 C:\wamp\www\Idp\simplesamlphp\www\_include.php:37 (SimpleSAML_exception_handler)
0 [builtin] (N/A)
Caused by: Exception: Invalid attributes for user userTest in authentication source example-userpass: Invalid attribute value for attribute Attribut2: array (
  'Attribut21' => 'att21',
  'Attribut22' => 'att22'
)
那么,如何将属性与其他属性一起添加?

更改

'Attribut21' =  'att21',
'Attribut22' = 'att22',

因为他们被认为是一个

编辑:好的,不确定这里有什么问题。。。我将发布一个例子,希望你能理解这个模式。(每个数组实际上包含更多属性)


这其实并不难,最后我只需要做:

$config = array(
    ...
    'example-userpass' => array(
        'userTest:pwd' => array(
            'uid' => array('userTest'),
            'NameIdentifier' => 'Test',
            'Attribut1' => 'att1',
            'Attribut2' => array(
                'att21',
                'att22',
                 ...    
            )
        )
    ),
    ...
),
...

很抱歉,这是一个错误,我做时,我创建的职位,但我没有做我的发展。我纠正它。
<?php
$config = array(
    'example-userpass' => array(
        'exampleauth:UserPass',
        'student:studentpass' => array(
            'uid' => array('student'),
            'eduPersonAffiliation' => array('member', 'student'),
        ),
        'employee:employeepass' => array(
            'uid' => array('employee'),
            'eduPersonAffiliation' => array('member', 'employee'),
        ),
    ),
);
$config = array(
    ...
    'example-userpass' => array(
        'userTest:pwd' => array(
            'uid' => array('userTest'),
            'NameIdentifier' => 'Test',
            'Attribut1' => 'att1',
            'Attribut2' => array(
                'att21',
                'att22',
                 ...    
            )
        )
    ),
    ...
),
...