简体   繁体   中英

Omniauth twitter login doesn't work

I am using omniauth to login with twiiter/facebook account in my site. It works great with facebook but it doesn't work with twitter. On checking log I found that twitter API doesn't send user email id back in response and in my application database email id is mandatory field. Just wonder why email id is not sent back in response.

Is there any setting which prevents sending email id back in response?

Twitter does not provide email. This is because twitter privacy policies.

You can find the following information here: ( https://dev.twitter.com/docs/faq )

"The Twitter API does not provide the user's email address as part of the OAuth token negotiation process nor does it offer other means to obtain it."

You have to make an extra step (on your site), where you ask the user his email.

Regards

Ivangrx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM