简体   繁体   English

Cognito:获取联合身份电子邮件

[英]Cognito: Get federated identity email

When using cognito, (not just user pool, but Google and FB federated identites too) how can I get the users email address? 使用cognito时(不仅是用户池,还有Google和FB联合身份),如何获取用户的电子邮件地址?

Do I have to make a separate call to the federated identity provider? 我是否需要单独致电联邦身份提供商? If so could you provide an example that won't prompt the user again? 如果可以,您能否提供一个不会再次提示用户的示例?

Retrieving email address for users in UserPool: 在UserPool中检索用户的电子邮件地址:

  • Id Token returned after user authentication contains email claim. 用户身份验证包含电子邮件声明后返回的ID令牌。

You can also call following API operations to retrieve email address and other user attributes. 您还可以调用以下API操作来检索电子邮件地址和其他用户属性。

Retrieving email address for identityId in Cognito Federated Identities: 在Cognito联合身份中检索identityId的电子邮件地址:

If you are using developer authenticated identities you can use developer user identifier as email address and then use LookupDeveloperIdentity to get email address from identityId and vice versa. 如果您使用的是开发人员验证的身份 ,则可以使用开发人员用户标识符作为电子邮件地址,然后使用LookupDeveloperIdentity从identityId获取电子邮件地址,反之亦然。

There is currently no system supported way to get user's email address or other attributes from Google, Facebook and other OIDC providers federated identities but you can leverage Cognito Sync to store/retrieve user profile information yourself including email address. 当前没有系统支持的方法来从Google,Facebook和其他OIDC提供者联合身份获取用户的电子邮件地址或其他属性,但是您可以利用Cognito Sync自己存储/检索用户配置文件信息,包括电子邮件地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM