-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Should we use HS256 or RS256? #109
Comments
If I try to use RS256 I get the error: |
Do you try using double quote instead of single quote ? I managed to solve it with double quote. I mean, if you write $token = JWT::encode($payload, "YourGiantKey", 'RS256'); instead of $token = JWT::encode($payload, 'YourGiantKey', 'RS256'); I dont know how to solve the problem with the var $key by the way. If you manage to do it, please let me know :) |
@Nayir I tried with double quote and now it works, thanks!!
Which worked :) |
When you download your JSON file from Firebase it comes with a bunch of These need to be interpreted as new lines. In PHP, double quotes $ php -a
Interactive mode enabled
php > echo '\n';
\n
php > echo "\n"
php > php > $foo = '\n';
php > $bar = "\n";
php > strlen($foo);
php > echo strlen($foo);
2
php > echo strlen($bar);
1
php > Thinking it might be nice to throw an error / warning.. but haven't thought through any potential edge cases... So for now I'll just PR the README |
Should we use HS256 or RS256?
Looking at the docs it says: RS256
I have tried to make a token using:
$token = JWT::encode($payload, $key, 'HS256');
But if I later try to use that token when testing on ios I get the error:
FIRAuthErrorDomain Code=17000 "The custom token format is incorrect. Please check the documentation.
The text was updated successfully, but these errors were encountered: