Brandawg93 / homebridge-nest-cam_old

Use your Nest Cam as IP camera in HomeKit.
Apache License 2.0
92 stars 14 forks source link

406 Not Acceptable when requesting access token #78

Open askovi opened 4 years ago

askovi commented 4 years ago

The request from readme seems to not work anymore. It returns 406 Not Acceptable. However you can change the user-agent to iOS 13 instead of 11 and it will work again:

curl -X "POST" "https://home.nest.com/session" \
     -H 'User-Agent: iPhone iPhone OS 13.0 Dropcam/5.14.0 com.nestlabs.jasper.release Darwin' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "email=YOUR_NEST_EMAIL" \
     --data-urlencode "password=YOUR_PASSWORD"

Please update the readme file.

funkyremi commented 4 years ago

Replace user agent by something else like Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0. 2272.118 Safari/537.36.

bookismllc commented 4 years ago

Thanks, that worked for me.

thecoleorton commented 4 years ago

curl wasn't working for me via the README or by using another user agent.

I was able to just go to https://home.nest.com/session in a browser and get my access token. This assumes that you're currently logged into https://home.nest.com/.

Do note:

I have 2FA enabled.

I did have Nest-Cam working prior to my access_token expiring when I noticed that my Nest Cam's weren't refreshing in HomeKit today.

jeffvautin commented 4 years ago

The suggestion to visit https://home.nest.com/session worked for me (I do not have 2FA enabled).

jqnatividad commented 4 years ago

@jeffvautin I was also able to get the access_token thru https:/home.nest.com/session. However, it still doesn't work for me and I get this error:

[NestCam]Failed to request access token. Unexpected API Error - 403

Is it working in your setup?

Finch106 commented 4 years ago

^ Same here. I went to the /session page and got the token, which is massive. I DO have 2FA enabled.

opswhisperer commented 4 years ago

curl wasn't working for me via the README or by using another user agent.

I was able to just go to https://home.nest.com/session in a browser and get my access token. This assumes that you're currently logged into https://home.nest.com/.

Do note:

I have 2FA enabled.

I did have Nest-Cam working prior to my access_token expiring when I noticed that my Nest Cam's weren't refreshing in HomeKit today.

This needs to be in the README