ring: ring-auth-cli returns error

Bug Report

Describe the Bug

While requesting a token, the ring-auth-cli returns an error.

TypeError: Cannot use 'in' operator to search for 'error' in <html>
<head><title>406 Not Acceptable</title></head>
<body bgcolor="white">
<center><h1>406 Not Acceptable</h1></center>
<hr><center>nginx</center>
</body>
</html>
at RingRestClient.getAuth (/homebridge/node_modules/homebridge-ring/lib/api/rest-client.js:151:119)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

To Reproduce

Steps to reproduce the behavior:

  • Do an ring-auth-cli
  • enter mail + password

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 26 (4 by maintainers)

Most upvoted comments

this PR will fix it, but if you want it working now open the terminal in homebridge ui nano node_modules/homebridge-ring/node_modules/ring-client-api/lib/rest-client.js goto line 136 add : 'User-Agent': 'Ring/6.9.0 (Nokia; Nokia 6.1; Android 9)', under headers: { `save and exit and restart homebridge then generate new token in the plugin

My ring plugin for homebridge is now working (authentication works and so all devices show) however Scrypted ring plugin is not working still (authentication error unhandledRejection Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens). No code is received and code via authenticator also not working.

same too (same errors in homebridge) - neither homebridge nor scripted working with ring plugins at present.

Hi @dgreif, I meant to post here yesterday that I was able to reproduce the issue and the PR above which added User-Agent seemed to correct it, however, I’m guessing your fix with a different user agent string would also work. I’ll push out a build of ring-mqtt with the new ring-client-api and hopefully that will close the reports I have. Thanks!

I can confirm that 11.7.5 works. I removed the bridge. Installed the plug in as a new bridge and everything worked. Thanks! I’ll send over more beer money via PayPal. thanks!

spoke too soon. issue persists.

[05/04/2023, 17:16:57] [homebridge-ring] Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens