How can you determine what federated user belongs to a set of credentials? I've seen some options for finding a regular user, but temporary credentials created by getting a federation token don't seem to work since they don't have GetUser privileges.
User credentials are created like this:
GetFederationTokenRequest getFederationTokenRequest = new GetFederationTokenRequest()
.withDurationSeconds(7200)
.withName(userEmail)
.withPolicy(userPolicy.toString());
GetFederationTokenResult federationTokenResult = stsClient.getFederationToken(getFederationTokenRequest);
Credentials sessionCredentials = federationTokenResult.getCredentials();
BasicSessionCredentials basicSessionCredentials = new BasicSessionCredentials(
sessionCredentials.getAccessKeyId(),
sessionCredentials.getSecretAccessKey(),
sessionCredentials.getSessionToken());
So essentially using the accessKeyId, secretAccessKey, and session token, can I find an arn or username? I have read this post, which allows me to get it from an error message, but I'd rather find a better option.