I have a browser-based tool (with backend) much like the advanced MySmartThings app, but offering some additional capabilities. It was originally implemented to use PATs, which has worked great. I’m now converting it to use oauth, but am running into some issues that might be showstoppers. I’m hoping you can help me.
1) When creating an oauth-in app using the CLI, there is a very limited list of scopes to choose from. Specifically, here is the list available via the CLI prompts:
r:devices:*, w:devices:*, x:devices:*, r:hubs:*, r:locations:*, x:locations:*, r:scenes:*, x:scenes:*, r:rules:*, w:rules:*, r:installedapps
but here is the list I need, based on the various API calls my app can make for the user:
r:apps:*,r:channels:*,r:customcapability,r:deviceprofiles,l:devices,r:devices:*,w:devices:*,x:devices:*,r:drivers:*,w:drivers:*,r:installedapps:*,l:installedapps,r:invitations,r:locations:*,x:locations:*,r:rules:*,w:rules:*,x:rules:*,r:scenes:*,x:scenes:*,r:schedules
2) When redirecting to the SmartThings Login page, you present the user with a list of locations with only one to be selected. However I need to allow users to select from their list of locations from within my app and perform various API calls accordingly. I don’t want them to have to sign out and sign back in again every time they want to switch to a different location. (Using PATs, there’s no issue.).
Unfortunately the login page is returning a server error for me right now when a location is selected, but before the ‘Authorize’ button is even clicked, which is a whole other problem. Let’s deal with that separately.
Is the oauth process intentionally designed to limit API access as I found above? Is there a way to provide a more expansive list of scopes when creating an app with the CLI? And is the oauth login process always going to limit me to a specific location?