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

Problem with hashed password #24

Closed
JayRabas opened this issue May 6, 2019 · 3 comments
Closed

Problem with hashed password #24

JayRabas opened this issue May 6, 2019 · 3 comments

Comments

@JayRabas
Copy link
Contributor

JayRabas commented May 6, 2019

I successfully installed KodiWebPortal with Debian, but I found a (simple) problem which took me a long time to resolve: When using internal authentication, if the hashed password contains a letter after a '$', it doesn't work:
This work:
"$2y$10$471cELEUsyQJqaDyJBuXzOoBCEWfZwvMBtGsGLOQPwNH8DLInzJlq"
This doesn't work:
"$2y$10$DE4pIntIpyaC8TW.ZkQBPuuloY3IUQwwpHk5xzryeCUrsCW3/Zek6"
whereas it is the same password. I suppose PHP convert $DE4pIntIpyaC8TW to a variable.

@yanncam
Copy link
Owner

yanncam commented May 6, 2019

Hello,

You're right, there is a little mistake in this code.
The BCrypt's hashes need to be surrounded by simple-quote like ' and not double-quote like " to prevent the $ symbol to be interpreted as a PHP variable prefix.

So, please change in the config.php file the definition of hash :

  • from :
"$2y$10$DE4pIntIpyaC8TW.ZkQBPuuloY3IUQwwpHk5xzryeCUrsCW3/Zek6"
  • to :
'$2y$10$DE4pIntIpyaC8TW.ZkQBPuuloY3IUQwwpHk5xzryeCUrsCW3/Zek6'
  • or you can escape all $ signs with a blackslash like \$ and keep the double-quote ".

FYI, it works with the default hash $2y$10$471cELEUsyQJqaDyJBuXzOoBCEWfZwvMBtGsGLOQPwNH8DLInzJlq because each characters following each $ sign is numeric, si it can't be a valid PHP variable name.

I'll update the config.php file.

Sincerely,

@yanncam
Copy link
Owner

yanncam commented May 6, 2019

Commit here : aedf4c1

@JayRabas
Copy link
Contributor Author

JayRabas commented May 6, 2019

Thank you!

@JayRabas JayRabas closed this as completed May 6, 2019
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

No branches or pull requests

2 participants