Skip to content

Unable to customize sent claims.  #6

@drupol

Description

@drupol

Hello!

In ClientSecretJWT.php, the users claims are merged with the new claims.

array_merge(
            $claims,
            [
                'iss' => $clientId,
                'sub' => $clientId,
                'aud' => $issuerMetadata->getIssuer(),
                'iat' => $time,
                'exp' => $time + 60,
                'jti' => $jti,
            ]
        )

The fact that it is in this particular order, makes it impossible to customize the claims in IntrospectionService (and probably in some other places as well).

I could provide a PR where $claims is after instead of being before?
Do you think it make sense?

Something like that:

array_merge(
            [
                'iss' => $clientId,
                'sub' => $clientId,
                'aud' => $issuerMetadata->getIssuer(),
                'iat' => $time,
                'exp' => $time + 60,
                'jti' => $jti,
            ],
            $claims
        )

or

[
            $claims +
            [
                'iss' => $clientId,
                'sub' => $clientId,
                'aud' => $issuerMetadata->getIssuer(),
                'iat' => $time,
                'exp' => $time + 60,
                'jti' => $jti,
            ],
]

Thanks!

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