Oauth authentication from a standalone iOS app

ios
oauth
webservices

(Bill Nmeth) #1

Let’s assume I have a Web Service SmartApp providing several REST API. I want to use this from my standalone iOS application (which has no backend connection at all).

I have a question regarding the Oauth2 Login:
If I understand well, first time, when the user clicked the “Connect Smartthings” button in my iOS app, I need to open a UIWebView to display the SmartThings Login Page the user to be able to login, install my Web Service SmartApp, specify the devices to which my system is being granted access. But the HTTP request to get the authorization code require a “redirect_uri” specified. But I have no external server, my app is a standalone app… How can my iOS app get back the authorization code? Can I start an HTTPServer on my iOS app and specify its URL as “redirect_uri”?

Is there any available source example how to solve this?

May it possible to avoid the usage of a WebView somehow? I assume not (the user must go through the process to install my Web Service SmartApp and add permissions, right?)

Thank you for your help!


(sidjohn1) #2

Check out obything and obyrules. Both are are IOS + ST


(sruthi) #3

Were you able to use WebView for the Authentication process? I tried to display smart things login page on UIWeb View but after login I was not able to get the OAuth Token and returning an error 500. Please let me know if you were able to get the Oauth Token through Web View.

Thanks!