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

Not possible to inject custom implementation of EncryptionInterface without overriding whole createDefaultIdTokenResponseType() or whole response type #1056

Open
A-Shevchenko opened this issue Nov 22, 2023 · 0 comments

Comments

@A-Shevchenko
Copy link

Let's imagine we want to have custom implementation of EncryptionInterface, e.g. because we want to add custom header info. It's the instruction directly in the code BTW:

    /**
     * Override to create a custom header
     */
    protected function generateJwtHeader($payload, $algorithm)
    {
        return array(
            'typ' => 'JWT',
            'alg' => $algorithm,
        );
    }

So, we create a custom implementation, but there is no way to pass it to instantiation of IdToken class, because it doesn't accept anything as last parameter here: return new IdToken($this->storages['user_claims'], $this->storages['public_key'], $config); (in createDefaultIdTokenResponseType()).
So to solve that we need to create a custom implementation of createDefaultIdTokenResponseType() or whole response type

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

No branches or pull requests

1 participant