I request the email field from linkedin by passing the cope variable, I can see on linkedin website (when redirected for auth) the application is requesting access to email for which i am requested to grant access but on callback the email field is blank. Get a Nullpointer on line 'usr.setEmailAddress(providerUser.getEmail()...' below. Please advise.
Linkedin Module Version: 1.0.0.BUILD-SNAPSHOT
Linkedin Module Version: 1.0.0.BUILD-SNAPSHOT
Code:
<form name="linkedin_signin" id="linkedin_signin" action="${linkedin_uri}" method="POST">
<input type="hidden" name="scope" value="r_basicprofile r_emailaddress" />
<input type="image" src="${linkedin_img_uri}" />
</form>
...
public User fromProviderUser(UserProfile providerUser) {
String fullName = providerUser.getFirstName()+" "+providerUser.getLastName();
User usr = new User();
usr.setName(fullName);
usr.setEmailAddress(providerUser.getEmail().toString());
usr.setUsername(createUsername(fullName));
return usr;
}