Reputation: 6884
Given a "refresh token" I am looking to extract the username using "AdminInitiateAuthResult" object.
Here is what my code looks like:
Map<String,String> authParams = new HashMap<String,String>();
authParams.put("REFRESH_TOKEN", refreshToken);
final AdminInitiateAuthRequest authRequest = new AdminInitiateAuthRequest().withAuthFlow(AuthFlowType.REFRESH_TOKEN).withAuthParameters(authParams).withClientId("XXXX").withUserPoolId("YYY");
final AdminInitiateAuthResult authResponse = getAWSCognitoIdentityProviderClient().adminInitiateAuth(authRequest);
Upvotes: 0
Views: 215
Reputation: 5751
There is no username returned in the case of the refresh token flow. However, you could find the username by cracking open the tokens you retrieved.
Upvotes: 1