我已经使用 Google 身份提供商设置了 AWS Cognito,如https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html 中所述。
用户可以登录,但我似乎只取回用户email,email_verified和username喜欢Google_xxxxxxxxxxxxxxx我的身份验证的回调和cognito登录/注册LAMBDA挂钩。
有没有办法同时获取用户的名字和姓氏?
我已经设置profile email openid为授权范围。
还尝试使用googleapisnpm 包进行调用,oauth2.userinfo.get如How to use the node google client api to get user profile with already fetched token? 但是我取回的访问令牌来自 Cogntio 而不是 google,这就是为什么我认为这对我不起作用。