Issuing Temporary Credentials to sign into AWS Management Console using AssumeRole, existing Policies, and unique URL Issuing Temporary Credentials to sign into AWS Management Console using AssumeRole, existing Policies, and unique URL powershell powershell

Issuing Temporary Credentials to sign into AWS Management Console using AssumeRole, existing Policies, and unique URL


I found the answer, and unfortunately it didn't turn out to be anything to exciting!

It seems the offending code was in the portion that creates the JSON session string that you use to exchange for a Sign-in Token.

I was missing surrounding double quotation marks "" for the key value pair.

Here is the updated portion of that code for anyone else trying to get this to work!

$jsonSession = @"{"sessionId": $([string]::Format('"{0}"', $role.Credentials.AccessKeyId)),"sessionKey": $([string]::Format('"{0}"', $role.Credentials.SecretAccessKey)),"sessionToken": $([string]::Format('"{0}"', $role.Credentials.SessionToken))}"@