웹 페이지에서 Cognito에 로그인하면 작동 토큰 백 및 ID 토큰을 모두받습니다. 이제 로그인 할 때 람다 (Lambda) 함수를 실행하고 사용자의 일부 데이터에 액세스하려고합니다. 그러나 여기에서는 실패합니다. InvalidLambdaResponseException: Invalid lambda trigger source
이 나옵니다.AWS Java Lambda Cognito - 잘못된 람다 트리거 소스
이 문제의 원인에 대한 아이디어가 있으십니까? 당신이 뭘 하려는지의 세부 사항에 대해 너무 많이 모르고
function loginCognito()
{
AWSCognito.config.region = 'us-east-1';
var authenticationData = {
Username : '***',
Password : '***',
};
var authenticationDetails = new AWSCognito.CognitoIdentityServiceProvider.AuthenticationDetails(authenticationData);
var poolData = { UserPoolId : 'us-east-1*********',
ClientId : '*******************'
};
var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
var userData = {
Username : '***',
Pool : userPool
};
var cognitoUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser(userData);
cognitoUser.authenticateUser(authenticationDetails,
{
onSuccess: function (result) {
/* ... */
},
onFailure: function(err) {
alert(err);
}
});
}
를 직렬화 할 수있는 입력 개체가 필요? 요청 ID, aws 지역 및 타임 스탬프가 있습니까? –
@VasileiosLekakis 사용자 풀/"my pool"/ Triggers에서 "Post authentication"아래에서 람다 함수를 선택했습니다. 나는 로그인 (최신 업데이트를 참조하십시오) 자바 스크립트를 사용하여 –