Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to authenticate on Nest Accounts #195

Closed
DJBenson opened this issue Jan 2, 2020 · 76 comments
Closed

Unable to authenticate on Nest Accounts #195

DJBenson opened this issue Jan 2, 2020 · 76 comments

Comments

@DJBenson
Copy link

@DJBenson DJBenson commented Jan 2, 2020

My password on home.nest.com has an exclamation mark and this does not seem to work with the plugin. I have tried escaping the exclamation mark in the config file but I either get a JSON validation error (which prevents Homebridge from starting) or it starts but the password is still rejected.

Plugin Version: 3.5.1
Homebridge Version: 0.4.50
Node Version: v13.5.0

[02/01/2020, 20:37:34] [Nest] Auth failed: Nest rejected the account email/password specified in your Homebridge configuration file. Please check
[02/01/2020, 20:37:34] [Nest] Unable to connect to Nest service.

Config.json snippet:

{ "platform": "Nest", "email": "user@gmail.com", "password": "PasswordWith!Mark", "options": [ "HomeAway.AsOccupancySensor", "Protect.MotionSensor.Disable" ] },

@DJBenson DJBenson changed the title Passwords with exclamation marks cannot authenticate Unable to authenticate Jan 2, 2020
@DJBenson

This comment has been minimized.

Copy link
Author

@DJBenson DJBenson commented Jan 2, 2020

Changed my password (to something without special characters) on home.nest.com and still unable to authenticate. 2FS is not enabled on my account.

@DJBenson

This comment has been minimized.

Copy link
Author

@DJBenson DJBenson commented Jan 2, 2020

The generateNestToken.sh script also returns a null access code so something is amiss with the authentication for me.

@gadgetfreak88

This comment has been minimized.

Copy link

@gadgetfreak88 gadgetfreak88 commented Jan 2, 2020

I'm getting the same error since restarting homebridge today, config / password have not changed.

@HammerAce42

This comment has been minimized.

Copy link

@HammerAce42 HammerAce42 commented Jan 2, 2020

I too am seeing the same issue.

@rtaylor-coxauto

This comment has been minimized.

Copy link

@rtaylor-coxauto rtaylor-coxauto commented Jan 2, 2020

My Nest authentication also stopped working today. I switched to use an access token for now. I suspect something has changed on the Google/Nest end of things.

@joubin

This comment has been minimized.

Copy link

@joubin joubin commented Jan 2, 2020

Same

@joubin

This comment has been minimized.

Copy link

@joubin joubin commented Jan 2, 2020

I did a fresh install of home bridge before I found this post and the issue still persists.

@DJBenson

This comment has been minimized.

Copy link
Author

@DJBenson DJBenson commented Jan 2, 2020

access_token works for me as a workaround but it seems it expires monthly?

@claproth

This comment has been minimized.

Copy link

@claproth claproth commented Jan 2, 2020

Same issue. Disabled Nest for now

@BenjiBoisemont

This comment has been minimized.

Copy link

@BenjiBoisemont BenjiBoisemont commented Jan 2, 2020

Same issue for me. Nest refuses my credentials.
Plugin Version: 3.5.1
Homebridge Version: 0.4.50
Node Version: v13.5.0

@BenjiBoisemont

This comment has been minimized.

Copy link

@BenjiBoisemont BenjiBoisemont commented Jan 2, 2020

access_token works for me as a workaround but it seems it expires monthly?

How did you get your access_token?
Could yo give any sample for the config.json with access_token?

@galaxydpw

This comment has been minimized.

Copy link

@galaxydpw galaxydpw commented Jan 2, 2020

access_token works for me as a workaround but it seems it expires monthly?

How do you get the token
I have no longer access to my nest developer account...

Thanks

@DJBenson

This comment has been minimized.

Copy link
Author

@DJBenson DJBenson commented Jan 2, 2020

access_token works for me as a workaround but it seems it expires monthly?

How did you get your access_token?
Could yo give any sample for the config.json with access_token?

Log in to https://home.nest.com with your credentials then browse to https://home.nest.com/session in the same tab, you will see a JSON object of your session. Look for the string enclosed in the quotes after "access_token" and copy that to the clipboard (copy the full string between the two quotes).

It looks something like this:

