I am using the SmartThings CLI on Windows to manage my SmartThings apps. After running `smartthings login`, my browser opens and redirects me to a localhost URL like:
Hi, @Dyaa_4
Sorry, we’re on holiday today.
After a quick scan, I noticed you’re using a localhost URL.
You need to use an HTTPS URL for the redirect URI.
Tools such as Ngrok can help you create a tunnel for the local port you open using an HTTPS URL.
Hey, thank you. Ah, okay. But that’s not the problem. I tried to log in with the new version of the SmartThings CLI, and after that I got this message.
The CLI doesn’t have a login command so that’s odd, but when first used with a valid conmand that needs the API it will open a browser to do an OAUTH authorisation. That URL is handled by the CLI itself and you should have seen a message something like ‘You can close this window’. If you didn’t then something is wrong.
At some stage you will probably also have had a popup from Windows to allow the CLI access to node.js. That will be important.
I’d be tempted to do smartthings --version to make sure you do indeed have the latest version which I believe is 2.1.1. If you need to update from a version 1.x.y installation I suggest doing smartthings logout as the location of the configuration directory has been moved between major releases and it will move the config file for you. You might like to do that anyway so you can start over.
It may be useful to set SMARTTHINGS_DEBUG=true to make the CLI a bit more chatty and then try smartthings apps again.
That’s odd. That’s normally means something like invalid characters in a URL. The debugging might be enlightening.
Sorry for the confusion, @Dyaa_4
I tried to use the command you mentioned but the CLI rejects it so it’s odd you even got a different error as @orangebucket said.
Please let us know the result of the tests mentioned by Graham above.