"Athom login" Need to be fixed ;)

Not again !:roll_eyes:!

With the new (athom-cli) version (v2.1.41) you can’t login in anymore. (See below). At the end I get the error message in the browser: Something went wrong!

With the version (v2.1.40) everything works fine…
Terminal:

/app # athom --version

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Hey developer, we’re hiring! View our open β”‚
β”‚ positions at https://go.athom.com/jobs β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
2.1.41

/app # athom login
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Hey developer, we’re hiring! View our open β”‚
β”‚ positions at https://go.athom.com/jobs β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
βœ“ Logging in…
To log in with your Athom Account, please visit https://cli.athom.com?port=35499&clientId=****
Timeout getting authorization code!

On what OS are you running?

Try updating athom CLI:
$ npm install -g athom-cli
$ athom login

It will open your favorite browser to log on.

I had a issue first time yesterday as user on Windows 10:
Solution for me: Try to do that as Administrator at least once (if you are not admin on your work profile)
It worked for me after that also as user yesterday.
Also seen reports of Mac that it worked…

I can’t !! I have the problem with the current Version 2.1.41 !!

About the OS:
Im using an Alpine-Docker Image (I’m working on a "Homey docker development environment" right now. It’s still alpha.)

What OS are you on?
Did it open a browser? and could you log on?
Did your Ahthom-cli start a Webserver on port 35499?
Your link explains Athom should send the authorization token there…

http://127.0.0.1:35499/auth?code=c*********7

As Athom isn’t reading here along all the time please submit an Issue with details (OS, Browser etc.) on Github or using email to support. Or try if Emile is online on Slack in #Developers ! That would be the fastest way by far.

Guess u missed the browser popping up to log in.

So you Putty into a Docker environment?
Guess it can’t start a Browser?
and node.js isn’t running on 127.0.0.1 …

Sorry, !!

Please have a look at my first topic, there I posted the terminal output.

Dev-OS: Docker Alpine/Node Image

OS: macOS Mojave
Borwser: Chrome (v70.0.3538.67)

When you use athom login it starts for the authentication a webserver to handle / receive the Authentication token.
Your login is started in the browser, did that open?
Have you looked in the Inspect window after logging in and authorizing your Homey’s access?

Guess you are best off with asking Ahtom direct (Slack, or email) for support.

If it works with v2.1.40, and it doesn’t with v2.1.41, I would guess it’s an issue with the CLI tool.

The diff contains a commit β€œchanged login” which sounds awfully suspicious.

@ChrisG: you can post an issue here.

This is once again a typical example of what happens when a discussion goes in the wrong direction:

I just wanted to ask if anyone else has login problems with the new athom-cli version (v2.1.41), or if I need to look for the bug in my docker configuration. I will look into the issue after the alpha release of my Homey Docker development environment and create an issue on github if necessary.

Sorry and a nice weekend…

I think everything is already mentioned but perhaps I can summarize.

In CLI v2.1.40 the login authentication would forward you to a website (which you need to open yourself), where you need to login and copy-paste the access token (into the terminal window)

In CLI v2.1.41 the login authentication has been changed. When calling Athom login the CLI will open a website (in the default browser) where you need to log in and through a temporary web server the access token is automatically forwarded to the terminal (no copy paste needed anymore)…

This will make it more easy for developers working on a Mac, Windows of Linux system…

@ChrisG I guess in your case, the browser window cannot be called for (not available in your docker image), so therefore you are not able to login on 2.1.41.

I would create the issue, because there might be more people that in their setup are running into this issue… and to at least secure that the 2.1.40 access token site will not be removed (soon)…

1 Like

THX (for the information) Chris

@ChrisG

Guess this fixes your Issue:

weejewel [5:47 PM] #developers
FYI I’ve added a fallback for athom-cli users who do not share their browser and CLI on the same machine

image

image

Hello

Thank you it works, but I noticed that the message " Paste the code: " comes twice ?:grinning:?

βœ“ Logging in...
? Paste the code: To log in with your Athom Account, please visit https://cli.athom.com?port=39869&clientId=xxxxxx
? Paste the code: xxxxxx
βœ“ You are now logged in as xxx xxx

Chris

I am struggling to get CLI working again.

I use a Mac and normally use a terminal to login and side load Apps. After the command β€˜athom login’ I get a message than a NPM update is available. Filling in my e-mail and password returns β€˜Client credentials are invalid’.

This must be the new login procedure. How do I proceed?

Thanks!

Well after a long time i wanted to use the CLI tool, but can’t. Using the latest version and running the CLI in a SSH session on a Linux server (headless).

Please add a possibility to login to homey without the need of a browser. My complete workflow is down the drain right now and i do most things remotely.

Correct,
I have seen the same question on Slack this morning and Athom reacted with an update to the CLI.

weejewel [8:41 AM]
athom-cli@2.1.52 now always shows the log-in URL for y’all headless people (edited)

So this should be fixed now.

Unfortunately I still can’t get CLI working. My credentials are not accepted… nor do I get a webpage with a token.

Tried on Mac via terminal and on a PC running Node.js as administrator.

Any help is appreciated!

I had the same problem but at some point I was informed there was an update which I accepted. The CLI then download the new version and updated itself and then I could connect without needing the token.
I can’t remember if I did anything in the CLI to get the prompt but might have typed in the command line to install the homey library again.

Thanks @Adrian_Rockall

I tried to update with npm install -g athom-cli, but get errors saying that permission is denied. I guess this is due to the fact that I have logged in into Homey. But I can’t because my credentios are not accepted.

I guess I’d better contact support.

Thanks!