# OAuth Internal Error

**URL:** <https://community.smartthings.com/t/oauth-internal-error/55564>\
**Category:** General Discussion\
**Tags:** developers\
**Created:** [August 23, 2016, 11:13pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564 "2016-08-23T23:13:55Z")\
**Posts on this page:** 8\
**Page:** 1

<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 23, 2016, 11:13pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564/1 "2016-08-23T23:13:55Z")

</div>

I am seeing an internal Smart Things error when attempting to call /oauth/authorize.

I beleive I have followed the documentation exactly, but have been able to get through this first (simple) step.

Error  
500: Internal Server Error  
URI  
/oauth/authorize  
Reference Id  
b22bf166-9853-4261-9ef2-946b263c00ee  
Date  
Tue Aug 16 05:11:43 UTC 2016  
I am calling: [https://graph.api.smartthings.com/oauth/authorize?response\_type=code&client\_id=f325b40c-b270-4585-9ecb-e73fd1\*\*\*\*\*\*&scope=app&redirect\_uri=https://graph.api.smartthings.com/oauth/callback](https://graph.api.smartthings.com/oauth/authorize?response_type=code&client_id=f325b40c-b270-4585-9ecb-e73fd1 ****** &scope=app&redirect_uri=https://graph.api.smartthings.com/oauth/callback)  
I have tested this from multiple browsers.  
I am following the documentation covering that API call is at [http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/authorization.html](http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/authorization.html) ([http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/authorization.html](http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/authorization.html))  
I am also following some basic documentation left by the old development team of this product.

---

<div class="post-metadata">

**Author:** ![Jim](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jim/32/15313_2.png) [@Jim](https://community.smartthings.com/u/Jim)\
**Post date:** [August 23, 2016, 11:17pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564/2 "2016-08-23T23:17:53Z")

</div>

Looks like you’re using [graph.smartthings.com](http://graph.smartthings.com) as the `redirect_uri`, it should be the uri of your Web server endpoint that accepts the token.

---

<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 23, 2016, 11:30pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564/3 "2016-08-23T23:30:04Z")

</div>

I have tried that too without any change, no request is ever received at the server. I switched to the smart things endpoint on the suggestion of others as a test.

`https://graph.api.smartthings.com/oauth/authorize?response_type=code&client_id=f325b40c-b270-4585-9ecb-e73fd1 ******&scope=app&redirect_uri=http://108.61.251.*** /oauth/callback`

```
# tcpdump -n tcp port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel

```

I didn’t expect any though with a standard OAuth process given the error (unless there was some form of request for validation). The error is occurring on the first stage - normally the browser would just be redirected, and that clearly is not occuring due to the internal server error.

I have also tested the shard directly (na-02) and using a domain name, not an IP. None produce any different results.

---

<div class="post-metadata">

**Author:** ![cpisano](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cpisano/32/38228_2.png) [@cpisano](https://community.smartthings.com/u/cpisano)\
**Post date:** [August 25, 2016, 7:51pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564/4 "2016-08-25T19:51:38Z")

</div>

I am experiencing the same issue.

I think that there is minimal validation on the selection page and then upon submit the OAUTH is validated. Since no valuable message or log occurs, it is hard to figure out what is happening.

---

<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 28, 2016, 11:47pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564/5 "2016-08-28T23:47:38Z")

</div>

@cpisano Indeed.

I don’t doubt the possibility of some silly mistake / trap. Unfortunately everyone I have got in contact with in regards to this issue does not have a solution.

I’ve had an open ticket with Samsung for the past 2 weeks, I’ll be sure to update this thread if there is any solution from that front…

---

<div class="post-metadata">

**Author:** ![erobertshaw](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/erobertshaw/32/19802_2.png) [@erobertshaw](https://community.smartthings.com/u/erobertshaw)\
**Post date:** [August 29, 2016, 8:10pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564/6 "2016-08-29T20:10:27Z")

</div>

I just posted on a similar thread. [Oauth Error for Obtaining Access Code 500](https://community.smartthings.com/t/oauth-error-for-obtaining-access-code-500/43956/22?u=erobertshaw)

Maybe a solution?

---

<div class="post-metadata">

**Author:** ![cpisano](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/cpisano/32/38228_2.png) [@cpisano](https://community.smartthings.com/u/cpisano)\
**Post date:** [August 31, 2016, 3:09pm UTC](https://community.smartthings.com/t/oauth-internal-error/55564/7 "2016-08-31T15:09:21Z")

</div>

I was able to eventually get past this…

What seemed to work was how I was calling the first authorization URL. I am using PHP, and assumed the call had to be a valid OAUTH call (with the headers all set properly). And I found out that was not the case.

I just simply redirected to the URL: [https://graph.api.smartthings.com/oauth/authorize?response\_type=code&client\_id={0}&scope=app&redirect\_uri={1}](https://graph.api.smartthings.com/oauth/authorize?response_type=code&client_id=%7B0%7D&scope=app&redirect_uri=%7B1%7D) and it worked.

Let me know.

---

<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:** [September 2, 2016, 3:08am UTC](https://community.smartthings.com/t/oauth-internal-error/55564/8 "2016-09-02T03:08:34Z")

</div>

Fixed!

Step 1. Delete Application  
Step 2. Create again with same code, getting you a new set of IDs.
