"Auth error Error: Not Found" when trying to authorize on Swagger

Hi, can you please help me on this…

Demo Server Flow:

  1. https://one.openemr.io/c/openemr/oauth2/default/registration
  2. Swagger UI: OAuth2 Redirect
  3. OpenEMR Error
  4. https://one.openemr.io/c/openemr/oauth2/default/smart/patient-select
  5. https://one.openemr.io/c/openemr/oauth2/default/scope-authorize-confirm

My Local Windows Installation (7.0.2)
My Configuration:

  1. Created sample patient from UI
  2. Admin → Config → Connectors
    Site Address Override (if needed for OAuth2, FHIR, CCDA, or Payment Processing) = http://localhost/openemr

App Registration:

  1. From Postman: http://localhost/openemr/oauth2/default/registration
  2. Got client app registered and got client_id, client_secret
  3. Enabled my app from UI

My Authorization flow from Swagger:

  1. http://localhost/openemr/swagger/index.html
  2. Click on ‘Authorize’ and I can see below
    Authorization URL: /oauth2/default/authorize
    Token URL: /oauth2/default/token
    Flow: authorizationCode with PKCE
  3. Provided client_id, client_secret, select all scopes and click ‘Authorize’
  4. 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.”
  5. Updated the URL by adding /openemr after localhost as below
    http://localhost/openemr/oauth2/default/authorize?response_type=code&client_id=
  6. Now redirected to ‘Login Page’ (http://localhost/openemr/oauth2/default/provider/login)
  7. 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.”
  8. Updated the URL by removing one /openemr as http://localhost/openemr/oauth2/default/smart/patient-select
  9. Now patient selection is showed
  10. 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.”
  11. 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.