문제

I am using Spring Social to connect to LinkedIn and Facebook. I downloaded the source code from this link:

Github Spring Social LinkedIn Examples

In this project, I am running “Spring.MvcQuickStart” under examples directory. It works pretty well but I don't know how to get the user’s email. I need to know how can I get the user’s email in the controller given at this link. I've added scope parameters like this:

parameters.Add("scope", "r_emailaddress r_fullprofile");

I can get the full profile of the user like this:

LinkedInFullProfile profile = linkedInClient.ProfileOperations.GetUserFullProfil eAsync().Result;

But the full profile does not contain user email (the email the user provided in his LinkedIn profile). I've no idea how to get the user's email.

도움이 되었습니까?

해결책

The actual implemtation does not read email attribute, but you can get it using classic REST operations:

JsonValue jsonResult = linkedIn.RestOperations.GetForObjectAsync<JsonValue>("people/{~}:(email-address)?format=json").Result;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top