I installed the smartthings cli on my Mac, and it seems to be working, but I’m unable to authorize. When I run smartthings --version, it displays fine. When I run smartthings rooms I get a browser window that pops up asking for me to authorize. I do, and I get " Failure obtaining access token."
I’ve tried getting around that by generation a personal access token, but when I do that smartthings rooms --token=my_token, I get
Error: self signed certificate in certificate chain
Code: SELF_SIGNED_CERT_IN_CHAIN
[2022-08-24T10:21:41.457] [DEBUG] login-authenticator - authentication - enter
[2022-08-24T10:21:41.460] [DEBUG] login-authenticator - login start: listening on port 61973
[2022-08-24T10:21:41.882] [DEBUG] login-authenticator - redirecting to SmartThings. Add a little smartness to your things.
[2022-08-24T10:22:04.543] [DEBUG] login-authenticator - making axios request: https://oauthin-regional.api.smartthings.com/oauth/token
[2022-08-24T10:22:04.635] [ERROR] login-authenticator - error obtaining token: self signed certificate in certificate chain
[2022-08-24T10:22:09.675] [ERROR] login-authenticator - unable to get authentication info
logging in… failed
Select the time period and confirm - In this step, please select “Until turned off”, once the team finishes, we’ll let you know so you can disable it again.
Following up on this case.
The team hasn’t been able to replicate the issue even using your account, so, we’d like to know more about your environment, so could you provide the following, please?
Are you using a VPN or Proxy? If so, which one?
What is your default browser (and which version is it using)?
After successful login hitting the authorization button on SmartThings - Authorize
It appears the [localhost:61973/finish?code=54w5ph] is running into an issue that results in Failure obtaining access token.
Hi @Luthrajat ,
To address the authorization issue with the SmartThings CLI, please follow these steps:
Check CLI Version:
Verify the version of the CLI you are using. This is important to ensure you are on a compatible and updated version. Run the following command:
smartthings --version
Verify Certificate Configuration:
The error “self signed certificate in certificate chain” indicates a problem with the SSL certificate. This may occur if your system is trying to use an untrusted certificate. You can try configuring the CLI to ignore these certificate errors (not recommended for production environments) or add the correct root certificate.
Configure Access Token:
To ensure that your access token is always used, follow the configuration steps in the SmartThings CLI documentation. You can find it at the following link: SmartThings CLI Configuration
If the issue persists after following these steps, please provide additional details such as the specific CLI version and your environment configuration for more precise assistance.