simao-silva / noip-renewer

Renewing No-IP hosts by browser automation
https://hub.docker.com/r/simaofsilva/noip-renewer
MIT License
76 stars 23 forks source link

Could not login. Check if account is blocked. #189

Closed Ivan-ggg closed 1 month ago

Ivan-ggg commented 2 months ago

Using user agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" Opening browser Could not login. Check if account is blocked.

I've been using it for renewals for several years now, thanks to this program! But in the last couple of days, I suddenly realized that I can't renew. I tried to log in to my account and found that I had to enter the verification code that was sent to my email address to log in to my account, and I couldn't close it. Can this program be improved please? I think there are two ways to successfully log in to the account, one is to turn on two-step verification and calculate the two-step verification code via the parameter Key to log in to the account, and the other is to set up mail forwarding to get the two-step verification code via a service like mailparser to log in to the account.

Kucharskov commented 2 months ago

As far as i understand ita issued by new noip browser verification by mail code. I noticed today on my mailbox that i got code exact time when script was executed.

Technically it should be resolved by switch like "--authenticate" ran once which will prompt for that 6digit key from mail and will use "remember this browser" option.

ray1025 commented 2 months ago

I've encountered the same issue. Regarding the above, I suggest using a two-step verification key for automatic login.

CheckeredFlag commented 2 months ago

I've encountered the same issue. Regarding the above, I suggest using a two-step verification key for automatic login.

Agreed. Adding support for TOTP may be the best solution.

ray1025 commented 2 months ago

Perhaps you could achieve the desired functionality using the pyotp library?

rpanchon commented 2 months ago

I’ve found the same issue. The no-ip web ask for the security code.

simao-silva commented 1 month ago

194 adds support for 2FA but it does not support the email code request. As far as I could tell, this happens from time to time thus difficult to reproduce. From what I understood, if you want to avoid the code to be sent via email, enable the 2FA from NOIP and set the NO_IP_TOTP_KEY variable or paste it when this script prompt for it.

rpanchon commented 1 month ago

After supports 2FA the tool is returning an error.

docker.io/simaofsilva/noip-renewer:latest
Using user agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 14.1; rv:109.0) Gecko/20100101 Firefox/121.0"
Opening browser
Traceback (most recent call last):
  File "/app/renew.py", line 146, in <module>
    totp_input.send_keys(totp.now())
                         ^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/pyotp/totp.py", line 64, in now
    return self.generate_otp(self.timecode(datetime.datetime.now()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/pyotp/otp.py", line 35, in generate_otp
    hasher = hmac.new(self.byte_secret(), self.int_to_bytestring(input), self.digest)
                      ^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/pyotp/otp.py", line 52, in byte_secret
    return base64.b32decode(secret, casefold=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/base64.py", line 254, in b32decode
    return _b32decode(_b32alphabet, s, casefold, map01)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/base64.py", line 236, in _b32decode
    raise binascii.Error('Non-base32 digit found') from None
binascii.Error: Non-base32 digit found
ray1025 commented 1 month ago

@rpanchon Please make sure to double-check your 2FA key. That error usually occurs when you've entered the wrong one. The 2FA secret key is displayed only once when you initially enable 2FA, right under the QR code. If you didn't save it, you can disable and then re-enable 2FA to generate a new one. totp

rpanchon commented 1 month ago

Tahnk you! you are right, i had the Two-Factor Authentication enabled.