explosivo22 / kwikset-ha

Kwikset Smart Locks integration for Home Assistant. The Kwikset App is exclusively for use with Kwikset Halo, Halo Touch, and Aura smart locks.
Apache License 2.0
44 stars 5 forks source link

Unable To Sign Into My Account #34

Closed Gam3rrXD closed 1 year ago

Gam3rrXD commented 2 years ago
image

this is happening when I attempt to sign in to my kwikset account

explosivo22 commented 2 years ago

I apologize for not getting back with you sooner. Do you get this every time you try logging in? Does it send you the two step verification?

freedog96150 commented 2 years ago

I am having login issues with the integration. I am asked for my user/email and pass, then the 2FA box pops up and I enter the 6 digit code and get denied any further progress. I have attached a screenshot of the error window.

2022-11-07 07_57_41-Settings – Home Assistant

The only log entry that I find that appears to be related to this error box is as follows: Logger: homeassistant.components.websocket_api.http.connection Source: components/recorder/core.py:239 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 9:19:09 AM (2 occurrences) Last logged: 9:19:09 AM

[140169854344768] Error handling message: Unknown error (unknown_error) Traceback (most recent call last): File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response await func(hass, connection, msg) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/recorder/websocket_api.py", line 180, in ws_list_statistic_ids await ws_handle_list_statistic_ids(hass, connection, msg) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/recorder/websocket_api.py", line 160, in ws_handle_list_statistic_ids await get_instance(hass).async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/recorder/websocket_api.py", line 151, in _ws_get_list_statistic_ids messages.result_message(msg_id, list_statistic_ids(hass, None, statistic_type)) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/recorder/statistics.py", line 897, in list_statistic_ids with session_scope(hass=hass) as session: File "/usr/local/lib/python3.10/contextlib.py", line 135, in enter return next(self.gen) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/recorder/util.py", line 91, in session_scope session = get_instance(hass).get_session() File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/recorder/core.py", line 239, in get_session raise RuntimeError("The database connection has not been established")

explosivo22 commented 2 years ago

could you add the following to your configuration file to enable debugging for the custom component and the underlying module:

logger:
  logs:
    # log level for a custom component
    custom_components.kwikset: debug

    # log level for the `aiohttp` Python package
    aiokwikset: debug

then try adding the integration again. If you don't mind, please post any related logs back here. I was successful in remove my integration and setting it back up so I am hoping this will help us identify what is happening. I may have to implement some more logging if we don't get what we need.

Thanks

freedog96150 commented 2 years ago

I'll work on the logs this weekend and post results here. But I did see some aiohttp warnings related to another integration complaining about the SSL. I run my setup via my own dedicated IP to a domain name and have it reflected in the firewall. I don't have a concept of outside versus inside/local access because of my setup. Ever since I ran an upgrade back in June I have been getting those warnings but have done nothing to fix it since it does not seem to be affecting any access or functionality. Now it seems like I should take a closer look at that warning and resolve. I am sure there is some misconfiguration in my configruation.yaml file in the http: section.

This is one of those warnings Logger: aiohttp.server Source: /srv/homeassistant/venv310/lib/python3.10/site-packages/aiohttp/web_protocol.py:405 First occurred: October 31, 2022 at 10:28:59 AM (27 occurrences) Last logged: 5:09:04 PM

Error handling request Traceback (most recent call last): File "/srv/homeassistant/venv310/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade'

This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/kwikset/config_flow.py:78 Integration: Kwikset Smart Locks (documentation) First occurred: October 31, 2022 at 10:25:20 AM (1 occurrences) Last logged: October 31, 2022 at 10:25:20 AM

And I just found one related to this plugin that I missed before.

