根据文件——https://docs.aws.amazon.com/cognito-user-identity-pools/latest/apireference/api_respondtoauthchallenge.html 会话参数是可选的。
Map<String, String> challengeResponses = new HashMap<String, String>();
challengeResponses.put("USERNAME", "username");
challengeResponses.put("SMS_MFA_CODE","code");
challengeResponses.put("SECRET_HASH", secretHash);
RespondToAuthChallengeRequest respondToAuthChallengeRequest = new RespondToAuthChallengeRequest()
.withChallengeName(ChallengeNameType.SMS_MFA).withClientId("client_id")
.withChallengeResponses(challengeResponses);
RespondToAuthChallengeResult respondToAuthChallengeResult = null;
respondToAuthChallengeResult = cognitoClient.respondToAuthChallenge(respondToAuthChallengeRequest);
当我没有向请求中添加会话参数时,我不断得到以下异常。
**Missing required parameter Session (Service: AWSCognitoIdentityProvider; Status Code: 400; Error Code: InvalidParameterException; Request ID: ef8780a3-a5f3-4d54-aac5-2251deb7e932)**
暂无答案!
目前还没有任何答案,快来回答吧!