# Error during OAuth

**URL:** <https://developer.squareup.com/forums/t/error-during-oauth/9717>\
**Category:** Questions\
**Created:** [June 8, 2023, 10:07pm UTC](https://developer.squareup.com/forums/t/error-during-oauth/9717 "2023-06-08T22:07:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jake.gilmour](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jake.gilmour](https://developer.squareup.com/forums/u/jake.gilmour)\
**Post date:** [June 8, 2023, 10:07pm UTC](https://developer.squareup.com/forums/t/error-during-oauth/9717/1 "2023-06-08T22:07:56Z")

</div>

I am receiving an error when attempting to initiate an oauth “no healthy upstream” which is associated with a HTTP 503 response code.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 8, 2023, 10:12pm UTC](https://developer.squareup.com/forums/t/error-during-oauth/9717/2 "2023-06-08T22:12:18Z")

</div>

Is this on the `Authorize` call? What’s your app ID and what’s the full error message? 🙂

---

<div class="post-metadata">

**Author:** ![jake.gilmour](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jake.gilmour](https://developer.squareup.com/forums/u/jake.gilmour)\
**Post date:** [June 8, 2023, 10:35pm UTC](https://developer.squareup.com/forums/t/error-during-oauth/9717/3 "2023-06-08T22:35:27Z")

</div>

Our app ID is sq0idp-cyBwvH4qbp7cOmRD6aVpSA and yes this is during the authorize call. This is happening with both our test and production accounts. Below is a sample of the URL we are sending users to for completing the OAuth (with our test account, not production account). The “no healthy upstream” is the whole error message.

[https://connect.squareup.com/oauth2/authorize/?client\_id=sq0idp-WnrVtbIKOqhZXPoHGXwneA&response\_type=code&scope=MERCHANT\_PROFILE\_READ+ITEMS\_READ+INVENTORY\_READ+ORDERS\_WRITE+PAYMENTS\_WRITE+ORDERS\_READ&state=52ef72c3-4cec-40c4-a85e-828f21102cec&session=false](https://connect.squareup.com/oauth2/authorize/?client_id=sq0idp-WnrVtbIKOqhZXPoHGXwneA&response_type=code&scope=MERCHANT_PROFILE_READ+ITEMS_READ+INVENTORY_READ+ORDERS_WRITE+PAYMENTS_WRITE+ORDERS_READ&state=52ef72c3-4cec-40c4-a85e-828f21102cec&session=false)

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 9, 2023, 3:55pm UTC](https://developer.squareup.com/forums/t/error-during-oauth/9717/4 "2023-06-09T15:55:14Z")

</div>

Looks like the issue is the url, it has an extra `/` after the oauth2/authorize.  
It is this right now:

`https://connect.squareup.com/oauth2/authorize/?client_id=sq0idp-WnrVtbIKOqhZXPoHGXwneA&response_type=code&scope=MERCHANT_PROFILE_READ+ITEMS_READ+INVENTORY_READ+ORDERS_WRITE+PAYMENTS_WRITE+ORDERS_READ&state=52ef72c3-4cec-40c4-a85e-828f21102cec&session=false`

Should be this:

`https://connect.squareup.com/oauth2/authorize?client_id=sq0idp-WnrVtbIKOqhZXPoHGXwneA&response_type=code&scope=MERCHANT_PROFILE_READ+ITEMS_READ+INVENTORY_READ+ORDERS_WRITE+PAYMENTS_WRITE+ORDERS_READ&state=52ef72c3-4cec-40c4-a85e-828f21102cec&session=false`  
🙂

---

<div class="post-metadata">

**Author:** ![BrianC](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/brianc/32/112_2.png) [@BrianC](https://developer.squareup.com/forums/u/BrianC)\
**Post date:** [June 10, 2023, 6:39am UTC](https://developer.squareup.com/forums/t/error-during-oauth/9717/5 "2023-06-10T06:39:47Z")

</div>

Strictly speaking, if that’s the fix (and it is a simple fix), those two URLs should behave identically and it’s considered buggy for the form with the extraneous / to not work.

This is because these two URLs are considered identical:

- [https://domain.com/authorize](https://domain.com/authorize)
- [https://domain.com/authorize/](https://domain.com/authorize/)

In fact, many/most webservers will auto-redirect the first to the second (eg Apache does).

Cheers,  
Brian

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 12, 2023, 4:01pm UTC](https://developer.squareup.com/forums/t/error-during-oauth/9717/6 "2023-06-12T16:01:59Z")

</div>

We have a documented example in our [API Reference](https://developer.squareup.com/reference/square/o-auth-api/authorize) that shows that the extraneous `/` isn’t required or optional. So this is behaving correctly.

`The completed URL looks similar to the following example: https://connect.squareup.com/oauth2/authorize?client_id={YOUR_APP_ID}&scope=CUSTOMERS_WRITE+CUSTOMERS_READ&session=False&state=82201dd8d83d23cc8a48caf52b`  
🙂
