Is it possible to fetch a google profile nickname and use in app engine apps?
Currently the metho开发者_运维问答d nickname() in the Users class seem to return either the initial way you entered your username when you signed up for gmail (IE. "UseRnAme" if thats how you chose to type it, rather then "username" as it would show up when you log in on a google service) or the entire email if you signed up for a google account with another email provider.
Google profiles have a field called Nickname though, is it possible to use that inside an app engine app in any way?
From the javadocs for User and UserService, it doesn't appear that there is a way to get anything but the nickname.
Specifically, the only methods defined by User are:
int compareTo(User user);
boolean equals(java.lang.Object object);
java.lang.String getAuthDomain();
java.lang.String getEmail();
java.lang.String getFederatedIdentity();
// Return this user's nickname.
java.lang.String getNickname();
// Returns an opaque string that uniquely identifies the user
// represented by this User object.
java.lang.String getUserId();
int hashCode();
java.lang.String toString();
No - the User API only provides the user's email address, an app-specific unique ID, and their nickname (Which, as you observe, is derived from the email address).
精彩评论