puschie286 / fritzbox-bridge

4 stars 2 forks source link

Cannot login #3

Closed mvl64 closed 5 years ago

mvl64 commented 5 years ago

I have a problem logging in to the fritzbox, the app keeps reporting "invalid login". I have ensured I'm using the correct login details (account and password) and even setup a separate account on the Fritzbox for Homey with a more simple password. I can login to the fritzbox using both accounts using the web browser.

Note: my homey and fritzbox are in separate network segments, maybe that effects this issue. I did confirm in the firewall traffic is passed on (port 80 from homey to the fritzbox) - I log all the traffic - fritzbox ip-address is specified correctly in the settings (so, I don't use the default http://fritz.box URL).

Enabling SSL in the app's dialog did not seem to make a difference - same error message is reported back.

puschie286 commented 5 years ago

hmm sounds like a connection establish problem -> currently im working on another reported login problem that requires to rewrite the login-process so i will also test for you problem

hope to find some time next week for this ( probably Tuesday or Wednesday )

nattlip commented 5 years ago

I have a problem logging in to the fritzbox, the app keeps reporting "invalid login". I have ensured I'm using the correct login details (account and password) and even setup a separate account on the Fritzbox for Homey with a more simple password. I can login to the fritzbox using both accounts using the web browser.

Note: my homey and fritzbox are in separate network segments, maybe that effects this issue. I did confirm in the firewall traffic is passed on (port 80 from homey to the fritzbox) - I log all the traffic - fritzbox ip-address is specified correctly in the settings (so, I don't use the default http://fritz.box URL).

Enabling SSL in the app's dialog did not seem to make a difference - same error message is reported back.

neither can i

mvl64 commented 5 years ago

hmm sounds like a connection establish problem -> currently im working on another reported login problem that requires to rewrite the login-process so i will also test for you problem

hope to find some time next week for this ( probably Tuesday or Wednesday )

Thanks ! If you need additional info, please let me know.

puschie286 commented 5 years ago

sorry for late response

pushed a update today for better error handling b755d73eca8ed39e7b4e47c5925c0d7a10ae7bb7 but i guess its a different problem.

so you use the same url in settings like for accessing fritzbox via web ? (i guess you already tested to use http/https infront of your ip)

pls try [Fritzbox IP]/login_sid.lua -> it should show you a xml response

if you still have problems pls provide some informations about your setup ( fritzbox version, fritzbox local ip, homey local ip, fritzbox type ( model ) )

mvl64 commented 5 years ago

No problem on the delay, we're all busy people and have iimited time available ... I'm glad do you take the time to review and respond.

I'll do some more testing tonight, but want to already confirm I'm using the same url as when accessing using the browser. I tried without and with http:// in the url - not sure whether I tried with https:// - will reconfirm tonight. I did notice regardless of whether I tick the 'strict ssl' box the app always connects to port 80 (I was expecting 443 for ssl).

One question:you mention to try the .lua link - should I enter this in the app settings, or using a browser accessing the firtzbox ? And where should Isee the xml ? I'm new to Homey apps and have not yet found a way to see app logs ...

Talk later

On Thu, May 2, 2019, 12:01 puschie286 notifications@github.com wrote:

sorry for late response

pushed a update today for better error handling b755d73 https://github.com/puschie286/fritzbox-bridge/commit/b755d73eca8ed39e7b4e47c5925c0d7a10ae7bb7 but i guess its a different problem.

so you use the same url in settings like for accessing fritzbox via web ? (i guess you already tested to use http/https infront of your ip)

pls try [Fritzbox IP]/login_sid.lua -> it should show you a xml response

if you still have problems pls provide some informations about your setup ( fritzbox version, fritzbox local ip, homey local ip, fritzbox type ( model ) )

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/puschie286/fritzbox-bridge/issues/3#issuecomment-488617827, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEHF5W7G22HOFQJDVG255DPTK3Y5ANCNFSM4HGTGUDQ .

puschie286 commented 5 years ago

hmm, i can check the port for https -> should be handled by the npm package 'request' but i will check

the [...]login_sid.lua address is for the browser -> your browser should show a xml file note: there is an issue with something similar that was caused by wrong DNS setup -> Link

mvl64 commented 5 years ago

When I access the mentioned URL in the browser - before login, I get the following response:

0000000000000000485e81f60

After logging in, it changes to:

0000000000000000080edd990

Honestly speaking, I'm not clear how this helps but wanted to share anyway ...

I'll have a look at changing HTTPS in the URL to see how that effects the result.

On Thu, May 2, 2019 at 2:03 PM puschie286 notifications@github.com wrote:

hmm, i can check the port for https -> should be handled by the npm package 'request' but i will check

the [...]login_sid.lua address is for the browser -> your browser should show a xml file note: there is an issue with something similar that was caused by wrong DNS setup -> Link https://github.com/andig/fritzapi/issues/11

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/puschie286/fritzbox-bridge/issues/3#issuecomment-488646367, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEHF5TG6RVLNP6GBKOCFYDPTLJ7JANCNFSM4HGTGUDQ .

mvl64 commented 5 years ago

When I use HTTPS in the URL, the destination port changes to 443 as expected. Even when I de-select the "strict SSL" tickbox in the settings, traffic is pointing to port 443.

I'm not sure how the tickbox effect the traffic - but at least by changing the URL the port can be controlled.

Unfortunately, neither case results in a proper login :(

Regarding your note on DNS: I'm using IP address in the app settings, so I don't think DNS would make an impact.

I'll read-up on the link nonetheless and let you know.

On Thu, May 2, 2019 at 8:18 PM Marco van Laerhoven mvl1729@gmail.com wrote:

When I access the mentioned URL in the browser - before login, I get the following response:

0000000000000000485e81f60

After logging in, it changes to:

0000000000000000080edd990

Honestly speaking, I'm not clear how this helps but wanted to share anyway ...

I'll have a look at changing HTTPS in the URL to see how that effects the result.

On Thu, May 2, 2019 at 2:03 PM puschie286 notifications@github.com wrote:

hmm, i can check the port for https -> should be handled by the npm package 'request' but i will check

the [...]login_sid.lua address is for the browser -> your browser should show a xml file note: there is an issue with something similar that was caused by wrong DNS setup -> Link https://github.com/andig/fritzapi/issues/11

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/puschie286/fritzbox-bridge/issues/3#issuecomment-488646367, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEHF5TG6RVLNP6GBKOCFYDPTLJ7JANCNFSM4HGTGUDQ .

puschie286 commented 5 years ago

Looks good... It’s pretty sound like a network problem - I guess the fritzbox ip is different in your homey subnet

mvl64 commented 5 years ago

I've confirmed traffic from Homey is reaching the Fritzbox, by looking at the firewall logs. Also on the FritzBox, I see the connection attempt in the event Log - it is reported there as an incorrect password. See screenshot below. Note the Homey address is 192.168.30.27.

[image: image.png]

I obviously confirmed the password is correct - it is just one character, can't go wrong there.

If you still think this is pointing to a network issue, can you please clarify ?

On Thu, May 2, 2019 at 8:35 PM puschie286 notifications@github.com wrote:

Looks good... It’s pretty sound like a network problem - I guess the fritzbox ip is different in your homey subnet

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/puschie286/fritzbox-bridge/issues/3#issuecomment-488783100, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEHF5RJNAUXCOW6O4OQ7NTPTMX6JANCNFSM4HGTGUDQ .

puschie286 commented 5 years ago

Sry can’t see the img ( only Text no link )

mvl64 commented 5 years ago

Ow, sorry - Ill attach it as a file, rather than in place ... [image: Capture.JPG]

On Thu, May 2, 2019 at 8:59 PM puschie286 notifications@github.com wrote:

Sry can’t see the img ( only Text no link )

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/puschie286/fritzbox-bridge/issues/3#issuecomment-488791521, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEHF5WBSPLDTFIKP3CCJZTPTM22VANCNFSM4HGTGUDQ .

puschie286 commented 5 years ago

Unfortunately not

mvl64 commented 5 years ago

Hmm, sorry about that

On Thu, May 2, 2019 at 9:03 PM puschie286 notifications@github.com wrote:

Unfortunately not

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/puschie286/fritzbox-bridge/issues/3#issuecomment-488792834, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEHF5X4SERNLEKYR7V3LS3PTM3JBANCNFSM4HGTGUDQ .

puschie286 commented 5 years ago

can you upload the image somewhere ( or use the browser ) ?

currently i have no idea why the fritzbox reject the password/challenge -> do you have other devices/services that access the fritzbox. trying to login with wrong credentials will cause all active sessions to be destroyed ( found that in the documentation^^ )

and maybe it will help to have the error message, could you post your homey/SimpleLOG log entries when trying to login ?

mvl64 commented 5 years ago

Hi Puschie,

Sorry, I was out of the country for a couple of days and too busy to follow up on this. Tried again today, after I noticed an app update was installed earlier this week.

Problem still occurs; please refer to file attached. I have now logged in to the fritzbox with the same account (Homey) on the web browser, since you mentioned I would be logged out automatically. That does not occur to me, the browser session is still active whereas you can see the failed attempt from the Homey device (on 192.168.30.27). I hope you are able to see this attached file, I've uploaded it instead of dragging it into the browser.

If not, can you give me an alternative mail address or do you have a way for me to upload it on github ?

I noticed you mentioned in the change log of this version you've added some logging. Is there a way for me to access the logs, and send you some screenshots?

On Thu, May 2, 2019 at 11:52 PM puschie286 notifications@github.com wrote:

can you upload the image somewhere ( or use the browser ) ?

currently i have no idea why the fritzbox reject the password/challenge -> do you have other devices/services that access the fritzbox. trying to login with wrong credentials will cause all active sessions to be destroyed ( found that in the documentation^^ )

and maybe it will help to have the error message, could you post your homey/SimpleLOG log entries when trying to login ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/puschie286/fritzbox-bridge/issues/3#issuecomment-488845784, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEHF5U3SXRKUYOJXTBIBRTPTNPB7ANCNFSM4HGTGUDQ .

puschie286 commented 5 years ago

Hey, np. Pls use your browser for github replay to be correct shown

mvl64 commented 5 years ago

I was replying by email, it seems this removes the attachement (sorry, I never checked this thread on github after creating the initial ticket). Let me try again now. As you can see, I did log into the fritzbox using the same user id (Homey) - to confirm it works ok. It worked fine, and the failed attempt from the app did not log this session out.

Capture

puschie286 commented 5 years ago

hmm double checked the password hashing function but everything looks good there ( tested for special keys like € @ ä ö ). can you share your fritzbox bridge log ? ( install SimpleLOG from app store and restart FritzboxBridge to get all full log with startup and everything ) still think its a subnet problem -> can you try http://192.168.30.1 as fritzbox ip ? ( or the fritzbox ip from your homey subnet )

mvl64 commented 5 years ago

My password currently does not use special characters, so that's not it. Thanks for the tip on SimpleLog - I use PaperTrails myself (to create log entries from flows) and thought SimpleLog did the same.

The error reported is reloaded to "zero depth sigl signed cert" it seems. See attached file. Hope this helps ! Simple LOG.log

puschie286 commented 5 years ago

nice thx :) can you try with http instead of https and send the log ? ( thanks for note PaperTrails, will add it to supported log apps )

mvl64 commented 5 years ago

When I try without https, there is no log entry anymore file is unchanged ...

I've even restarted the the app to confirm, as you can see in the log: Simple LOG2.log

puschie286 commented 5 years ago

that's bad, sounds like a timeout will happen soon ( 20s - 120s ).

im almost out of idea's how to face this problem :(

your homey ip is 192.168.30.27 and it tries to connect to 192.168.5.76 -> are you sure it is reachable ? i guess because of the different subnet your fritzbox ip is also different for this subnet. ( maybe 192.168.30.76 ? )

mvl64 commented 5 years ago

Correct, Homey is in the IoT network segment which has no access to internal networks except for some specific devices. I've included a firewall rule to allow Homey to Fritzbox and vice versa - network traffic logging shows there is a flow both ways.

-> are you sure it is reachable ?

Yes, I know it is reachable: I can see the login attempt on the FritzBox - and in return it reports "invalid password".

Both ip addresses are correct, I also see the firewall is logging traffic going from Homey to the Fritzbox.

NOTE: I only use the fritzbox for smart devices now - replaced my router and access points a while ago. So I could try to move it into the IoT segment too - to see if that changes anything.

NOTE: I cannot change the fritz ip to 192.168.,30.1 - as that is the address of the router.

puschie286 commented 5 years ago

yes pls try it^^

well, the point is: fritzbox-bridge use fritzboxapi -> fritzboxapi is an implementation of the official fritzbox api. ( also checked the implementation and validate with example data from documention)

so im not sure how the password can be wrong if you use the correct one and the implementation is correct :/

the last thing i can try is to setup a network with similar configuration and try to reproduce it ( will ask our network specialists for help^^ @work )

mvl64 commented 5 years ago

Hmm, looking at the code it seems the password is hashed and the hash is sent to validate the password on the box. I'm using a one character password to rule out me making typos, could that be causing issues (is there a minimum length for the MD5 hash?)

puschie286 commented 5 years ago

Guess not - there is no min length.

One more idea - can you try to use a laptop and configure it for the smart home subnet and try to login to the fritzbox from there ?

On May 20, 2019 at 4:40 PM, <mvl64 (mailto:notifications@github.com)> wrote:

Hmm, looking at the code it seems the password is hashed and the hash is sent to validate the password on the box. I'm using a one character password to rule out me making typos, could that be causing issues (is there a minimum length for the MD5 hash?)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/puschie286/fritzbox-bridge/issues/3?email_source=notifications&email_token=AASRA3FSFNWSJTN2B5RERU3PWKZ4RA5CNFSM4HGTGUD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZBK6A#issuecomment-494015864), or mute the thread (https://github.com/notifications/unsubscribe-auth/AASRA3AQZ3IMB2AVEVOQEJDPWKZ4RANCNFSM4HGTGUDQ).

mvl64 commented 5 years ago

so I could try to move it into the IoT segment too - to see if that changes anything.

I have moved the FritzBox into the same network segment as Homey (the IoT network) and it worked right away. Not sure how the API is effected by crossing the router, but apparently it's breaking the login. I am now able to use the app - will start running some tests.

Thanks a lot for your time and effort.

puschie286 commented 5 years ago

hehe^^ would be nice if you could share your results here - good luck till then :)

mvl64 commented 5 years ago

Yes, I confirm: now (after moving FritzBox into the IoT segment) I cannot login anymore from my original network segment (main lan). This issue was unrelated to your app - just unexpected Fritz behaviour !