程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

gimme-aws-creds fails on cmd when type mfa

发布于2024-10-31 20:32     阅读(240)     评论(0)     点赞(10)     收藏(5)


I am trying to login, it recognizes my username but fails when I type the MFA. I can login on browser using the same credentials.

MacOS using zsh. gimme-aws-creds used to work fine at the same machine. gimme-aws-creds 2.8.2 Python 3.9.6

gimme-aws-creds
    Using password from keyring for my_username
    Multi-factor Authentication required.
    Preferred factor type of web not available.
    Using the only authentication factor configured: token:software:totp( GOOGLE ) : myemail@domain.ad.
    Enter verification code:
    Traceback (most recent call last):
      File "/opt/homebrew/bin/gimme-aws-creds", line 17, in <module>
        GimmeAWSCreds().run()
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 453, in run
        self._run()
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 876, in _run
        for data in self.iter_selected_aws_credentials():
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 845, in iter_selected_aws_credentials
        aws_results = executor.map(generate_credentials_prepare_data, self.aws_selected_roles)
                                                                      ^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 727, in aws_selected_roles
        selected_roles = self._get_selected_roles(self.requested_roles, self.aws_roles)
                                                                        ^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 718, in aws_roles
        self.saml_data['SAMLResponse'],
        ^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 709, in saml_data
        self._cache['saml_data'] = saml_data = self.okta.get_saml_response(self.aws_app['links']['appLink'], self.auth_session)
                                                                           ^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 702, in aws_app
        self._cache['aws_app'] = aws_app = self._get_selected_app(self.conf_dict.get('aws_appname'), self.aws_results)
                                                                                                     ^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 643, in aws_results
        auth_result = self.auth_session
                      ^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/main.py", line 629, in auth_session
        auth_result = self.okta.auth_session(redirect_uri=self.conf_dict.get('app_url'), open_browser=open_browser)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/okta_classic.py", line 179, in auth_session
        login_response = self.auth()
                         ^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/okta_classic.py", line 172, in auth
        flow_state = self._next_login_step(
                     ^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/okta_classic.py", line 342, in _next_login_step
        return self._login_multi_factor(state_token, login_data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/okta_classic.py", line 626, in _login_multi_factor
        return self._login_input_mfa_challenge(state_token, factor['_links']['verify']['href'])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/gimme_aws_creds/okta_classic.py", line 656, in _login_input_mfa_challenge
        response.raise_for_status()
      File "/opt/homebrew/Cellar/gimme-aws-creds/2.8.2_4/libexec/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
        raise HTTPError(http_error_msg, response=self)

解决方案


暂无回答



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:https://www.pythonheidong.com/blog/article/2040403/e929570b957bfbc07070/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

10 0
收藏该文
已收藏

评论内容:(最多支持255个字符)