I feel really stupid, but I still can’t get this to work.
I’ve gone to https://graph.api.smartthings.com/ directly and logged out, then requested the token with:
https://graph.api.smartthings.com/oauth/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=https%3A%2F%2Flocalhost&scope=app
(where CLIENT_ID is replaced with the client ID from the app settings, of course)
I still get the invalid_client / Bad client credentials issue. I’ve tried with Chrome and Firefox.
Does anyone have any suggestions / corrections to my method, please?
Edit: To be very precise, I’ve also followed the instructions in the documentation at http://smartthings.readthedocs.org/en/latest/smartapp-web-services-developers-guide/tutorial-part2.html#get-the-oauth-authorization-code but I’m still unable to get the authorization code, even after trying a different browser that has never logged in to any smartthings site. I’ve also tried deleting all smartthings related cookies.
Edit2: I’ve noticed something strange, but I’m not sure if it’s related. If I go to the authorize URL, login, then get the invalid_client/Bad credentials error, then just go to https://graph.api.smartthings.com , it looks like I’ve logged in, but it doesn’t show any apps / devices for me. After a couple of clicks between tabs it asks me to log in again and the site works. I still don’t have the OAuth token, though.
Edit3: I’ve also tried a Chrome incognito tab. I’ve noticed that I can put any client ID in, and I always get the same error. I’ve tried with the smartapp installed to my account and with it uninstalled. I’ve tried changing the client ID, republishing, reinstalling, etc. all with no further progress. I guess that I’ll just have to work with the app only installed in the IDE for now, but that’s a bit annoying as the URL changes regularly.