Skip to content

StsWebIdentityCredentialsProvider does not respect aws.endpointUrlSTS system property #6252

@akitnk

Description

@akitnk

Describe the bug

StsWebIdentityCredentialsProvider does not support properties to configure custom STS endpoint (like aws.endpointUrlSTS and AWS_ENDPOINT_URL_STS). Due to this problem, StsWebIdentityCredentialsProvider cannot access custom STS endpoint even if it is configured using those properties.

I would think the problem exists in the code below:
https://github.com/aws/aws-sdk-java-v2/blob/master/services/sts/src/main/java/software/amazon/awssdk/services/sts/internal/StsWebIdentityCredentialsProviderFactory.java#L118-L132

Looks like this was fixed in aws-sdk-kotlin aws/aws-sdk-kotlin#1210

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

When setting aws.endpointUrlSTS or AWS_ENDPOINT_URL_STS I expect the SDK to use the specified STS URL for fetching credentials.

Current Behavior

It uses the default AWS URL https://sts.region.amazonaws.com/

Reproduction Steps

  1. Set the AWS_ENDPOINT_URL_STS environment variable to a URL that should be called
  2. Set AWS_WEB_IDENTITY_TOKEN_FILE to a file containing some JWT
  3. Set AWS_ROLE_ARN to any valid role ARN
  4. Use SDK to call any service via STS Web Identity Token
  5. See that the URL specified above is not used for authentication

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.31.16

JDK version used

17

Operating System and version

Linux

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions