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

Wrong type exception for AccessTokenLoader with certain configuration #1184

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

athanasius-kircher
Copy link

If I use the feature "webtoken" with that bundle than the following configuration (only signing jwk but not encrypting), leads to an exception when the Encoder is loader and Dependencies are injected.

lexik_jwt_authentication:
    public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
    encoder:
        service: lexik_jwt_authentication.encoder.web_token
    access_token_issuance:
        enabled: true
        signature:
            algorithm: EdDSA
            key: '%env(SIGNATURE_KEY)%'
    access_token_verification:
        enabled: true
        signature:
            allowed_algorithms:
                - EdDSA
            keyset: '%env(SIGNATURE_VERIFICATION_KEYSET)%'

The problem in my opinion is the default xml Service configuration, that does not specify the right type. If one acitvates encryption this error disappears as than this config is overwritten anyhow.

In AccessTokenLoader.php line 38:                                                                                                                                                                                                                                                                        
Lexik\Bundle\JWTAuthenticationBundle\Services\WebToken\AccessTokenLoader::__construct(): Argument #10 ($jweHeaderChecker) must be of type ?array, string given, called in /var/www/html/var/cache/test/Container1K8ziZx/getLexikJwtAuthentication_AccessTokenLoaderService.php on line 29 

@chalasr
Copy link
Collaborator

chalasr commented Dec 7, 2023

Thanks for the PR! We miss some tests apparently... I'll take care of that. I'm gonna merge+tag this PR asap by the end of the week.

@chalasr
Copy link
Collaborator

chalasr commented Dec 14, 2023

Thank you @athanasius-kircher.

@chalasr chalasr merged commit a196d68 into lexik:2.x Dec 14, 2023
9 checks passed
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