Hi, can you please help me on this…
Demo Server Flow:
- https://one.openemr.io/c/openemr/oauth2/default/registration
- Swagger UI: OAuth2 Redirect
- OpenEMR Error
- https://one.openemr.io/c/openemr/oauth2/default/smart/patient-select
- https://one.openemr.io/c/openemr/oauth2/default/scope-authorize-confirm
My Local Windows Installation (7.0.2)
My Configuration:
- Created sample patient from UI
- Admin → Config → Connectors
Site Address Override (if needed for OAuth2, FHIR, CCDA, or Payment Processing) = http://localhost/openemr
App Registration:
- From Postman: http://localhost/openemr/oauth2/default/registration
- Got client app registered and got client_id, client_secret
- Enabled my app from UI
My Authorization flow from Swagger:
- http://localhost/openemr/swagger/index.html
- Click on ‘Authorize’ and I can see below
Authorization URL: /oauth2/default/authorize
Token URL: /oauth2/default/token
Flow: authorizationCode with PKCE - Provided client_id, client_secret, select all scopes and click ‘Authorize’
- Opened a new tab in browser with http://localhost/oauth2/default/authorize?response_type=code&client_id=…
and the response is “The requested URL was not found on this server.” - Updated the URL by adding /openemr after localhost as below
http://localhost/openemr/oauth2/default/authorize?response_type=code&client_id=… - Now redirected to ‘Login Page’ (http://localhost/openemr/oauth2/default/provider/login)
- After entering the credentials, redirected to http://localhost/openemr/openemr/oauth2/default/smart/patient-select
and the response is “The requested URL was not found on this server.” - Updated the URL by removing one /openemr as http://localhost/openemr/oauth2/default/smart/patient-select
- Now patient selection is showed
- By selecting the patient, redirected to http://localhost/openemr/openemr/oauth2/default/smart/patient-select-confirm
and the response is “The requested URL was not found on this server.” - Again updated the URL by removing the extra /openemr and got the response as
Warning: Undefined array key “csrf_token” in C:\xampp\htdocs\openemr\src\RestControllers\SMART\SMARTAuthorizationController.php on line 199
Authentication Error
Though I followed the above suggestion by @adunsulag , it’s still not adding /openemr in initial request and adding extra /openemr for later requests. Not sure what’s happening. Can you please help me to fix this.