Error handling request Traceback (most recent call last): File "/srv/homeassistant/venv310/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/http/ban.py", line 82, in ban_middleware return await handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/http/view.py", line 136, in handle result = await result File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, **kwargs) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/data_entry_flow.py", line 280, in async_configure result = await self._async_handle_step( File "/srv/homeassistant/venv310/lib/python3.10/site-packages/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/home/hass/.homeassistant/custom_components/kwikset/config_flow.py", line 78, in async_step_code await self.api.verify_user(self.pre_auth, user_input[CONF_CODE]) File "/srv/homeassistant/venv310/lib/python3.10/site-packages/aiokwikset/api.py", line 244, in verify_user tokens = await client.respond_to_auth_challenge( File "/srv/homeassistant/venv310/lib/python3.10/site-packages/aiobotocore/client.py", line 225, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.NotAuthorizedException: An error occurred (NotAuthorizedException) when calling the RespondToAuthChallenge operation: Invalid session for the user.

stas1000 commented 1 year ago

Hi There, Same issue on my end. Kwikset asks for authentication code. Added to config logger: logs:

log level for a custom component

custom_components.kwikset: debug

# log level for the `aiohttp` Python package
aiokwikset: debug

but the addon still requests 2FA. Log is:

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/kwikset/config_flow.py", line 78, in async_step_code await self.api.verify_user(self.pre_auth, user_input[CONF_CODE]) File "/usr/local/lib/python3.10/site-packages/aiokwikset/api.py", line 250, in verify_user await self.verify_token(tokens['AuthenticationResult']['IdToken'], KeyError: 'AuthenticationResult'

explosivo22 commented 1 year ago

Can I ask, are you getting your verification code via email or text?

stas1000 commented 1 year ago

I am using email to get my verification. As I am not based in the US I don't have a is number to get the verification.


From: explosivo22 @.> Sent: Wednesday, November 23, 2022 1:49:25 AM To: explosivo22/kwikset-ha @.> Cc: stas1000 @.>; Comment @.> Subject: Re: [explosivo22/kwikset-ha] Unable To Sign Into My Account (Issue #34)

Can I ask, are you getting your verification code via email or text?

— Reply to this email directly, view it on GitHubhttps://github.com/explosivo22/kwikset-ha/issues/34#issuecomment-1323841264, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFIHOT2EW4JTXHQXZTAO3QTWJTP73ANCNFSM6AAAAAARSWXE7I. You are receiving this because you commented.Message ID: @.***>

stas1000 commented 1 year ago

I have just tried SMS but get the same error message


From: Steven Stas @.> Sent: Wednesday, November 23, 2022 6:54:55 AM To: explosivo22/kwikset-ha @.> Subject: Re: [explosivo22/kwikset-ha] Unable To Sign Into My Account (Issue #34)

I am using email to get my verification. As I am not based in the US I don't have a is number to get the verification.


From: explosivo22 @.> Sent: Wednesday, November 23, 2022 1:49:25 AM To: explosivo22/kwikset-ha @.> Cc: stas1000 @.>; Comment @.> Subject: Re: [explosivo22/kwikset-ha] Unable To Sign Into My Account (Issue #34)

Can I ask, are you getting your verification code via email or text?

— Reply to this email directly, view it on GitHubhttps://github.com/explosivo22/kwikset-ha/issues/34#issuecomment-1323841264, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFIHOT2EW4JTXHQXZTAO3QTWJTP73ANCNFSM6AAAAAARSWXE7I. You are receiving this because you commented.Message ID: @.***>

explosivo22 commented 1 year ago

I think I may know what is happening and that is why I was asking. I had based the code completely off of SMS, but I do realize there is another option for email. I will continue to investigate this and hopefully come up with a solution.

stas1000 commented 1 year ago

Thanks, just confirming to get your verification code you just try to re-sign into your app on an other devices and use that verification code sent?


From: explosivo22 @.> Sent: Wednesday, 23 November 2022, 7:35 am To: explosivo22/kwikset-ha @.> Cc: stas1000 @.>; Comment @.> Subject: Re: [explosivo22/kwikset-ha] Unable To Sign Into My Account (Issue #34)

I think I may know what is happening and that is why I was asking. I had based the code completely off of SMS, but I do realize there is another option for email. I will continue to investigate this and hopefully come up with a solution.

— Reply to this email directly, view it on GitHubhttps://github.com/explosivo22/kwikset-ha/issues/34#issuecomment-1324237100, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFIHOTZ3PZKY5CGWCBNZPQDWJUYQTANCNFSM6AAAAAARSWXE7I. You are receiving this because you commented.Message ID: @.***>

explosivo22 commented 1 year ago

Getting the verification code should just be a matter of putting your email and password in when setting up the integration and it should then prompt you for the verification code. The whole process should be completely done inside HA.

I believe I am going to have to add a step though to choose whether you want the code via email or SMS as I set it up originally to only use SMS and not ask. I knew it could do both, but I think I ran into some issues when trying the email, but I am going to revisit this and see if I can't get it ask which way you want the code.

stas1000 commented 1 year ago

That fixed my issue. I didn't know HA was sending the verification to the registered phone via SMS since I had a dummy number there being outside the USA.

I went online to use an international phone number, SMS sent through straight away and registered! Mine is all sorted now. Thank you


From: explosivo22 @.> Sent: Wednesday, November 23, 2022 9:03:13 AM To: explosivo22/kwikset-ha @.> Cc: stas1000 @.>; Comment @.> Subject: Re: [explosivo22/kwikset-ha] Unable To Sign Into My Account (Issue #34)

Getting the verification code should just be a matter of putting your email and password in when setting up the integration and it should then prompt you for the verification code. The whole process should be completely done inside HA.

I believe I am going to have to add a step though to choose whether you want the code via email or SMS as I set it up originally to only use SMS and not ask. I knew it could do both, but I think I ran into some issues when trying the email, but I am going to revisit this and see if I can't get it ask which way you want the code.

— Reply to this email directly, view it on GitHubhttps://github.com/explosivo22/kwikset-ha/issues/34#issuecomment-1324325747, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFIHOT5HUCVB4DTFI6ZKQN3WJVC2TANCNFSM6AAAAAARSWXE7I. You are receiving this because you commented.Message ID: @.***>

explosivo22 commented 1 year ago

Awesome to hear. I will make sure to get the whole email and SMS thing sorted out so you wouldn't have to go through this again.

explosivo22 commented 1 year ago

I have made changes for anyone else having issues. If you don't mind, please try out version 0.1.0 and see if it fixes your setup issues.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.