Can somebody shed insight on why when I try to go into the latest dev version it doesn’t let me log in? I installed from XAMPP successfully. I put in admin, pass as default login credentials. It seems as though it is trying to login but then kicks me out.
Brady,
The development demo at http://demo.open-emr.org:2089/ is showing similar behavior, and I get something similar when using the automated install with the development appliance.
However, if I re-run setup on the development appliance, all is well. My suspicion is that the mechanism the dev demo and the appliance use to create the initial user wasn’t updated for the new schema.
There’s a bug in the authentication code though in that a non-existent user behaves differently than a valid user with an incorrect password. Non-existent user seems to login, but then is kicked out vs. incorrect password going directly to login screen with an error message. Should be an easy fix.
Kevin, one more thing to fix that I just ran into while doing a bleeding-edge install for a client’s testing. Please remove the trailing white space from library/authentication/common_operations.php; it causes logout to crash when it attempts to write a HTTP header. Thanks!
It needs to include the password hashing PHP file here to create the initial user. I will plan to make the update later when I am on a real machine instead of my tablet.
I’ve made the corrections and pushed to sourceforge. I have successfully tested the auto installer script locally. I’ll double check the development demo after it updates tomorrow.
Here’s some testing info on issue to help out(using xampp 1.8.0 which is version included with the OpenEMR-4.1.1-xampp package):
When try to login, nothing happens and get the following error in php error log:
PHP Fatal error: Call to undefined function openssl_pkey_new() in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 47
Then when try to login, get “Invalid username or password” and following errors in error log:
[03-Jun-2013 05:54:44 UTC] PHP Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 48
[03-Jun-2013 05:54:44 UTC] PHP Warning: openssl_pkey_export(): cannot get key from parameter 1 in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 50
[03-Jun-2013 05:54:45 UTC] PHP Warning: openssl_private_decrypt(): key parameter is not a valid private key in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 87
[03-Jun-2013 05:54:54 UTC] PHP Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 48
[03-Jun-2013 05:54:54 UTC] PHP Warning: openssl_pkey_export(): cannot get key from parameter 1 in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 50
[03-Jun-2013 05:54:54 UTC] PHP Warning: openssl_private_decrypt(): key parameter is not a valid private key in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 87
[03-Jun-2013 05:54:59 UTC] PHP Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 48
[03-Jun-2013 05:54:59 UTC] PHP Warning: openssl_pkey_export(): cannot get key from parameter 1 in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 50
[03-Jun-2013 05:55:00 UTC] PHP Warning: openssl_private_decrypt(): key parameter is not a valid private key in C:\xampp\htdocs\openemr\library\authentication\rsa.php on line 87
The database elements look ok. Was gonna try to manually place a salt/hash for ‘pass’ and see if that would work, but forgot where you placed it on the github comments. Was hoping to get it from you again to try it out.
I also manually re-updated the development demo (it got hung up today on the early am auto refresh when it couldn’t grab the translations from github (this happens when github goes down). And not able to login via generic credentials; guessing there is a minor bug somewhere. Regarding above bug, should consider what we should do when the openssl module is not installed (and if installed, testing if it working correctly); if not, then need to at least state the OpenEMR will not work until the module is installed (and not even allow login attempts) with considerations of a work around (not sure what it would be but something that requires minimal work and also issues a huge WARNING statement that would be best to install openssl).
I think the following will be very helpful here now that we are including a module that may cause issues (I do think keeping the openssl pass use is worth the work though):
Create a login_diagnostics.php script
On login screen, call the login_diagnostics.php script via an ajax call (place a progress spinner in place of login elements with message ‘Please Wait…’ or something like that until it is done).
For now have the login_diagnostics.php do the following a) create a key pair b)encrypt ‘dummy’ and ensure the encrypted value is a string and is not ‘dummy’ (ie. ensure a encryption is actually done) c) unencrypt the value and ensure it is ‘dummy’. If any of these error out then return a test fail (as a json object with test:result pair, which will allow easy addition of further tests in the future).
For the fails in above script, which just return a simple fail which then on login screen could show something like (“OpenEMR is not configured correctly. Unable to login. Contact your administrator.”) rather than offering a login and then place the real error messages in the php error log. For example if openssl_pkey_new() fails then place the string from openssl_error_string() in the error log etc.
Make this ajax call controlled by a global (on by default, but then allows it to be turned off if people/vendors don’t want to be bothered by it after they have successfully installed/configured OpenEMR.).
In library/authentication/rsa.php, place an error check at openssl_pkey_get_details() call along with considering a encryption check (like above using ‘dummy’) along with a way to error out (could just be silent with a message thrown to the error_log since just means user gets stuck at the login screen).
One part of what is going on with the setup in the Dev appliance is the AutoInstaller uses the Suhosin patch, which does have CRYPT_BLOWFISH, but then Suhosin is disabled, which removes it. So the autoinstaller creates the initial users with blowfish based passwords, but then OpenEMR is unable to understand them.
The autoinstaller needs to disable the Suhosin patch/extension before running the OpenEMR installer.
Yes, except the developer appliance which comes pre-loaded with Suhosin, explicitly disables it at install with a warning
“Disabling suhosin patch which is not compatible with OpenEMR”
I do not know the details of why that is the case.