500 Internal Server Error during oAuth Authorization

I get the dreaded 500 error when trying the auth workflow to get an access token.

Is there any way to get the actual stack trace to see what I am doing wrong? Do you see anything wrong/missing from the request?

Thanks for your time.

I suspect they may do some rate limiting on auth calls. Anyway, I also start getting 500’s when testing my app once in a while.

Thanks @geko
This has been happening for two days now. Do you see anything wrong with the request?

Actually, you also have to include redirect_uri in your request.

I did earlier with same results, but I thought of removing it for calling from Postman

Can someone from smartthings look into the logs based on the reference code or comment on what could be wrong here?

Hi @geko! Sorry to bother you again but you are the only one seem to be responding (and thanks for that :slight_smile: ).
I see that I am logged in because “My Devices” etc links show up in the response, but I was expecting a token in a JSON response, which is not part of it. Also the response is in html. Any thoughts?

I was using my friend’s credentials who I gave access to my account. These errors can certainly use some finesse. :confused:

Old thread but having the same problem. Support was unable to give my any suggestion other than trying here. This is the latest thread I could find, and I’ve read most of them.

I can get the code, makes me sign in and authorize then redirect back to the initiating program and attempt to get the token, without success using https://github.com/adoy/PHP-OAuth2

Any suggestions or working PHP example appreciated.

Here is a snippet of the PHP code

const TOKEN_ENDPOINT         = 'https://graph.api.smartthings.com/oauth/token';
$params = array('code' => $_GET['code'], 'redirect_uri' => REDIRECT_URI, 'scope'=>'app');
$response = $client->getAccessToken(TOKEN_ENDPOINT, 'authorization_code', $params);

the getAccessToken function adds the proper header, Client_id, and Client_Secret. Same result with or without the scope=app param

Oh No! Something Went Wrong!

500: Internal Server Error
Reference Id
Tue May 15 18:00:14 UTC 2018

Just fixed it!
Changed connection points