dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.17k stars 158 forks source link

Token expired along with unauthorized error in logs #522

Closed fallingrock closed 3 years ago

fallingrock commented 3 years ago

Bug Report

Describe the Bug

No response to all cameras. Error about refresh token not being valid in logs.

Just upgraded to homebridge 1.2.4 using homebridge-config-ui-x v4.36.0.

To Reproduce

Steps to reproduce the behavior:

Expected behavior

Camera should be able to be viewed in Home app.

Screenshots/Logs

[12/7/2020, 12:06:08 PM] [Ring] HTTPError: Response code 401 (Unauthorized) at Request. (/usr/local/lib/node_modules/homebridge-ring/node_modules/got/dist/source/as-promise/index.js:117:42) at processTicksAndRejections (internal/process/task_queues.js:97:5) { code: undefined, timings: { start: 1607364367462, socket: 1607364367474, lookup: 1607364367588, connect: 1607364367602, secureConnect: 1607364367873, upload: 1607364367878, response: 1607364368049, end: 1607364368076, error: undefined, abort: undefined, phases: { wait: 12, dns: 114, tcp: 14, tls: 271, request: 5, firstByte: 171, download: 27, total: 614 } } } [12/7/2020, 12:06:08 PM] [Ring] Error connecting to API [12/7/2020, 12:06:08 PM] [Ring] Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens at RingRestClient.getGrantData (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:120:15) at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:124:36) at Generator.next () at /usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:27:71 at new Promise () at __awaiter (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:23:12) at RingRestClient.getAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:123:16) at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:148:33) at Generator.throw () at rejected (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:25:65)

Additional context

Add any other context about the problem here. ### Homebridge Ring Config Post homebridge-ring platform config _without sensitive information_ ``` { "bridge": { "name": "Homebridge BBAF", "username": "xxxx", "port": 51929, "pin": "999-99-9999" }, "accessories": [], "platforms": [ { "name": "Config", "port": 8581, "auth": "form", "theme": "auto", "tempUnits": "f", "lang": "auto", "platform": "config" }, { "refreshToken": "xxxxx", "hideDoorbellSwitch": true, "hideCameraMotionSensor": true, "hideCameraSirenSwitch": true, "hideInHomeDoorbellSwitch": true, "hideAlarmSirenSwitch": true, "hideUnsupportedServices": true, "platform": "Ring" }, { "name": "ADT Pulse", "username": "xxxx", "password": "xxxx", "logLevel": 30, "logActivity": true, "removeObsoleteZones": true, "platform": "ADTPulse" }, { "username": "xxxx", "password": "xxxx", "vehicles": [ { "name": "xxxx", "vin": "xxxx" } ], "platform": "FordPass" } ] } ``` ### Environment
dgreif commented 3 years ago

You need a new refresh token. In the settings in the ui, clear out the token field and it will walk you through generating a new one

fallingrock commented 3 years ago

Is this something that happens frequently? I did notice that some of the settings in the Ring app got reset to defaults.

dgreif commented 3 years ago

You will need a new token if you disable the session from the Control Center in the Ring app. Beyond that, they don't usually expire.