0

I actualy use simpleSamlPhp for creat an authentification on my website so i have a service provider instal on my website and i also instal an Identity provider until their no problem. My service provider connect to my identity provider and connexion work fine.

I have in the file "config/authsources.php" my different user :

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

My problem is that i want to have an attribut with several attributs in one attribut for have something like that :

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

But when i do it i have this error :

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'
)

So how can i add an attribut with other attribut?

Kvasir
  • 1,197
  • 4
  • 17
  • 31

2 Answers2

0

Change

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

to

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

Since they are supposed to be an associative array.

EDIT: ok, not sure what's the problem here... i'm gonna post an example and hopefully you do understand the pattern. (each array is in fact more attributes)

<?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'),
        ),
    ),
);
Sotiris Kiritsis
  • 3,178
  • 3
  • 23
  • 31
  • Sorry it's a mistake that i do when i create the post but i don't do it on my developement. I correct it. – Kvasir Jun 08 '15 at 12:07
0

It was not really diffcult finally i just have to do :

$config = array(
    ...
    'example-userpass' => array(
        'userTest:pwd' => array(
            'uid' => array('userTest'),
            'NameIdentifier' => 'Test',
            'Attribut1' => 'att1',
            'Attribut2' => array(
                'att21',
                'att22',
                 ...    
            )
        )
    ),
    ...
),
...
Kvasir
  • 1,197
  • 4
  • 17
  • 31