Update settings from OAuth


(Brice; SmartRulesApp.com) #1

I’m searching for a way to update SmartApp settings via the OAuth interface without logging out and logging back in. Is there an API that I’m missing for getting back to the screen where you select which devices to expose to the SmartApp? I’d like to make it so that I don’t have to logout, then log back in to add a new device.


(Jody) #2

Are you getting CSRF errors when trying to add additional devices? In my external app, I do not need to log in if I already have an authorization token, It takes me straight to a list of devices.


(Brice; SmartRulesApp.com) #3

No, I’m not seeing any CSRF errors. Straight to a list of devices when you pull up what URL?


(Jody) #4

In my app I have the path /auth/smartthings

If the currently signed in user does not have an authorization token, hitting that url will authorize the app. If the user already has the token, it brings up a list of devices that they can choose to expose to the smart app. Standard oauth flow. I use the omni-auth ruby library to do the heavy lifting.


(Brice; SmartRulesApp.com) #5

Oh, ok. So maybe I just have something wrong. I’ll double check that. Thanks for your help!


(Jody) #6

The reason I asked about CSRF errors is that sometimes during the auth flow the ST side of things will reject your request as a possible CSRF.