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.