/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

I am getting Unexpected token ‘<’, "<!DOCTYPE “… is not valid JSON error while trying to register the app, following youtube video " OpenEMR FHIR Lecture Series: Lecture 1 - Overview and Use of FHIR in OpenEMR”, need help!!!

For me also I do not see any /oauth2/default folder in my server.

Did you read the thread… and follow the instructions I gave at the top of this thread… the answer is right there.

There is no default folder as its a URL parameter defined in the .htaccess file.

Thanks for clarify the about default folder,

I am getting Unexpected token ‘<’, "<!DOCTYPE “… is not valid JSON error while trying to register the app. let me know if doing something wrong. I have deselects all SYSTEM/*

Thanks in advance for your kind support.


Regards,
Nirav Shah

Did you follow these instructions?

Hi , i am getting json error "Unexpected token ‘<’, "<!DOCTYPE “… is not valid JSON” When registering App, also I have attached the Images of settings as you instructed above . i have also deselected system options.

Your connector is listed as http yet your redirect URI and launch URI are https. Make sure you are registering your app from the SSL url and not the HTTP url. The schema of your Fully Qualified Domain Name (FQDN) must match or you will hit Cross Site Request Forgery (CSRF) problems.

Thank for your response have changed it already to https and made SSL on but still the same issue is there any other suggestions

What does your javascript console say when you attempt the registration. Are you able to duplicate this issue on the demo servers or does it only happen on your environment? Is this running out of the latest code release, or what version of OpenEMR are you running?

Hey Done With that now it is working Thank you for your help problem was of envirnoment variable
OPENSSL_CONF = C:\xampp\apache\conf\openssl.cnf