denniedegroot / com.ring

Ring for Homey
https://www.athom.com
Other
15 stars 15 forks source link

Plugin broken (New Ring 2FA policy feb-2020) #46

Closed Kingster2 closed 4 years ago

Kingster2 commented 4 years ago

Since today the plugin can't connect with Ring anymore. I keep getting mails from Ring that a unkown device is trying to login. This device (Homey) will be blocked unless a pincode is given. This is not possible in the plugin-settings at this point.

sossienl commented 4 years ago

Same here.

zeppie commented 4 years ago

+1

dennisbrouwer91 commented 4 years ago

Yep, i hope this can be fixed soon :(

mruiter commented 4 years ago

Dennie is aware. So we have to wait if he will update the app to support it and if he has time in the future. Also if another dev has time to look at it one can always send in a pull request for the app.

And dont forget to show love for Dennie and al his work in the app already :)

dennisbrouwer91 commented 4 years ago

That is great @mruiter. Thanks for the update. I will also check if i can fix it somehow!

mruiter commented 4 years ago

There is a blueprint on how to incorporate the 2FA

https://github.com/tchellomello/python-ring-doorbell

Has a input field for the 2FA in the mail.

dennisbrouwer91 commented 4 years ago

Where can i find that @mruiter ?

Thanks for the link!

AdyRock commented 4 years ago

+1. I don't know how many users you have with this app but do you think Athom should take it on and apply for official partner status?

I hope you can find the time to implement a fix for what was a great app until Ring broke it as I guess that could be quicker than waiting for Athom lol

mruiter commented 4 years ago

+1. I don't know how many users you have with this app but do you think Athom should take it on and apply for official partner status?

I hope you can find the time to implement a fix for what was a great app until Ring broke it as I guess that could be quicker than waiting for Athom lol

This has been brought to their attention multiple times . I know dennie did , i also did with a complete link to apply and with a headsup to my contact within Ring (I was beta tester for the first Ring pros in Europe for them before they hit shops a few years ago)

As we know you wont get any update on those things back from Athom . Nor do i think they give it any priority above the other things.

burnacid commented 4 years ago

I've looked into seeing if I could fix it. Sadly the documentation on 2FA/OTP from Ring it self is non existing. So for me it is guess work sadly...

If anyone has proper documentation please share.

dennisbrouwer91 commented 4 years ago

I've looked into seeing if I could fix it. Sadly the documentation on 2FA/OTP from Ring it self is non existing. So for me it is guess work sadly...

If anyone has proper documentation please share.

https://github.com/tchellomello/python-ring-doorbell

That code is a pretty good example on how to see it working. You need to send a couple of headers as far as I can tell!

burnacid commented 4 years ago

I've looked into seeing if I could fix it. Sadly the documentation on 2FA/OTP from Ring it self is non existing. So for me it is guess work sadly... If anyone has proper documentation please share.

https://github.com/tchellomello/python-ring-doorbell

That code is a pretty good example on how to see it working. You need to send a couple of headers as far as I can tell!

I looked at that but if I copy how that works it still does reply with a 412 error and an error message saying a code is send to my phone.

Now my account is locked for some time because of all the logins. Hard to test...

Genghes commented 4 years ago

Got the email from Ring today and they are clear:

Mandatory 2SV for your account will be enabled next week. This includes logins from unofficial or custom integration solutions.

If any of these solutions are in use on your Ring account, please update them for 2SV or two-factor authentication support now to avoid any disruption in service. All account logins using supported Ring applications and partner integrations will remain uninterrupted during mandatory 2SV implementation – provided you can access this email address during login and enter the OTP when prompted. ————————

So it seems they allow custom integration.

So chat if we all send email to help@ring.com asking for technical documentation for implementing 2SA ?

AdyRock commented 4 years ago

I have sent the following to Ring.

Hi,

I use a custom integration with my Athom Homey for my Ring Pro doorbell. This allows me to pop up a Picture in Picture of the the activity on my TV and in the notification on my phone. Plus the activity turns on my outside and hall lights after dark and triggers a dog barking sound if no one is home. 

Without this the Ring doorbell is no longer attractive to me so I would be looking for an alternative such as Doorbird that has an official and documented API.

The problem with forcing 2FA is it breaks the integration so could you provide details of how to implement this so the Homey app can be updated?

Looking forward to a positive response from the Ring team.

Best regards Adrian.

Probably fall on deaf ears but at least I feel I have vented lol

kaohlive commented 4 years ago

Problem with supporting 2FA is that you need to use the oAuth Athorization flow. Dennie (or Homey) needs to apply to to register a app with the Ring api. Once you receive the appid you need to ask a user for permission to use their account. This is the approve dialog you normally get. Than the system will respond a access and refresh token. The access token can be used to act like the user whom approved the request but expires rather quickly. The refresh token you store till the access token is expired. Used the refresh token method you can get a new access token and refresh token and so on. Not very hard to implement by itself, but you need to be granted a app registration before you can start. And some documentation on the exact end points for the authorization and token service. After that it is probably just replacing the login username password call with the access token call. From that point all other calls expect the access token from both methods so no rewrite needed there.

