# Oauth Error for Obtaining Access Code 500

**URL:** <https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956>\
**Category:** General Discussion\
**Tags:** developers\
**Created:** [April 2, 2016, 5:48am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956 "2016-04-02T05:48:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 2, 2016, 5:48am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/1 "2016-04-02T05:48:29Z")

</div>

Is anybody else having issues getting access codes from the SmartThings API? I had some code that worked earlier, but it seems like the end point is throwing a 500 error before it tries to go to the call back URL

 ![](https://global.discourse-cdn.com/smartthings/original/3X/5/a/5a47ba60561225485cd12b8f9badc6048e7d1efa.png).

---

<div class="post-metadata">

**Author:** ![tgauchat](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/tgauchat/32/49516_2.png) [@tgauchat](https://community.smartthings.com/u/tgauchat)\
**Post date:** [April 2, 2016, 6:13am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/2 "2016-04-02T06:13:40Z")

</div>

What shard are you on?

If you are brand new, you may not be on `graph.api.smarthing.com`, but `https://graph-na02-useast1.api.smartthings.com`

Just guessing. The server shard URL is usually a different error code.

---

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 2, 2016, 6:21am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/3 "2016-04-02T06:21:31Z")

</div>

I’ll try that! Hold please!

---

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 2, 2016, 6:27am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/4 "2016-04-02T06:27:15Z")

</div>

Hmmmm, no dice.

This is the URL I’m trying to access for the code:  
[https://graph-na02-useast1.api.smartthings.com/oauth/authorize?response\_type=code&client\_id=562ff872-c8f1-46a4-9bbe-997167f44d2f&scope=app&redirect\_uri=http%3A%2F%2F45.56.68.163%2Fsmartthings%2Falarm\_sensor\_status.php](https://graph-na02-useast1.api.smartthings.com/oauth/authorize?response_type=code&client_id=562ff872-c8f1-46a4-9bbe-997167f44d2f&scope=app&redirect_uri=http%3A%2F%2F45.56.68.163%2Fsmartthings%2Falarm_sensor_status.php)

---

<div class="post-metadata">

**Author:** ![tgauchat](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/tgauchat/32/49516_2.png) [@tgauchat](https://community.smartthings.com/u/tgauchat)\
**Post date:** [April 2, 2016, 6:30am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/5 "2016-04-02T06:30:07Z")

</div>

Is the redirect IP accessible from the internet (sorry if this is a dumb question… it won’t work if LAN only).

**BTW:** Ironically, I’m binge watching Mr. Robot tonight.

---

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 2, 2016, 6:40am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/6 "2016-04-02T06:40:56Z")

</div>

It is!

It’s odd — I had the same code running earlier, but had somehow installed the SmartApp to my hub multiple times. Was cleaning it up, and accidentally removed the one that I wanted to keep of the three. I’ve tried regenerating the client/secret and I also took my source, deleted the app, recreated it, and tried it with those new oauth credentials too.

It’s puzzling.

---

<div class="post-metadata">

**Author:** ![tgauchat](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/tgauchat/32/49516_2.png) [@tgauchat](https://community.smartthings.com/u/tgauchat)\
**Post date:** [April 2, 2016, 6:47am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/7 "2016-04-02T06:47:48Z")

</div>

> [@cdatwood](#):
>
> It’s puzzling.

It definitely could be temporary … SmartThings platform has hiccups all the time.  
Sometimes little things help like pasting into an entirely new SmartApp.

Since you had it working, I doubt I’d find anything wrong with your flow.

---

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 2, 2016, 6:48am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/8 "2016-04-02T06:48:36Z")

</div>

Makes me feel less crazy. Though I do miss my hacked alarm sensors working. 😃

---

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 2, 2016, 3:53pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/9 "2016-04-02T15:53:09Z")

</div>

Hmmmmm. About 8 hours later, the oauth end point is still returning a 500 on SmartThing’s side … something need to get rebooted? ☹ @slagle

---

<div class="post-metadata">

**Author:** ![RZR666](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@RZR666](https://community.smartthings.com/u/RZR666)\
**Post date:** [April 3, 2016, 4:49pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/10 "2016-04-03T16:49:53Z")

</div>

I was hitting this error all day yesterday, I figured I was doing something wrong. It’s nice to know it might not be an issue with my code.

---

<div class="post-metadata">

**Author:** ![RZR666](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@RZR666](https://community.smartthings.com/u/RZR666)\
**Post date:** [April 3, 2016, 4:56pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/11 "2016-04-03T16:56:48Z")

</div>

still getting the same error today,

`"https://graph.api.smartthings.com/oauth/token?grant_type=authorization_code&client_id=" + OAuthClientId + "&client_secret=" + OAuthClientSecret + "&redirect_uri=" + redirectURL + "&scope=app&code=" + authorizationCode"`

---

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 3, 2016, 5:14pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/12 "2016-04-03T17:14:15Z")

</div>

Yeah, me too. Support said it was related to their new server setup and they were working to get it back online.

---

<div class="post-metadata">

**Author:** ![RZR666](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@RZR666](https://community.smartthings.com/u/RZR666)\
**Post date:** [April 3, 2016, 5:29pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/13 "2016-04-03T17:29:28Z")

</div>

So many hours wasted and it might not have been an issue on my end! 😫

I got the authorization code without an issue, then tried so many different combinations to get that access token.

---

<div class="post-metadata">

**Author:** ![tgauchat](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/tgauchat/32/49516_2.png) [@tgauchat](https://community.smartthings.com/u/tgauchat)\
**Post date:** [April 3, 2016, 6:40pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/14 "2016-04-03T18:40:43Z")

</div>

FYI: To the best of my knowledge, **SmartTiles** installations are still working, from sources in all 3 shards.  
Give it a try… I can’t personally test the **NA02** shard as I don’t have an account on it:

- [http://SmartTiles.click/install](http://SmartTiles.click/install)

_(I presume you have the SmartApp code in the same shard (URL) as the install attempt. Just curious if this is affecting everyone or what the situation is…)._

---

<div class="post-metadata">

**Author:** ![cdatwood](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cdatwood/32/29437_2.png) [@cdatwood](https://community.smartthings.com/u/cdatwood)\
**Post date:** [April 3, 2016, 7:33pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/15 "2016-04-03T19:33:47Z")

</div>

I had tried both shards with same result on my end. Can’t get an access code or a token. Hopefully they get it fixed soon.

---

<div class="post-metadata">

**Author:** ![RZR666](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@RZR666](https://community.smartthings.com/u/RZR666)\
**Post date:** [April 5, 2016, 2:49pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/16 "2016-04-05T14:49:47Z")

</div>

I tried it on,

[https://graph-eu01-euwest1.api.smartthings.com/](https://graph-eu01-euwest1.api.smartthings.com/)

which is what my IDE directs me to, but still getting that OAuth 500 error.

---

<div class="post-metadata">

**Author:** ![thmstec](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/thmstec/32/21433_2.png) [@thmstec](https://community.smartthings.com/u/thmstec)\
**Post date:** [April 28, 2016, 1:31am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/17 "2016-04-28T01:31:02Z")

</div>

So I was getting a similar 500 error when attempting to setup The Home Remote.

> [@New design interface for smartthings (diy gui) all platforms](https://community.smartthings.com/t/new-design-interface-for-smartthings-diy-gui-all-platforms/25701/147):
>
> Tried using the na02 shard (which I don’t think I’m on since the IDE sends me to the other US one) and I got a 403 Forbidden instead of a 500. Updated to 1.2.13.13 and got the same 500 error again. Decided to try one more time while watching the logs at [https://graph.api.smartthings.com/ide/logs](https://graph.api.smartthings.com/ide/logs) not sure if I’d get any useful info. Aaannnd… it works.

Ended up getting around it by just having the log open… IDK if it’ll help any of you, but figured it’d be worth posting here if it does happen to work for anyone else.

---

<div class="post-metadata">

**Author:** ![sruthi](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@sruthi](https://community.smartthings.com/u/sruthi)\
**Post date:** [May 14, 2016, 12:40am UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/18 "2016-05-14T00:40:08Z")

</div>

I am facing with the OAuth 500 error but couldn’t find any solution so far. I tried using different libraries but nothing worked out.

---

<div class="post-metadata">

**Author:** ![SplitIce](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@SplitIce](https://community.smartthings.com/u/SplitIce)\
**Post date:** [August 25, 2016, 12:58pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/19 "2016-08-25T12:58:30Z")

</div>

Did anyone resolve this? If so, how?

We are seeing this issue ourselves many months later.

---

<div class="post-metadata">

**Author:** ![tryagain](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@tryagain](https://community.smartthings.com/u/tryagain)\
**Post date:** [August 26, 2016, 3:18pm UTC](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/20 "2016-08-26T15:18:21Z")

</div>

have the same problem also… tried the na02 domain, rebuilt the app, changed the client\_id. Can’t get past the 500 error.

[Next page](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956.md?page=2)
