Email in response from twitter login


#1

Hello.

I’m creating social login for client. So users can authenticate with twitter in to website.
Created app with all information. Provided url to ToS and privacy policy, added permision to request email, then regenerated keys and tokens and request is for ‘account/verify_credentials’ with parameter ‘include_email’ = true.
But when i debug response, there is no user email, al other info, like, screen name etc is there. Testing with personal twitter acc and it has verificated email. Working in wordpress with userpro plugin.
Maybe i there is something more i have to do with twitter app, so i can get email from user?


#2

This sounds like you’ve taken all the steps you should have taken.

Two things to check:

  • after you’ve changed the app permissions, and the user has entered the sign-in with Twitter flow, does the authorisation screen show the “request email address” permission?
  • when you call the verify_credentials endpoint, are you specifying the value of true as a String? This is important, as this particular parameter must be a String and not a Boolean.

#3

I would guess it’s point 2. PHP converts true to "1" when casting to a string.


#4

Yes of course, I missed the detail about this being WordPress/PHP. I’d concur with @abraham.


#5

Yes, it was the case.
Thanks @andypiper and @abraham
:slight_smile:


closed #6