But I also can not find quick documentation on if and how you can register a 3rd party app. So if anyone can locate any form on how to apply for the app registration....

mruiter commented 4 years ago

This works in Python in getting the Needed key

https://github.com/tchellomello/python-ring-doorbell/blob/master/test.py

Verstuurd vanaf mijn iPhone

Op 22 feb. 2020 om 15:54 heeft kaohlive notifications@github.com het volgende geschreven:

 Problem with supporting 2FA is that you need to use the oAuth Athorization flow. Dennie (or Homey) needs to apply to to register a app with the Ring api. Once you receive the appid you need to ask a user for permission to use their account. This is the approve dialog you normally get. Than the system will respond a access and refresh token. The access token can be used to act like the user whom approved the request but expires rather quickly. The refresh token you store till the access token is expired. Used the refresh token method you can get a new access token and refresh token and so on. Not very hard to implement by itself, but you need to be granted a app registration before you can start. And some documentation on the exact end points for the authorization and token service. After that it is probably just replacing the login username password call with the access token call. From that point all other calls expect the access token from both methods so no rewrite needed there.

But I also can not find quick documentation on if and how you can register a 3rd party app. So if anyone can locate any form on how to apply for the app registration....

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

mruiter commented 4 years ago

You first need to call the fetch token method on auth with your credentials. This will throw a MissingTokenError you need to catch. In the catch you call fetch token again but use the callback to receive input of the 2FA code. Also important to save the access code to refresh tokens after expiration.

Verstuurd vanaf mijn iPhone

Op 22 feb. 2020 om 15:54 heeft kaohlive notifications@github.com het volgende geschreven:

 Problem with supporting 2FA is that you need to use the oAuth Athorization flow. Dennie (or Homey) needs to apply to to register a app with the Ring api. Once you receive the appid you need to ask a user for permission to use their account. This is the approve dialog you normally get. Than the system will respond a access and refresh token. The access token can be used to act like the user whom approved the request but expires rather quickly. The refresh token you store till the access token is expired. Used the refresh token method you can get a new access token and refresh token and so on. Not very hard to implement by itself, but you need to be granted a app registration before you can start. And some documentation on the exact end points for the authorization and token service. After that it is probably just replacing the login username password call with the access token call. From that point all other calls expect the access token from both methods so no rewrite needed there.

But I also can not find quick documentation on if and how you can register a 3rd party app. So if anyone can locate any form on how to apply for the app registration....

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

mruiter commented 4 years ago

Seems all platforms are building on this guy his repro. Its has 2FA in node.js

https://github.com/dgreif/ring/wiki/Two-Factor-Auth

kaohlive commented 4 years ago

thanks @mruiter I checked their code and managed to get a version implemented into the plugin. I will do a pull request now (if I figure out how). For me its now working with proper wizard and authorization support. Also means the app no longer stores your account.

Pull request is in now

burnacid commented 4 years ago

@kaohlive super, I've downloaded the code from your repo and installed it manually. I can confirm it works. Headsup you will need to readd your devices

mruiter commented 4 years ago

For me it wasn’t needed to repair the devices . Works straight away overwriting the AppStore version with cli version

Verstuurd vanaf mijn iPhone

Op 1 mrt. 2020 om 07:43 heeft Stefan Lenders notifications@github.com het volgende geschreven:

 @kaohlive super, I've downloaded the code from your repo and installed it manually. I can confirm it works. Headsup you will need to readd your devices

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

burnacid commented 4 years ago

For me it wasn’t needed to repair the devices . Works straight away overwriting the AppStore version with cli version Verstuurd vanaf mijn iPhone Op 1 mrt. 2020 om 07:43 heeft Stefan Lenders @.***> het volgende geschreven:  @kaohlive super, I've downloaded the code from your repo and installed it manually. I can confirm it works. Headsup you will need to readd your devices — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

A well I ain't getting any motion triggers from the flow though

Genghes commented 4 years ago

Hi. I downloaded the fork from @kaohlive and can comfirm the 2FA works great. But I cant get any motion alarm or button (ring) to work. I get batterystatus but device status does not change.

I deactivated the original app on my Homey and installed the fork on my lab Homey.

AdyRock commented 4 years ago

Have you tried creating a flow that enables the motion and running it? I found in the past that Ring sometimes disabled the notification so I worked out how to turn it on and Dennie made it into a flow action.

joninge commented 4 years ago

Will the ring doorbell app be available (again) in Homey after this fix is released?

This is now longer available: https://homey.app/en-us/store/product/ring-video-doorbell-2/

denniedegroot commented 4 years ago

It's currently being reviewed by Athom.

AdyRock commented 4 years ago

Great, well done and thanks for keeping it going.

Raycokes2000 commented 4 years ago

i hoped v2.2.2 2fa would work properly, but it still does not, there is no input field for the code sent unfortunately

kaohlive commented 4 years ago

revoke athentication in app settings go to add device select the ring app and get the athentication form, enter yoy credentials press authenticate, get the codr box, enter mfa code. yoy fo not get thr code box in that step?

Raycokes2000 commented 4 years ago

continu in https://github.com/denniedegroot/com.ring/issues/51