{"2fa_state":"none","access_token":"REDACTED"...

In your Homebridge config.json, remove the email and password fields and create a new parameter called "access_token" like such:

    {
        "platform": "Nest",
        "access_token": "***REDACTED***,
        "options": [
            "HomeAway.AsOccupancySensor",
            "Protect.MotionSensor.Disable"
        ]
    },
@DJBenson

This comment has been minimized.

Copy link
Author

@DJBenson DJBenson commented Jan 2, 2020

access_token works for me as a workaround but it seems it expires monthly?

How do you get the token
I have no longer access to my nest developer account...

Thanks

See above - no need for a developer account.

@galaxydpw

This comment has been minimized.

Copy link

@galaxydpw galaxydpw commented Jan 2, 2020

access_token works for me as a workaround but it seems it expires monthly?

How do you get the token
I have no longer access to my nest developer account...
Thanks

See above - no need for a developer account.

Excellent!
Working again, and renewing the token every 30 days.
It will give me some time to look for a replacement of this Thermostat... Lol

@adriancable

This comment has been minimized.

Copy link
Collaborator

@adriancable adriancable commented Jan 2, 2020

So sorry about all of this. Since this morning, Nest is now using a Google Recaptcha service for Nest accounts. If the Google-generated Recaptcha token is missing from the log-in API call (as it is in homebridge-nest), the log-in will fail. This is what is happening.

Right now, if you have a Nest Account, the best workaround is to use the access token method as described by @DJBenson above.

Please note, this problem does not happen with Google Accounts. If you migrate your Nest Account to a Google Account, that will then work fine.

@adriancable adriancable pinned this issue Jan 2, 2020
@adriancable adriancable changed the title Unable to authenticate Unable to authenticate on Nest Accounts Jan 2, 2020
@BenjiBoisemont

This comment has been minimized.

Copy link

@BenjiBoisemont BenjiBoisemont commented Jan 3, 2020

@stone-401

This comment has been minimized.

Copy link

@stone-401 stone-401 commented Jan 3, 2020

I had the same issue, so I migrated to a Google Account. Now, when I close the terminal, all my Homebridge accessories disappear from Homekit. Is it logging me out of Google when I do this? Anyone else having this issue? How do I stay logged in according to the Homebridge-nest instructions.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 3, 2020

@stone-401 What do you mean by Terminal?

@stone-401

This comment has been minimized.

Copy link

@stone-401 stone-401 commented Jan 3, 2020

Sorry - Terminal in Mac. I'm using it to login to a raspberry pi via SSH.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 3, 2020

@stone-401 Do the accessories come back out as new accessories, or do they all just disappear and never come back?

@stone-401

This comment has been minimized.

Copy link

@stone-401 stone-401 commented Jan 3, 2020

they come back if I log back into terminal, stop Homebridge, and start it again. But then when I close terminal, the devices disappear again. It's like it's logging me out of Nest or shutting down the Homebridge app altogether.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 3, 2020

@stone-401 I don't think the problem you have is related to this. Homebridge isn't supposed to stop when you log out of SSH. It doesn't make sense.

@stone-401

This comment has been minimized.

Copy link

@stone-401 stone-401 commented Jan 3, 2020

yeah, you are right. I've discovered that it is unrelated to the login issue. It is not related to this issue like I originally thought. Thanks for the replies anyway though! I'll search for a solution elsewhere.

@stjagu

This comment has been minimized.

Copy link

@stjagu stjagu commented Jan 3, 2020

I have tried changing my config to access token per the @DJBenson post and Homebridge is now running but Nest not showing up in Home App at all.

@claproth

This comment has been minimized.

Copy link

@claproth claproth commented Jan 3, 2020

Working now with google authentication!

@danbridgland

This comment has been minimized.

Copy link

@danbridgland danbridgland commented Jan 3, 2020

Since this morning, Nest is now using a Google Recaptcha service for Nest accounts. If the Google-generated Recaptcha token is missing from the log-in API call (as it is in homebridge-nest), the log-in will fail. This is what is happening.

Thanks @adriancable for following up so quickly. I appreciate this change is not of your doing, but can you give any indication of the likelihood that a solution will be found for Nest accounts?

I refuse to migrate to or sign up for a google account, and whilst the monthly token reset is a suitable temporary work around, I really don’t want to have to do this every month. I appreciate this is a change that has been applied by Google and without prior warning, and I also realise I seem belligerent in my stance, however I bought into Nest before google acquired it, as I did for Ring and Eero before Amazon acquired them, I’m tired of this trade in a digital user base. Whilst Nest accounts are still accepted, I’d like to keep it in force.

I hope you understand my perspective.

Thanks
Dan

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 11, 2020

@jeffmarcilliat I can create one on the fly. But try not to copy and paste it cause every configuration is different. A single punctuation or curly bracket will cause the whole thing to not work.

{
    "platform": "Nest",
    "name": "Nest",
    "googleAuth": {
        "issueToken": "",
        "cookies": "",
        "apiKey": ""
    },
    "structureId": "",
    "options": []
}
@starlessblack

This comment has been minimized.

Copy link

@starlessblack starlessblack commented Jan 12, 2020

Ugh, I thought I'd save time for now and just go the API token route, but now that it's back up and running, it's redetected all my Nest devices from scratch, throwing them in the default room and removing them from my scenes and automations :-(

@jeffmarcilliat

This comment has been minimized.

Copy link

@jeffmarcilliat jeffmarcilliat commented Jan 12, 2020

I’m reading through https://developers.google.com/identity/protocols/OAuth2. Which scenario does Homebridge fall into? @mrjackyliang

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 12, 2020

@jeffmarcilliat You're supposed to read this readme, not the developers manual.

@jeffmarcilliat

This comment has been minimized.

Copy link

@jeffmarcilliat jeffmarcilliat commented Jan 12, 2020

Ok yep this is done and works! Thanks @mrjackyliang. I'm assuming I can quit Chrome and that will not log me out? Or do I need to be running Chrome on my Raspberry Pi and repeat these steps?

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 12, 2020

@jeffmarcilliat Yes, you can quit Chrome now.

@efipso

This comment has been minimized.

Copy link

@efipso efipso commented Jan 13, 2020

Hi guys,

I have a question before migrating my account to Google:
If I restart my homebridge, I have to reconfigure it? I mean do again all about getting the apikey, cookies and all this stuff

I restart it once a week and I don't want to do all this every time I restart it. If that's the case, for me it's better to stay on a nest account and renew the token every month...

Thanks to all!

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 13, 2020

@efipso No you won't need to. As long as you don't remove the login session from the Google My Account area you are good.

The whole point of using Incognito is to isolate all the cookies in one session and to destroy them locally so you don't accidentally mix the your login sessions up with the cookies intended for homebridge-nest

@rpersche

This comment has been minimized.

Copy link

@rpersche rpersche commented Jan 19, 2020

Hello, thanks for the information. I am still reluctant to migrate my Nest account to Google since IFTTT warns users not to do so in Aug 2019 (https://help.ifttt.com/hc/en-us/articles/360022524734-Important-update-about-the-Nest-services). However, I came across this blog entry from Google https://blog.google/products/google-nest/works-with-nest where they talk about. "We’ll also invite smart home developer enthusiasts to participate in our Device Access for Individuals sandbox, allowing you to directly control your own Nest devices for your private integrations and automations."
I will stick to the monthly access_token for now. Thanks!

@mriksman

This comment has been minimized.

Copy link
Contributor

@mriksman mriksman commented Jan 20, 2020

I've successfully migrated to googleAuth. But the Nest items are not appearing in Home...?

[1/20/2020, 1:50:44 PM] [Nest] initing thermostat "Guest": deviceId: 02AA01AC0615098N structureId: 0de15b80-015c-11e5-9cdc-22000b1e805f
[1/20/2020, 1:50:44 PM] [Nest] Initializing platform accessory 'Guest'...

Edit: Bizarre. It appears on my partner's phone, but not on mine....

@ekobres

This comment has been minimized.

Copy link

@ekobres ekobres commented Jan 23, 2020

So sorry about all of this. Since this morning, Nest is now using a Google Recaptcha service for Nest accounts. If the Google-generated Recaptcha token is missing from the log-in API call (as it is in homebridge-nest), the log-in will fail. This is what is happening.

Right now, if you have a Nest Account, the best workaround is to use the access token method as described by @DJBenson above.

Please note, this problem does not happen with Google Accounts. If you migrate your Nest Account to a Google Account, that will then work fine.

It looks like we're stuck with this and it looks like it probably affects most if not all homebridge-nest users. You might want to update readme.md with the most up-to-date info. It still recommends a Nest account with username/password. I had to go through a lot of troubleshooting before I found this issue in Github - after carefully looking for the answer in readme.

Cheers!

@gdotp01

This comment has been minimized.

Copy link

@gdotp01 gdotp01 commented Jan 25, 2020

Well I was struck yesterday by this anti-competitive action by google. Ive temporality re-authenticated by moving my next to google but I will be looking for an non-google solution now and making sure that i don't use any google products any longer .

@h00pak

This comment has been minimized.

Copy link

@h00pak h00pak commented Jan 25, 2020

So sorry about all of this. Since this morning, Nest is now using a Google Recaptcha service for Nest accounts. If the Google-generated Recaptcha token is missing from the log-in API call (as it is in homebridge-nest), the log-in will fail. This is what is happening.

Right now, if you have a Nest Account, the best workaround is to use the access token method as described by @DJBenson above.

Please note, this problem does not happen with Google Accounts. If you migrate your Nest Account to a Google Account, that will then work fine.

Are you saying that I can migrate the account and then the email address solution will work again? Thanks.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 25, 2020

@h00pak You must follow the Google Account directions in the README located on this repository.

@Nate872711

This comment has been minimized.

Copy link

@Nate872711 Nate872711 commented Jan 30, 2020

The googleAuth method doesn’t work for me. The config.json is correct also but it still won’t authenticate. I get a bunch of errors in red when running homebridge from terminal.

Unhandled rejection StatusCodeError: 401 - {"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}
at new StatusCodeError (/usr/local/lib/node_modules/homebridge-nest/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/usr/local/lib/node_modules/homebridge-nest/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/homebridge-nest/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-nest/node_modules/request/request.js:185:22)
at Request.emit (events.js:197:13)
at Request. (/usr/local/lib/node_modules/homebridge-nest/node_modules/request/request.js:1161:10)
at Request.emit (events.js:197:13)
at IncomingMessage. (/usr/local/lib/node_modules/homebridge-nest/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:285:13)
at IncomingMessage.emit (events.js:202:15)
at endReadableNT (_stream_readable.js:1129:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)

I can use the access_token method instead just fine though.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 30, 2020

@Nate872711 If you can use the access token just fine, then you didn't migrate your Nest account to a Google account yet.

Nest accounts migrated to Google cannot use access_token.

@Nate872711

This comment has been minimized.

Copy link

@Nate872711 Nate872711 commented Jan 30, 2020

@mrjackyliang I migrated to Google a while back, so that doesn't make any sense. It has 2fa and everything.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 30, 2020

@Nate872711 It could possibly be that the values pasted are wrong. I also have 2FA on my Google account, and it works perfectly.

Or it could just be that the JSON format is incorrect:

{
    "platform": "Nest",
    "name": "Nest",
    "googleAuth": {
        "issueToken": "",
        "cookies": "",
        "apiKey": ""
    },
    "structureId": "",
    "options": []
}
@Nate872711

This comment has been minimized.

Copy link

@Nate872711 Nate872711 commented Jan 30, 2020

@mrjackyliang What is the structureId for? I didn't have that in my format.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 30, 2020

@Nate872711 structureId is for defining the home that is hosting the specific thermostats. Some have two homes, so the ID would basically separate them.

It's optional, but I included it in my config just for re-enforcement.

@kcprice11

This comment has been minimized.

Copy link

@kcprice11 kcprice11 commented Jan 30, 2020

I'm debating migrating my nest protects to a google account. My question is, if I migrate and get it all working and use the incognito session as specified above, will I have to redo this setup if I reboot my pi? If so, I think I will skip it. I already bought an ecobee for several reasons, not the least of which is Googles position on stuff like this. But I still own some Nest protect devices and would like to see them in HomeKit. If after getting it setup (Which seems like a pain) I have to redo the setup every time I boot my pi, I think I will skip it.

thanks

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 30, 2020

@kcprice11 No you won't need to redo your setup unless you:

  1. Logged out while in Incognito mode.
  2. Removed the logged in device in Google.
  3. Reset your Homebridge.

I've said this throughout the thread already.

@kcprice11

This comment has been minimized.

Copy link

@kcprice11 kcprice11 commented Jan 30, 2020

@kcprice11 No you won't need to redo your setup unless you:

  1. Logged out while in Incognito mode.
  2. Removed the logged in device in Google.
  3. Reset your Homebridge.

I've said this throughout the thread already.

Thank you

@Nate872711

This comment has been minimized.

Copy link

@Nate872711 Nate872711 commented Jan 30, 2020

@mrjackjyliang I got it working with googleAuth finally. I had to sign out of all devices and resign in with the Google account. Thanks for the help.

@mrjackyliang

This comment has been minimized.

Copy link

@mrjackyliang mrjackyliang commented Jan 31, 2020

@Nate872711 That's definitely worth mentioning to future readers. Thanks!

@adriancable

This comment has been minimized.

Copy link
Collaborator

@adriancable adriancable commented Feb 18, 2020

Closing now 4.4.0 is released.

@adriancable adriancable unpinned this issue Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.