question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with 2FA authentication to amazon account

See original GitHub issue

Issue with authentication to amazon account I’m not able to connect to my amazon account with Alexa Media Player

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘Integration’
  2. Add Alexa Media player Integration
  3. Fill in the form (login, password, domain, url, 2FA key)
  4. After maybe one or two minute i saw an error : “Unknown error occurred”

I already use Alexa Media player before. But this morning i was told to reautenticate. I had the same error so i tried first to uninstall the component and reinstall it. But the result is the same.

Expected behavior Be able to connect to my amazon account

Screenshots image

System details

  • Home-assistant (version): 2022.6
  • alexa_media (version from const.py or HA startup): 4.0.2
  • alexapy (version from pip show alexapy or HA startup):
  • Amazon 2FA is enabled

Logs

2022-06-06 18:15:15 DEBUG (MainThread) [alexapy.alexalogin] GET: 
https://www.amazon.com/ap/mfa?ie=UTF8&arb=efd31126-b1ec-4f8f-bd45-eb08bb48d538&mfa.arb.value=efd31126-b1ec-4f8f-bd45-eb08bb48d538&mfa.arb.key=arb returned 200:OK with response <CIMultiDictProxy('Content-Type': 'text/html;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'Server', 'Date': 'Mon, 06 Jun 2022 16:15:15 GMT', 'x-amz-rid': '792FKRNVR5JHZXJW1W3B', 'Set-Cookie': 'session-id=137-6261792-4033303; Domain=.amazon.com; Expires=Tue, 06-Jun-2023 16:15:15 GMT; Path=/; Secure', 'Set-Cookie': 'session-id-time=2285252115l; Domain=.amazon.com; Expires=Tue, 06-Jun-2023 16:15:15 GMT; Path=/; Secure', 'Set-Cookie': 'ubid-main=133-1081181-0641742; Domain=.amazon.com; Expires=Tue, 06-Jun-2023 16:15:15 GMT; Path=/; Secure', 'Set-Cookie': 'session-token="kiGM4o1btUGtoUNhWcy2z+9h4PhzdjDhrSgmehUceDDt0T6N4uf1RhwgGlg+nIqUGCJjnUuSH28L0KGyjkkvpt8UE5f+XP5mgGez9NpUGBIqOn0HoVpCT5Ahud3pRxZiyGBT/CMDDgShmL8+h9anQ1G6Zw+Iy7PEOwELpAvt8A9ZqJnQKDDbrDtFjKQQXQim2ynmE+JX9dXYNPTaekGo9Q=="; Version=1; Domain=.amazon.com; Max-Age=31536000; Expires=Tue, 06-Jun-2023 16:15:15 GMT; Path=/; Secure', 'X-XSS-Protection': '1', 'X-Content-Type-Options': 'nosniff', 'x-ua-compatible': 'IE=edge', 'Strict-Transport-Security': 'max-age=47474747; includeSubDomains; preload', 'Vary': 'Content-Type,Accept-Encoding,X-Amzn-CDN-Cache,X-Amzn-AX-Treatment,User-Agent', 'p3p': 'policyref="http://www.amazon.com/w3c/p3p.xml",CP="CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC "', 'X-Frame-Options': 'SAMEORIGIN', 'Permissions-Policy': 'interest-cohort=()', 'NEL': '{ "report_to": "nel", "max_age": 3600, "success_fraction": 0.0, "failure_fraction": 1.0 }', 'Report-To': '{"group": "nel", "max_age": 3600, "endpoints": [{ "url": "https://primary.prod.flex.frontier.a2z.com/nel"}, { "url": "https://secondary.prod.flex.frontier.a2z.com/nel"}]}', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 3e54eeb04035e3584145be33441ccbba.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'CDG53-C1', 'X-Amz-Cf-Id': '6gkFce46hFDm2y8equ5k7PAc0gWjdeHIis0WpEmO_7Qa6sxnBRYYcw==')>
2022-06-06 18:15:16 DEBUG (MainThread) [alexapy.alexalogin] Processing https://www.amazon.com/ap/mfa?ie=UTF8&arb=efd31126-b1ec-4f8f-bd45-eb08bb48d538&mfa.arb.value=efd31126-b1ec-4f8f-bd45-eb08bb48d538&mfa.arb.key=arb
2022-06-06 18:15:16 DEBUG (MainThread) [alexapy.alexalogin] 2FA requested
2022-06-06 18:15:16 DEBUG (MainThread) [alexapy.alexalogin] Found post url to https://www.amazon.com/ap/signin
2022-06-06 18:15:16 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Testing login status: {'securitycode_required': True}
2022-06-06 18:15:16 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Creating config_flow to request 2FA. Saved security code None
2022-06-06 18:15:16 DEBUG (MainThread) [alexapy.alexalogin] Unable to generate OTP; 2FA app key not configured
2022-06-06 18:16:18 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Using existing login
2022-06-06 18:16:18 DEBUG (MainThread) [alexapy.alexalogin] Creating TOTP for 2************************************************JCA
2022-06-06 18:16:18 DEBUG (MainThread) [alexapy.alexalogin] Generating OTP 079150

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:30

github_iconTop GitHub Comments

1reaction
robertoleonardocommented, Jun 7, 2022

@hbigot – do you have your amazon login details in your configuration.yaml? if so, remove that and add from the integration page. that’s what fixed this issue for me – i started having this issue with 2022.6 a few weeks ago, and just now realized it’s because it had imported my credentials but didn’t remove them from the configuration file, so every reboot it was trying to login twice and causing issues. i didn’t even remember i had originally put my credentials in my configuration file until after pulling my hair out on this for hours 😃 bu yep, cleaning them out of my configuration.yaml file seems to have finally fixed this for me.

0reactions
andrewbpowerscommented, Jun 8, 2022

You’re welcome to look at the code to see what we do. Happy to refund the money you paid for the component though if you’re not 100% satisfied.

Really awkward reaction from you! But I do not waste my time with such infantile crying. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve Common Two-Step Verification Issues - Amazon.com
Enter your sign-in information and click Submit. · You'll receive an error message saying that your email and password combination is incorrect. ·...
Read more >
What is Two-Step Verification? - Amazon Customer Service
Two-Step Verification is a feature that adds an extra layer of security to your account log-in. When you try to log in, Two-Step...
Read more >
About Multi-Factor Authentication - Amazon Customer Service
“Multi-factor authentication” happens when your sign-in activity looks different because you've cleared your cookies, or you're signing in from a new ...
Read more >
Two-Step Verification - Amazon Kindle Direct Publishing
Go to your Amazon customer account on Amazon.com · Under Account & Lists, click Your Account · Choose Login & Security · Click...
Read more >
What if an MFA device is lost or stops working?
On the Amazon Web Services Sign In With Authentication Device page, choose Having problems with your authentication device? Click here.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found