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

ISSUE: Unable to login to Outlook.com #1014

Open
shooolme opened this issue Nov 21, 2024 · 18 comments
Open

ISSUE: Unable to login to Outlook.com #1014

shooolme opened this issue Nov 21, 2024 · 18 comments
Assignees
Labels
external This issue is a result of external issues

Comments

@shooolme
Copy link

shooolme commented Nov 21, 2024

Attempting to login to Outlook using an app password fails.

  • OS: HassOS
  • Type of device: NUC
  • Home Assistant version: 2024.11.2
  • Core
  • Component version: 0.4.1
Logger: homeassistant.util.loop
Source: util/loop.py:136
First occurred: 2:41:37 PM (1 occurrences)
Last logged: 2:41:37 PM

Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x7fa66d2952d0>, <Purpose.SERVER_AUTH: _ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')>) inside the event loop by custom integration 'mail_and_packages' at custom_components/mail_and_packages/helpers.py, line 122: context = ssl.create_default_context() (offender: /usr/local/lib/python3.12/ssl.py, line 713: context.load_default_certs(purpose)), please create a bug report at https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_default_certs Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 556, in start task = asyncio.Task(coro, loop=loop, eager_start=True) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 567, in _handle return await handler(request) File "/usr/local/lib/python3.12/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 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/config/custom_components/mail_and_packages/config_flow.py", line 322, in async_step_user valid = await _test_login( File "/config/custom_components/mail_and_packages/helpers.py", line 122, in _test_login context = ssl.create_default_context()

image

@shooolme shooolme added the pending Pending review label Nov 21, 2024
@firstof9
Copy link
Collaborator

The logged message you included means nothing, check your home-assistant.log file for the real error message.

@firstof9 firstof9 added more-info-needed Further information is requested and removed pending Pending review labels Nov 21, 2024
@shooolme
Copy link
Author

home-assistant.log

Got the correct log!

@firstof9
Copy link
Collaborator

2024-11-22 11:14:52.072 ERROR (MainThread) [custom_components.mail_and_packages.helpers] Error logging into IMAP Server: b'LOGIN failed.'

Your login failed.

@firstof9 firstof9 added configuration Issues related to configuration and removed more-info-needed Further information is requested labels Nov 22, 2024
@dirtdagg
Copy link

dirtdagg commented Nov 22, 2024

Same issue for me.

I setup Two-Factor Authentication on my outlook account, created an App Password, and tried to reconfigure my original integration with the latest settings, failed after multiple attempts.

Tried setting up the integration from scratch and still saw the same error, "Unable to connect or login to the mail server. Please check the log for details." I'm positive I've used the correct App Password (tried multiple times, regenerated and each one hasn't worked). Tried setting up the integration with IMAP, POP, and SMTP settings, none worked.

@shooolme
Copy link
Author

I've ensured IMAP is enabled on my account but I am not seeing any login attempts.

@stub2k2
Copy link

stub2k2 commented Nov 23, 2024

I third this issue. I have double checked the password, created an app password, made sure imap and pop are all enabled. Can't login.

@firstof9 firstof9 added external This issue is a result of external issues and removed configuration Issues related to configuration labels Nov 23, 2024
@firstof9
Copy link
Collaborator

The issue is outlook.com/live.com rejecting your login.
That's an issue server side.

@dirtdagg
Copy link

To clarify, does that mean you've tested outlook/live login and have them working, this problem is isolated to some accounts? Or does outlook/live reject all logins from this service for whatever reason?

@firstof9
Copy link
Collaborator

It look like outlook/live is rejecting the login for some reason.

@eymericguyot
Copy link

Getting same problem. Created app password:
Error logging into IMAP Server: b'[ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure)'
Error logging into IMAP Server: b'LOGIN failed.'
Error logging into IMAP Server: command: LOGIN => socket error: EOF

@nathanfiscus
Copy link

nathanfiscus commented Dec 3, 2024

It's rejected because Microsoft has disabled Basic Auth via IMAP. See here: https://support.microsoft.com/en-us/office/modern-authentication-methods-now-needed-to-continue-syncing-outlook-email-in-non-microsoft-email-apps-c5d65390-9676-4763-b41f-d7986499a90d

If someone could add OAuth 2.0 for IMAP then you could connect your Outlook address again.

Edit

Google is doing the same: https://support.google.com/a/answer/14114704?hl=en

@jbistis
Copy link

jbistis commented Dec 4, 2024

Encountering the same issue. I created an app password and still cannot connect.

@henkha
Copy link

henkha commented Dec 4, 2024

Same Issue here. IMAP is properly enabled and App-Password has been created. Both are tested to work from a mail client. Only the HA Integration refuses to connect.

@firstof9
Copy link
Collaborator

firstof9 commented Dec 4, 2024

Same Issue here. IMAP is properly enabled and App-Password has been created. Both are tested to work from a mail client. Only the HA Integration refuses to connect.

As @nathanfiscus linked they're disabling basic auth. The mail clients utilize oauth.

Copy link

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

@github-actions github-actions bot added the no-issue-activity Stale issue label Dec 15, 2024
@stub2k2
Copy link

stub2k2 commented Dec 15, 2024

Still an issue. Bump

@github-actions github-actions bot removed the no-issue-activity Stale issue label Dec 16, 2024
@sabasp96
Copy link

sabasp96 commented Dec 16, 2024

I've been having this same issue. Is there any plan on adding OAuth 2.0 authentication to the integration?

Or is it time to switch email services?

@stub2k2
Copy link

stub2k2 commented Dec 16, 2024

Or is it time to switch email services?

seems like a bad reason to switch email providers. unless you are on the fence already. I would bet others will move to the new security sooner than later anyway. One workaround that would require less of an upheaval. You could create rules in outlook.com to forward all delivery email to a gmail/yahoo/etc, then register that email with this plugin. Also added benefit of only giving the software access to those emails for scraping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external This issue is a result of external issues
Projects
None yet
Development

No branches or pull requests

9 participants