Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Username/password invalid #23

Closed
joshua1000 opened this issue Dec 2, 2022 · 6 comments
Closed

Username/password invalid #23

joshua1000 opened this issue Dec 2, 2022 · 6 comments

Comments

@joshua1000
Copy link

As per #22
"The credentials I'm using work fine when logging in directly on the website, but I get an error "Username/password invalid" when using the same credentials for the integration."

I'm sorry, I should have made this clearer. I am not using any sort of oauth, but an email and password directly when logging in via https://smartmeter-web.wienernetze.at/
The same credentials are rejected by the integration.

@DarwinsBuddy
Copy link
Owner

I see, well that's odd. it should work tough with the same credentials you are using for the smart meter login.

Have you tried removing the custom component and installing merely via HACS or did you have a back and forth solution? I couldn't read that from your OP.

Can you provide some Log output? (best would work after restart or in the last hour, which is the update interval)

@joshua1000
Copy link
Author

2022-12-03 10:19:36.525 ERROR (MainThread) [custom_components.wnsm.config_flow] Error validating Wiener Netze auth 2022-12-03 10:19:36.543 ERROR (MainThread) [custom_components.wnsm.config_flow] Login failed. Check username/password. Traceback (most recent call last): File "/config/custom_components/wnsm/config_flow.py", line 43, in async_step_user zps = await self.validate_auth(user_input[CONF_USERNAME], user_input[CONF_PASSWORD]) File "/config/custom_components/wnsm/config_flow.py", line 34, in validate_auth await self.hass.async_add_executor_job(api.login) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/wnsm/api/client.py", line 56, in login raise SmartmeterLoginError("Login failed. Check username/password.") custom_components.wnsm.api.errors.SmartmeterLoginError: Login failed. Check username/password.

This is what came up after restart and trying to add the integration again (already installed in HACS).
I'm not sure what I'd doing wrong, I'm using the same password as I am for wienerstadtwerke.at and smartmeter-web.wienernetze.at, it works flawlessly there.

@DarwinsBuddy
Copy link
Owner

I digged once more into the code and cannot see an error on integration's side. Though, there could be something going on with the login and wiener netze switching internally between different login flows. But I wouldn't assume that's the case here.

What I did:

  1. Log into smartmeter-web.wienernetze.at with my log.wien credentials ✔️ worked
  2. spawn up the api included in the integration and used the same credentials there ✔️ worked
  3. tried to reverse engineer the current login mask (could be that there where any changes happening there). I found nothing of concern there, except for a possible ReCaptcha, which appears to happen after consecutive logins (don't know if they have to fail for it). Since the authentication api is somewhat obstructed, we are using the form provided by smartmeter-web.wienernetze.at. Which means, if the api is returning the request for a ReCaptcha in your case (just an assumption), it could be that this cannot be filled out by the integration. Unfortunately, there is no way of automating this.

I'd try the following:

  1. log in once more into smartmeter-web.wienernetze.at with your credentials in log.wien
  2. delete the integration once more and double check if there are any configurations left over accidentally.
  3. add the integration via HACS once more and use the config flow (not the yaml approach) to configure it and use the same credentials as for smartmeter-web.wienernetze.at
  4. if that does not help, try to log into smartmeter-web.wienernetze.at manually, fill in the ReCaptcha if applicable and restart the integration

Please report back afterwards. I'll leave that issue open. Hopefully we can find a solution.

@reox
Copy link
Collaborator

reox commented Dec 4, 2022

I saw this in my logs too but on the next invocation it worked normal. Maybe the problem is on Wiener Netze side?

@joshua1000
Copy link
Author

Sorry for the late reply, I came down with the flu last week :(

I thought this had something to do with my long password, so I tried to change it. I pasted what I had in my password manager in, but the site said that a special character is missing. I had none in my original !working! password. So I shortened it and added a character at the end. At which time I noticed that not all logins I had saved for the various WienEnergie sites were the same! One had a special character at the end, the others didn't. I had no access issues from any of the sites with any of the passwords, though. No idea how this is possible.
My best assumption is that some of the WienEnergie sites require special characters and others don't. The logins somehow tie in, regardless.

In any case, issue solved. I'm sorry for the trouble.

@DarwinsBuddy
Copy link
Owner

I'm glad to hear that it resolved. I'll refer your issue to our API thread for reference. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants