Closed kbyunAncile closed 3 years ago
Hi @kbyunAncile,
Good morning.
AWS Tools for PowerShell rely on AWS .NET SDK behind the scenes. Kindly refer the guidance provided in https://github.com/aws/aws-sdk-net/issues/1844#issuecomment-831580377.
Thanks, Ashish
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
The Question
I have configured MFA for my named profile. When I use aws cli, it prompts MFA authentication for the first time. Then it caches it for certain duration or when new profile is detected.
But for Powershell aws-tool always prompts MFA authentication every time script runs.
for example, if I have a powershell script
for first execution, both calls will ask MFA. But on second execution only Powershell AWS-Tool will ask MFA. I wonder if there is a configuration for MFA sessions.
Or maybe it is related to how I'm configuring profile? for AWS CLI, I set environment variable
$env:AWS_PROFILE="myprofile"
to desired profile for Powershell AWS-Tool, I callSet-AWSCredential -ProfileLocation $env:UserProfile\.aws\config -ProfileName myprofile
Environment
Amazon Web Services SDK for .NET Core Runtime Version 3.3.104.35