Amazon web services Cognito触发器不适用于联合sigin

Amazon web services Cognito触发器不适用于联合sigin,amazon-web-services,triggers,aws-lambda,amazon-cognito,federated,Amazon Web Services,Triggers,Aws Lambda,Amazon Cognito,Federated,我已经为Cognito配置了一个lambda触发器。它适用于Cognito用户登录,但不适用于联邦用户登录。 注意:我使用的不是“Cognito托管UI”,而是Auth.federatedSignIn,这样用户就可以通过提供者(例如:google)进行身份验证 之前我确实为Cognito添加了权限。如下图所示 aws lambda添加权限 --函数名 --语句id --操作lambda:InvokeFunction --principal cognito-idp.amazonaws.com --

我已经为Cognito配置了一个lambda触发器。它适用于Cognito用户登录,但不适用于联邦用户登录。 注意:我使用的不是“Cognito托管UI”,而是Auth.federatedSignIn,这样用户就可以通过提供者(例如:google)进行身份验证

之前我确实为Cognito添加了权限。如下图所示

aws lambda添加权限

--函数名

--语句id

--操作lambda:InvokeFunction

--principal cognito-idp.amazonaws.com

--源arn

我应该对谷歌这样的“负责人”也这么做吗?我试过“accounts.google.com”。它不起作用


我不知道为什么触发器对联邦用户不起作用。

我很确定用户池触发器是针对用户池用户(通过电子邮件/用户名)的,而不是针对身份池联邦用户的。。。你用过这个吗?你能确认一下吗?是的,我让它工作了。我必须使用“身份池”。你能进一步解释一下如何实现这一点吗?@umer你必须创建“身份池”并创建角色(经过身份验证和未经身份验证),然后选择身份验证提供商(谷歌、facebook等)客户端,例如:google const ga=window.gapi.auth2.getAuthInstance();然后(googleUser=>{const{id_token,expires{u at}=googleUser.getAuthResponse();const profile=googleUser.getBasicProfile();let user={email:profile.getEmail(),name:profile.getName()};const credentials=wait Auth.federatedSignIn('google',{token:id_token,expires_at},user);},error=>{});