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

**URL:** <https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548>\
**Category:** OpenEMR Development\
**Created:** [June 1, 2022, 12:28am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548 "2022-06-01T00:28:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkappiah](https://community.open-emr.org/user_avatar/community.open-emr.org/kkappiah/32/16222_2.png) [@kkappiah](https://community.open-emr.org/u/kkappiah)\
**Post date:** [June 1, 2022, 12:28am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/1 "2022-06-01T00:28:58Z")

</div>

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.

```auto
/oauth2/default/registration 404 (Not Found)

```

I also get

```auto
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.

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [June 1, 2022, 1:40am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/2 "2022-06-01T01:40:45Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![kkappiah](https://community.open-emr.org/user_avatar/community.open-emr.org/kkappiah/32/16222_2.png) [@kkappiah](https://community.open-emr.org/u/kkappiah)\
**Post date:** [June 1, 2022, 11:06am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/3 "2022-06-01T11:06:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kkappiah](https://community.open-emr.org/user_avatar/community.open-emr.org/kkappiah/32/16222_2.png) [@kkappiah](https://community.open-emr.org/u/kkappiah)\
**Post date:** [June 1, 2022, 12:38pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/4 "2022-06-01T12:38:42Z")

</div>

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

 ![Screen Shot 2022-06-01 at 12.29.32 PM](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/b/0/b03e01cae44b8c27ab8d1ba7742003c6425d0856.png)

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

```

 ![Screen Shot 2022-06-01 at 12.32.44 PM](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/0/3/03902df00f2115aac9d2b47eaf9d8d077716b982.png)

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [June 1, 2022, 1:57pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/5 "2022-06-01T13:57:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kkappiah](https://community.open-emr.org/user_avatar/community.open-emr.org/kkappiah/32/16222_2.png) [@kkappiah](https://community.open-emr.org/u/kkappiah)\
**Post date:** [June 1, 2022, 2:09pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/6 "2022-06-01T14:09:22Z")

</div>

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

 ![Screen Shot 2022-06-01 at 2.02.29 PM](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/7/a/7abbd274085a5f06aac26a8ae8ae8c1b18592f68.png)

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [June 4, 2022, 10:29pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/7 "2022-06-04T22:29:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kkappiah](https://community.open-emr.org/user_avatar/community.open-emr.org/kkappiah/32/16222_2.png) [@kkappiah](https://community.open-emr.org/u/kkappiah)\
**Post date:** [June 4, 2022, 10:58pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/8 "2022-06-04T22:58:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nirav\_Shah](https://community.open-emr.org/user_avatar/community.open-emr.org/nirav_shah/32/17249_2.png) [@Nirav\_Shah](https://community.open-emr.org/u/Nirav_Shah)\
**Post date:** [February 25, 2023, 3:58am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/9 "2023-02-25T03:58:38Z")

</div>

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!!!

---

<div class="post-metadata">

**Author:** ![Nirav\_Shah](https://community.open-emr.org/user_avatar/community.open-emr.org/nirav_shah/32/17249_2.png) [@Nirav\_Shah](https://community.open-emr.org/u/Nirav_Shah)\
**Post date:** [February 25, 2023, 4:24am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/10 "2023-02-25T04:24:59Z")

</div>

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

 ![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/6/7/67bfb46c79ae2fa888d85852bc3e1d8bfcdd3006.png)

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [February 25, 2023, 12:34pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/11 "2023-02-25T12:34:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nirav\_Shah](https://community.open-emr.org/user_avatar/community.open-emr.org/nirav_shah/32/17249_2.png) [@Nirav\_Shah](https://community.open-emr.org/u/Nirav_Shah)\
**Post date:** [February 27, 2023, 3:33pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/12 "2023-02-27T15:33:32Z")

</div>

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.

 ![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/8/f/8f0f6960803c1068a2240321981881f6b9b2686a.png)  
 ![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/e/4/e4a2a5ea7e4d657e9c500d1aa0cddda68f2cbe04.png)

Regards,  
Nirav Shah

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [February 27, 2023, 4:00pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/13 "2023-02-27T16:00:53Z")

</div>

> [@adunsulag](#):
>
> 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).

Did you follow these instructions?

---

<div class="post-metadata">

**Author:** ![Kaustubh\_Pathak](https://community.open-emr.org/user_avatar/community.open-emr.org/kaustubh_pathak/32/18180_2.png) [@Kaustubh\_Pathak](https://community.open-emr.org/u/Kaustubh_Pathak)\
**Post date:** [February 28, 2023, 5:51am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/14 "2023-02-28T05:51:56Z")

</div>

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.

 ![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/e/0/e05199b01c308cbc241fdb3391b89d72f05c3d4c.png)

---

<div class="post-metadata">

**Author:** ![Kaustubh\_Pathak](https://community.open-emr.org/user_avatar/community.open-emr.org/kaustubh_pathak/32/18180_2.png) [@Kaustubh\_Pathak](https://community.open-emr.org/u/Kaustubh_Pathak)\
**Post date:** [February 28, 2023, 5:52am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/15 "2023-02-28T05:52:33Z")

</div>

![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/5/1/51523b97b004328b5c9f5c8cbe13ddb4915ec42f.png)

---

<div class="post-metadata">

**Author:** ![Kaustubh\_Pathak](https://community.open-emr.org/user_avatar/community.open-emr.org/kaustubh_pathak/32/18180_2.png) [@Kaustubh\_Pathak](https://community.open-emr.org/u/Kaustubh_Pathak)\
**Post date:** [February 28, 2023, 5:53am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/16 "2023-02-28T05:53:03Z")

</div>

![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/5/5/55ab5645e7864224e2ed743d58d79189eebb35e8.png)

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [February 28, 2023, 3:01pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/17 "2023-02-28T15:01:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kaustubh\_Pathak](https://community.open-emr.org/user_avatar/community.open-emr.org/kaustubh_pathak/32/18180_2.png) [@Kaustubh\_Pathak](https://community.open-emr.org/u/Kaustubh_Pathak)\
**Post date:** [February 28, 2023, 3:33pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/18 "2023-02-28T15:33:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [February 28, 2023, 4:51pm UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/19 "2023-02-28T16:51:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kaustubh\_Pathak](https://community.open-emr.org/user_avatar/community.open-emr.org/kaustubh_pathak/32/18180_2.png) [@Kaustubh\_Pathak](https://community.open-emr.org/u/Kaustubh_Pathak)\
**Post date:** [March 1, 2023, 8:32am UTC](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548/20 "2023-03-01T08:32:53Z")

</div>

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

[Next page](https://community.open-emr.org/t/oauth2-default-registration-not-found-during-smart-app-registration/18548.md?page=2)
