MVC 4 DotNetOpenAuth - LinkedIn: Doesn't capture email address

I am using built-in MVC 4 OAuthWebSecurity to enable authentication for LinkedIn.

In my LinkedIn API key, I added r_emailaddress permissions.

enter image description here

The problem is that the email does not end up in the ExtraData dictionary for some reason in the result object.

AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));

      

enter image description here

Any ideas on how I can use LinkedIn's built-in provider but get an email address?

UPDATE Turns out the built-in DotNetAuthOpenAuth provider for LinkedIn does not populate the email address field .... Additionally, the username field is also populated with the full username. So this is a bit odd to say the least.

Anyway, I found this link http://deepindera.blogspot.com/2013/08/aspnet-mvc-oauth-linkedin-email-problem.html which shows how to create a custom LinkedIn client for DotNetAuth.

+3


source to share





All Articles