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

auth0 get further information about userProfile in Android

我正在与 Auth0 和 Android 合作。我的目的是检索有关用户的更多信息,而不是电子邮件和姓名,例如用户的生日。但我不能这样做,即使是任何其他申请 当我记录 userProfile 对象时;我已经得到了我想要的所有信息。但是当我喜欢在 textView 中显示例如生日时;我收到这个错误

error: cannot find symbol method getGender()

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

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

报错提示没有userProfile.getGender()功能

Auth0 规范化用户配置文件包含 these attributes

为了完整起见,复制如下。但请注意,gender 不可用。

可能work-arounds:

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.