Situation
I installed OpenEMR 6.0 for Windows using xampp and was hoping to try using FHIR to search for patients using Postman. I am currently only using this installation for testing purposes (not for development).
I have ensured that all of the REST and FHIR API connectors have been enabled in Administration → Globals → Connectors. I have also set a site address.
I have been following both: openemr/API_README.md at master · openemr/openemr · GitHub and openemr/FHIR_README.md at master · openemr/openemr · GitHub
When I attempt to register a client, I am receiving a 500 internal server error in Postman with the following:
{
"error": "server_error",
"error_description": "The authorization server encountered an unexpected condition which prevented it from fulfilling the request: Security error - problem with authorization server keys.",
"message": "The authorization server encountered an unexpected condition which prevented it from fulfilling the request: Security error - problem with authorization server keys."
}
Note: This error is returned when I send the registration request to https://<openemr_url>/openemr/oauth2/<site_parameter>/registration rather than https://<openemr_url>/oauth2/<site_parameter>/registration. https://<openemr_url>/oauth2/<site_parameter>/registration returns a 404 error.
My problem seems similar to Getting Error While Calling the Authorization Code Grant - #13 by mohit, so I tried following some of the guidance within that thread and enabled debug logs and checked the openEMR database for oauth2key and oauth2passphrase. My database only has oauth2key.
I checked C:\xampp\htdocs\openemr\sites\default\documents\certificates and neither keys are present. As far as I can tell, there is not a permission issue with the folder as everything is running as a Windows service.
I deleted the oauth2key, restarted everything, and issued another registration request from Postman. A new oauth2key was generated, but not oauth2passphrase and there are no keys in C:\xampp\htdocs\openemr\sites\default\documents\certificates.
A bit stuck on how to proceed here. Any help or guidance is greatly appreciated.
OpenEMR Version
I’m using OpenEMR version 6.0
Browser:
I’m using: Google Chrome (91.0.4472.124)
The database administration opened in Internet Explorer, but should not impact anything.
Operating System
I’m using: Microsoft Windows Server 2019 Data Centre (1809)
Logs
[Thu Jul 01 18:08:17.268416 2021] [php:notice] [pid 4484:tid 1908] [client ::1:62376] [2021-07-01T20:08:17.267167+02:00] OpenEMR.DEBUG: oauth2 request received {"endpoint":"/default/registration"} []
[Thu Jul 01 18:08:17.278417 2021] [php:notice] [pid 4484:tid 1908] [client ::1:62376] [2021-07-01T20:08:17.278401+02:00] OpenEMR.ERROR: OpenEMR error - oauth2 passphrase is missing, so forced exit [] []