/oauth2/default/registration not found during SMART App registration

Hello @adunsulag,

I am in the process of registering a SMART app. When i click the submit button, I get error 404 (not found) which is pointing to openemr/oauth2/default/registration. /default and /registration directories cannot be found.

/oauth2/default/registration 404 (Not Found)

I also get

register-app.php:100 SyntaxError: Unexpected token < in JSON at position 0

I am currently running OpenEMR V6.1.1

Please advice, thanks in advance.

Have you setup your FHIR site url in Admin → Globals → Connectors → Site Address Override (if needed for OAuth2, FHIR, CCDA, or Payment Processing)?

Does the address you are using to access OpenEMR match what you have in the site address override? The Register App UI will only work if the domains are the same (CSRF protections here).

When i checked, the url value was set to 1 by default. Thanks much @adunsulag, your suggestion worked.

There’s another problem. After registering the app, I cant authorize using the Swagger interface. I still have cannot be found errors in the console

Failed to load resource: the server responded with a status of 404 (Not Found)

What are you using for the redirect url for your app when you registered? If I remember correctly it needs to go to the /swagger/oauth2-redirect.html page.

That’s exactly what i did. I followed your presentation on the FHIR API. Please see my configuration below.

Hi Kofi, just wanted to ping you and see if you were able to get the authentication going on the demo environment or if your logs gave you any more details here?

Hello Stephen,

I restarted the server and it began to work some few minutes ago. Also, there’s one thing that i found out with the API. If you want to use fhir related endpoints, you need to select api:fhir. Same applies to the standard api (api:oemr)else you’ll encounter the invalid scope error.

Thanks again Stephen for your help.

1 Like