auth0获取有关Android中userProfile的更多信息

时间:2018-04-03 15:27:55

标签: java android facebook-graph-api auth0

我正在使用Auth0和Android。我的目的是检索有关用户的更多信息,而不仅仅是电子邮件和名称,例如用户的生日。但即便如此,我也无法做到这一点 当我记录userProfile对象时;我已经获得了所有我喜欢的信息。但是当我想在textView中显示例如生日时;我收到了这个错误

error: cannot find symbol method getGender()

这就是我编写简单代码的方式:

birthdayTextView.setText(String.format(getString(R.string.birthday), userProfile.getGender()));

1 个答案:

答案 0 :(得分:0)

错误表示没有userProfile.getGender()功能。

Auth0规范化用户个人资料包含these attributes

在下方复制以获得完整性。但请注意,gender不可用。

可能的解决方法:

A)。可以向user_metadata(可由最终用户编辑)或app_metadata(最终用户无法编辑)添加自定义声明。

B)。还可以通过规则向令牌添加自定义声明。

规范化用户个人资料声明

app_metadata: the custom fields storing information about a user. These attributes contain information that influences the user's access;

blocked*: the true/false value indicating if the user has been blocked;

created_at: the timestamp of when the user profile was first created;

email (unique): the user's email address

email_verified: the true/false value indicating if the user has verified their email address;

identities: the array of objects with information about the user's identities:

connection: the name of the connection used to authenticate the user;
isSocial: the true/false value indicating if the connection is a social one or not;
provider: the entity that is authenticating the user (such as Facebook, Twitter, and so on);
user_id: the user's unique identifier for this connection/provider.
multifactor: the list of multifactor providers in which the user is enrolled;

last_ip*: the IP address associated with the user's last login;

last_login*: the timestamp of when the user last logged in;

logins_count*: the number of times the user has logged in;

name: the user's name;

nickname: the user's nickname;

phone_number: the user's phone number;

phone_verified: the true/false value indicating whether the user's phone number has been verified (only valid for users with SMS connections);

picture: the user's profile picture, click here to learn more about the picture field;

updated_at: the timestamp of when the user's profile was last updated/modified;

user_id (unique): the user's unique identifier;

user_metadata: the custom fields storing information about a user. These attributes should contain information about the user that does not impact what they can or cannot access (such as work and home addresses);

username (unique): the user's username.