Skip to content

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

@A-Shevchenko

Description

@A-Shevchenko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions