Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved JWT builder in IdTokenResponse to protected method #23

Merged
merged 1 commit into from
Nov 12, 2018
Merged

Moved JWT builder in IdTokenResponse to protected method #23

merged 1 commit into from
Nov 12, 2018

Conversation

sgomez
Copy link
Contributor

@sgomez sgomez commented Nov 11, 2018

It's very hard to add more claims or headers to id_token. This PR moves builder generation in a protected method, so the class can be extended to add more claims. Vg:

<?php

class MyIdTokenResponse extends IdTokenResponse
{
    protected function getBuilder(AccessTokenEntityInterface $accessToken, UserEntityInterface $userEntity)
    {
        // Add required id_token claims
        $builder = parent::getBuilder($accessToken, $userEntity)
            ->setHeader('kid', 'oidc')
        ;

        return $builder;
    }
}

This not cause any BC.

@steverhoades steverhoades merged commit aa994a8 into steverhoades:master Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants