aws4-axios icon indicating copy to clipboard operation
aws4-axios copied to clipboard

AssumeRoleCredentialsProvider does not allow passing credentials

Open moltar opened this issue 3 years ago • 3 comments

It looks like AssumeRoleCredentialsProvider assumes the credentials are coming from the environment, and there is no way to pass them explicitly.

The entry point is here, which decides whether to use credentials OR role.

https://github.com/jamesmbourne/aws4-axios/blob/9066b38c73a575bdae28bcdd81cfbe3ce318b2e3/src/interceptor.ts#L69-L76

But I think it is a valid use case to provide credentials, which will be used for STS.

Docs: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#constructor-property

image

moltar avatar Mar 10 '21 06:03 moltar

Encounter the same issue when integrate multiple AWS profiles. @moltar did you found any workaround?

michael-land avatar Oct 25 '21 22:10 michael-land

@jamesmbourne any thoughts?

michael-land avatar Mar 15 '22 01:03 michael-land

You could write your own CredentialsProvider based on AssumeRoleCredentialsProvider.

scottanderson42 avatar Sep 26 '22 21:09 scottanderson42