Skip to content

Support raw string in "lexik_jwt_authentication.additional_public_keys" #1289

@motoronik

Description

@motoronik

Hello.

I found a feature that allows you to use additional keys lexik_jwt_authentication.additional_public_keys. It turned out to be very useful for me. But I ran into a problem during use.

Previously, I always entered the usual secret key from the category of removable environments (in alternating sequence with the classic one). Just try using "additional public keys". Therefore, we receive a message stating that the Additional Public Key"***" does not exist or is not readable. Did you install the "lexik_jwt_authentication.additional_public_keys" configuration key correctly?

lexik_jwt_authentication:
    secret_key: '%env(resolve:JWT_SECRET_KEY)%'
    user_id_claim: user_id
    encoder:
        signature_algorithm: HS256
    additional_public_keys:
        - '%env(resolve:JWT_SECRET_KEY_SECONDARY)%'

After examining the code https://github.com/lexik/LexikJWTAuthenticationBundle/blame/3.x/Services/KeyLoader/AbstractKeyLoader.php#L49-L62 I have a question. Why is the key transfer not supported in the configuration, but only the path to the key file is supported? But in the case of secret_key, the transfer of the key directly is supported.

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