Replies: 1 comment
-
Hello @yjanezou , Thank you very much for your submission. Both the AWS JAVA SDK V1 and V2 offer support for getCallerIdentity:
I see that you are already using this in your sample, are you encountering any issue? Best regards, Yasmine |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We are building a service which needs to identify caller's identity by using caller's sts token. I wonder if the aws sdk support it? sample code is as below:
private static final String X_AMZ_DATE_HEADER = "X-Amz-Date";
private static final String X_AMZ_SECURITY_TOKEN_HEADER = "X-Amz-Security-Token";
private static final String AUTHORIZATION_HEADER = "Authorization";
...
AWSSecurityTokenService stsClient = ....;
...
GetCallerIdentityRequest request = new GetCallerIdentityRequest();
request.putCustomRequestHeader(AUTHORIZATION_HEADER, "AWS4-HMAC-SHA256");
request.putCustomRequestHeader(X_AMZ_DATE_HEADER, "20230727T182602Z");
request.putCustomRequestHeader(X_AMZ_SECURITY_TOKEN_HEADER, "IQoJb3JpZ2luX2VjEJn....");
GetCallerIdentityResult getCallerIdentityResult = stsClient.getCallerIdentity(request);
Beta Was this translation helpful? Give feedback.
All reactions