SmartThings Community

OAuth callbacks on localhost


Hi there. Trying to write an app that will use a web service smartapp. Attempting to oauth to the app, all I get sent to the app to authorize my things, then get sent right back to the auth screen. I looked at IFTTT’s url and I am using something similar, but as soon as I auth, I go right back to the login screen, never hitting my app’s callback. Is there something limiting me from using a localhost callback (for development)? My url is like so:

(Joshua Lyon ( Dashboard)) #2

Have you tried URL encoding the redirect_uri and using the loopback address instead of localhost?

What kind of app are you writing?


I had it encoded before but pulled that out as ifttt (which works) didn’t seem to. Same issues with

Is there any sort of validation or something in my smartapp that I need to be aware of? It’s just a dummy/sample right now, I ma just trying to get the auth working. End goal is I am building a voice command thing and I just want to have my app be able to address individual devices (which it will do via a web service smart app). If I can get a web service to individual devices without having to make my own smart app for that I’d be happy to as well.

(Joshua Lyon ( Dashboard)) #4

The URL you provided with as the redirect_uri worked fine for me. After I logged in and authorized a device, I was redirected to the localhost address provided with a URL parameter including the OAuth Code that needs to be exchanged for a token:

As of right now, I understand the advice is to create a SmartApp with End Points if you want to interact with devices. It sounds the like the SmartThings team has heard the feedback though, so I hope they are looking into alternative solutions.

—side note—
Depending on what kind of voice control you are looking for, I developed an app for Android called SharpTools which provides Widgets and Tasker Integration. And @jody.albritton is working on a web-based dashboard which has voice control features.

If you pair the SharpTools Tasker plugins with AutoVoice, you can easily setup voice commands like "Okay Google, turn the [device_name] on":


Sorry for the long delay, I missed this response. Thanks much for taking the time. I got my server auth working (was some sort of bad cookie state with ST in one browser) so now am up and running with my basic backend for the custom voice/dashboard I’m building. I think without any intent to make it something generic and to solve for a single user – my wife – I can get it pretty solid :wink: