-
Notifications
You must be signed in to change notification settings - Fork 115
getEmail of org.springframework.social.connect.UserProfile returns null even if additional permissions granted #97
Comments
+1 I'm having exactly the same problem. Twitter exposes the email in the following way, optional parameter include_email But TwitterProfile.java does not have email attribute and should add include_email parameter in the URL. Here's the line where the UserProfile is returned |
I changed the source code by adding |
I've managed to implement the workaround successfully by doing what you describe. I can now retrieve email that way. I've added email attribute to TwitterProfileWithEmail.class which I pass to getForObject. Email is populated. Bear in mind your app must be whitelisted by Twitter first. After that you checkbox email access permission in your app profile. Revoke permission from your user. Login back again, you will see explicit permission for email and after that restTemplate call it works in my case. Good luck! |
Hi, the problem is that my app is whitelisted. I have revoked permission to my app from my user and then granted it once again upon signing up and still nothing... This is how my app permissions look like. |
I have solved it successfully. What had been missing was the following line in the
|
@fieder I have the required app permission but I am still not getting email. Response doesn't contain email id:
What is wrong here? |
I receive the email right after
Make sure that you are signing up with your user and not signing in with a user you have already been working with. |
You also need to regenerate all tokens generated in Twitter. Revoke app permission from your user and try to login again to make sure the token generated includes that permission. From my end what I did was Cheers. |
Thanks @fieder. I regenerated the tokens generated in Twitter and it worked. |
@PawelJagus Can you explain me how can I implement your solution to my application? I'm using spring-social too but I cannot modify TwitterAdapter since it is a class. |
@MaveZ Sorry for not having answered earlier. I have had a lot to do lately. I will try to find some time to push my changes into GitHub, so you can see what I have changed. I modified the source code in the TwitterAdapter class in order to be able to get the email address from Twitter. |
@habuma is twitter integration dead? |
Is it fix or still the issue? |
It is but.. is there an updated dependency pushed anywhere so I could fetch it instead of doing the changes locally and publishing to local m2 repository? |
This feature is definitely needed, but the project hasn't released new versions since a while. @habuma can you share some feedback on the status of 2.0.0, possibly with this feature included? Any ETA? |
Hi, I have been granted an email request from a user of my app. I have activated "Request email addresses from users" in my Twitter app settings.
After this change the implementation of org.springframework.social.connect.UserProfile for Twitter still returns null when getEmail method is called.
The text was updated successfully, but these errors were encountered: