Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtain STS via X-aliyun-ecs-metadata-token is not work #57

Open
jht5945 opened this issue Feb 7, 2024 · 0 comments
Open

Obtain STS via X-aliyun-ecs-metadata-token is not work #57

jht5945 opened this issue Feb 7, 2024 · 0 comments

Comments

@jht5945
Copy link

jht5945 commented Feb 7, 2024

  • JAVA Version: any
  • Platform: any
  • Product: any
  • Product Version: 0.3.0
  • API: ECSMetadataServiceCredentialsFetcher

The SDK only works with direct fetch STS token:

curl http://100.100.100.200/latest/meta-data/ram/security-credentials/<Name of the instance RAM role>

More secure method via X-aliyun-ecs-metadata-token is not work:

# Obtain the access credentials of the metadata server for authentication.
TOKEN=`curl -X PUT "http://100.100.100.200/latest/api/token" -H "X-aliyun-ecs-metadata-token-ttl-seconds:<Validity period of the metadata server access credentials>"` 
# Obtain a temporary authorization token for the instance RAM role.
curl -H "X-aliyun-ecs-metadata-token: $TOKEN" http://100.100.100.200/latest/meta-data/ram/security-credentials/<Name of the instance RAM role>

Reference: https://www.alibabacloud.com/help/en/ecs/user-guide/obtain-a-temporary-authorization-token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant