Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

fix constructor used in ECDSA-SHA256 algorithm #3

Merged

Conversation

hirasawayuki
Copy link
Collaborator

Fix ECDSA-SHA256 algorithm to use create() constructor.

When I call SWA\TokenBuilder#getClientSecret(), I get the following error message:

TypeError: Too few arguments to function Lcobucci\JWT\Signer\Ecdsa::__construct(), 0 passed in /auth/vendor/ktakayama/swa/src/SWA/TokenBuilder.php on line 64 and exactly 1 expected

This error seems to be caused by not using the create() constructor with the ECDSA-SHA256 algorithm.
According to the official documentation:

The implementation of ECDSA algorithms have a constructor dependency. Use the create() named constructor to avoid having to handle it (e.g.: Lcobucci\JWT\Signer\Ecdsa\Sha256::create()).

https://lcobucci-jwt.readthedocs.io/en/latest/configuration/#:~:text=arguments%20here%0A)%3B-,Important,-The%20implementation%20of

@ktakayama ktakayama merged commit f58df6b into ktakayama:master Jul 6, 2022
@hirasawayuki hirasawayuki deleted the hira/fix-ecdsa-sha256-constructor branch July 6, 2022 06:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants