public UserProfile fetchUserProfile(GitHub github) { GitHubUserProfile profile = github.userOperations().getUserProfile(); return new UserProfileBuilder() .setName(profile.getName()) .setEmail(profile.getEmail()) .setUsername(profile.getLogin()) .build(); }
public void setConnectionValues(GitHub github, ConnectionValues values) { GitHubUserProfile profile = github.userOperations().getUserProfile(); values.setProviderUserId(String.valueOf(profile.getId())); values.setDisplayName(profile.getLogin()); values.setProfileUrl( "https://github.com/" + profile.getLogin()); // TODO: Expose and use HTML URL values.setImageUrl(profile.getAvatarUrl()); }