Oauth Error for Obtaining Access Code 500


(Chris Atwood) #1

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

.


New design interface for smartthings (diy gui) all platforms
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

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.


(Chris Atwood) #3

I’ll try that! Hold please!


(Chris Atwood) #4

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


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #5

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.


(Chris Atwood) #6

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.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #7

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.


(Chris Atwood) #8

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


(Chris Atwood) #9

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


(Mark) #10

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.


(Mark) #11

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"


(Chris Atwood) #12

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


(Mark) #13

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

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


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #14

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:

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


Issue getting token in Web Services Tutorial
(Chris Atwood) #15

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.


(Mark) #16

I tried it on,

https://graph-eu01-euwest1.api.smartthings.com/

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


(William Morris) #17

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

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.


(sruthi) #18

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.


(Mathew Heard) #19

Did anyone resolve this? If so, how?

We are seeing this issue ourselves many months later.


#20

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