public void setConnectionValues(Google google, ConnectionValues values) { GoogleProfile profile = google.userOperations().getUserProfile(); values.setProviderUserId(profile.getId()); values.setDisplayName(profile.getName()); values.setProfileUrl(profile.getLink()); values.setImageUrl(profile.getProfilePictureUrl()); }
public UserProfile fetchUserProfile(Google google) { GoogleProfile profile = google.userOperations().getUserProfile(); return new UserProfileBuilder() .setUsername(profile.getEmail()) .setEmail(profile.getEmail()) .setName(profile.getName()) .setFirstName(profile.getFirstName()) .setLastName(profile.getLastName()) .build(); }