Skip to content

Adding IdentityToken to CredentialsProvider #204

@pranavr12

Description

@pranavr12

In our workflow, we need to pass an identityToken (This is different from the x-amz-security-token) to the downstream CredentialsProvider service to resolve the identity

Option 1
Currently, we have emulatedAccessKey, session fields in the CredentialsProvider. Would it make sense to add another field - identityToken to this method ?

Changes required:
Pass identityToekn as a query parameter -

credentialsKey.session().ifPresent(sessionToken -> uriBuilder.queryParam("sessionToken", sessionToken));

Pass Optional.empty() in

return credentialsProvider.credentials(request.requestAuthorization().accessKey(), request.requestAuthorization().securityToken())

A custom SigningController can pass in the required IdentityToken

Option 2
Add a new default method (with IdentityToken) to the interface that calls credentials(String emulatedAccessKey, Optional<String> session). The implementing class can choose to have their own logic for the identityToken

Option 3
As discussed with @Randgalt, passing the Request object to the credentials provider seems to be a reasonable and scalable approach. This might change code at a lot of places, but should still be doable

Any other approaches also appreciated!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions