-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
InvalidArgumentException: The algorithm "RS256" is not supported #238
Comments
I noticed that in the And after doing so, I then just passed in an instance of
And everything seems to work now. |
That was the problem. Indeed to use an algorithm, you must install the associated package. With the RSA package installed, the line |
@Spomky Ah, yep. You are correct. Passing in a string works now too. Thanks! I glossed over step 1 without even noticing. Even just linking to the signature algorithms page would help clarify that step. |
Great! |
Closing as answered |
also make the document easier to find from the error web-token/jwt-framework#238
any thoughts on changing the error message? maybe printing supported algorithms, or if there are none, asking the user to check if the appropriate package is installed? |
also make the document easier to find from the error web-token/jwt-framework#238
When trying to sign with HS256, It works perfectly fine : jws.sign({'a': 'b'}, 'secret', algorithm='HS256') But same when i try with RS256, It is failing:
Can anyone help |
Please make sure the |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
I'm trying to get the "Easy" install set up (using this documentation), but when I run the code I get the following exception:
Here is my test code:
I stepped through the code and noticed that in Validate.php
$this->algorithms
is not being set. Here is the line of code:jwt-framework/src/Easy/Validate.php
Line 41 in 0e9ae10
I'm not exactly sure at what point
$this->algorithms
should be getting set though?UPDATE:
I decided to do a bit more digging, and found that in AbstractLoader.php in the
alg()
function, it passes in a string ofRS256
and the switch statement only sets$this->allowedAlgorithms
when it is a string:https://github.com/web-token/jwt-framework/blob/v2.1/src/Easy/AbstractLoader.php#L205
Version: web-token/jwt-easy v2.1
https://github.com/web-token/jwt-easy
The text was updated successfully, but these errors were encountered: