I'm fiddling around with writing some code that goes through the STS authentication process. What I have found is that I can call the following API's in sequence:
RegisterClient
StartDeviceAuthorization
CreateToken
ListAccounts
ListAccountRoles
and I eventually get to the point where I can call GetRoleCredentials
and successfully get back an accessKeyId
, secretAccessKey
and sessionToken
. I've noticed is that I can use these three values to successfully call a bunch of APIs (eg. get a list of lambda functions).
However, all of the doc I read suggests that I actually should also be calling AssumeRole
(which also returns accessKeyId
, secretAccessKey
and sessionToken
).
I'm just trying to figure out what the differences are between GetRoleCredentials
and AssumeRole
, and when should I be calling one vs. the other. Thanks.