'Undefined refresh token

When calling refresh token, I get an undefined RefreshToken back.

SDK version number

@aws-sdk/[email protected]

Steps to reproduce

Get a refresh token and use it in an REFRESH_TOKEN_AUTH request:

const refreshToken = "REFRESH TOKEN GOES HERE";
const client = new AWS.CognitoIdentityProvider({ region: "eu-west-1" });

client.initiateAuth({
  AuthFlow: AuthFlowType.REFRESH_TOKEN_AUTH,
  ClientId: 'XYZ',
  AuthParameters: {
    REFRESH_TOKEN: refreshToken
  }
}).then(w => {
  console.log(w);
})

Result:

{ '$metadata': { httpStatusCode: 200, requestId: '<removed by OP>', extendedRequestId: undefined, cfId: undefined, attempts: 1, totalRetryDelay: 0 }, AuthenticationResult: { AccessToken: '<removed by OP>', ExpiresIn: 300, IdToken: '<removed by OP>', NewDeviceMetadata: undefined, RefreshToken: undefined, <!----------? ---------!> TokenType: 'Bearer' }, ChallengeName: undefined, ChallengeParameters: {}, Session: undefined }

Notice the RefreshToken is undefined.

I expected to get a new RefreshToken as well. Does anyone know why this isn't the case?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source