Quantcast
Channel: Spring Community Forums - Social
Viewing all articles
Browse latest Browse all 145

LinkedInAdapter and fetchUserProfile

$
0
0
Hi Everyone,

I have been working to integrate Spring Social into my application and I have been using the code examples from this article:

http://harmonicdevelopment.tumblr.co...mvc-and-spring

I have Facebook working and am moving on to LinkedIn integration.

The challenge I have is that fetchUserProfile, below is only populating firstName, lastName and name in UserProfile.

public UserProfile fetchUserProfile(LinkedIn linkedin) {
LinkedInProfile profile = linkedin.profileOperations().getUserProfile();
return new UserProfileBuilder().setName(profile.getFirstName( ) + " " + profile.getLastName()).build();
}

My code requires username to be populated (and ideally email, however I now understand that email is not available via the LinkedIn API - yuck - I will need to ask the user for it. I do, however, need username but it is null.

Why isn't fetchUserProfile returning a unique id (for example id from the LinkedInProfile) in username? I really need a unique identifier to work with.

Ultimately, I am trying to get this line below to work right in the SignupController from the sample code I linked to above.

UserProfile userProfile = connection.fetchUserProfile();

Thanks!

Viewing all articles
Browse latest Browse all 145

Trending Articles