To use MFA do I need to disable client secretion in cognito?

0

I'm implementing MFA authentication in a nodejs back-end application.

Method:

 public async respondToAuthChallenge(payload: RespondToAuthChallengeDto) {
    const params = {
      ClientId: this.clientId,
      ChallengeName: 'SOFTWARE_TOKEN_MFA',
      ChallengeResponses: {
        SOFTWARE_TOKEN_MFA_CODE: payload.mfaCode,
      },
      Session: payload.session
    };    

    return this.cognitoIdentityServiceProvider.respondToAuthChallenge(params).promise();
  }

Respose error:

Client [ID_CLIENT] is configured with secret but SECRET_HASH was not received

But if I add the secret hash I have this error

Unexpected key 'SECRET_HASH' found in params

The problem is that the params of the 'respondToAuthChallenge' method do not have the SecretHash, but my application aware has the secret client enabled. Do I need to disable client secretion to use MFA?

回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