Skip to content

Internal representation of all attributes are arrays but module-oidc references them as string #308

@mrvanes

Description

@mrvanes

When trying to authenticate to an (oidfed enabled) RP, module oidc complains about

Array to string conversion at /var/www/simplesamlphp-2.3.7/modules/oidc/src/Services/AuthenticationService.php:301

and

Array to string conversion at /var/www/simplesamlphp-2.3.7/modules/oidc/src/Services/src/Services/IdTokenBuilder.php:119

Both lines refer to the claim value as a String, but should be referencing the first value of the array (at least) because internal representation of all attributes are arrays in simpleSAMLphp!

(string)($claims['sub'][0] ?? $user->getIdentifier()),
...
$builder = $builder->relatedTo((string)$claimValue[0]);

Fixing these lines fixes the exceptions and now produce a correct welcoming message at the RP.
I don't understand how this could have escaped your attention, so I'm really curious what I did wrong here?
I'm not sure if this is oidfed RP only?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions