When i try to get the credentials saved in the cache for the mfa login to aws, i always get prompted the mfa code. But it's correctly saved in the cache when i login. Just never used.
cli_cache = os.path.join(os.path.expanduser('~'), '.aws/cli/cache')
params = {'profile': 'profile-name'}
provider = botocore.session.Session(**params)
provider.get_component('credential_provider').get_provider('assume-role').cache = credentials.JSONFileCache(cli_cache)
session = Session(botocore_session=provider)
Can someone help me with this mfa code being prompted every time?
question from:
https://stackoverflow.com/questions/66052035/botocore-credentials-cache 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…