如何使用LoginRadius时从提供商处获取姓名,电子邮件或昵称LinkedIn

本文关键字:电子邮件 LinkedIn 获取 LoginRadius 何使用 提供商 | 更新日期: 2023-09-27 18:32:07

执行此操作时,输入来自LinkedIn:

LoginRadiusSDKv2.LoginRadius loginradius = new LoginRadiusSDKv2.LoginRadius("<API SECRET>");
if (loginradius.IsAuthenticated)
{
    var userprofile = loginradius.GetBasicUserProfile();

不返回任何有用的数据,只返回 userprofile.ID。对于其他提供商,我显示电子邮件地址,(对于推特用户配置文件。配置文件名称)。

我要为LinkedIn显示什么?我可以在LoginRadius网站上找到此特定提供商的任何文档。

如何使用LoginRadius时从提供商处获取姓名,电子邮件或昵称LinkedIn

Todd - 您可以获取该用户的 ID 提供程序存在的基本用户配置文件数据。LinkedIn和 Twitter 不会在用户个人资料数据中提供电子邮件地址,因此您必须为其添加特殊检查:

if (userprofile.Email != null) {  }

您可以使用以下参数获取更多数据:

userprofile.FirstName //first name of user
userprofile.FullName //full name of user
userprofile.Gender //gender of user
userprofile.ID //ID of user on provider
userprofile.LastName //last name of user
userprofile.MiddleName //middle name of user  
userprofile.NickName //nick name of user

有关 ASP.net SDK 的更多文档,请参阅此链接:https://www.loginradius.com/developers/implementation/dot-net-websites

一些附加信息:
要查看实时存在哪些数据,可以在 PlayGround 部分查看:https://www.loginradius.com/developers/apiplayground

如果您需要有关LoginRadius实施的任何其他信息,请告诉我。

谢谢
迪帕克