# Can't log in on Twitter.Why no email returned?

**URL:** <https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023>\
**Category:** Get Help\
**Tags:** login, auth0\
**Created:** [June 28, 2022, 12:28am UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023 "2022-06-28T00:28:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yosuke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yosuke/32/33258_2.png) [@yosuke](https://community.auth0.com/u/yosuke)\
**Post date:** [June 28, 2022, 12:28am UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023/1 "2022-06-28T00:28:19Z")

</div>

Hello everyone.

I would like to know.

What I want to do.  
I want to use the Auth0 feature to do social login with my Twitter account.

having trouble with this.  
The login fails.  
⇒I checked the user of Auth0.  
⇒I want to use the Auth0 function to log in socially.

★Questions  
I have a problem with the “Setup Guide” on the Twitter setup screen.

＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝  
User’s email address is missing from retrieved user profile  
Twitter connections do not retrieve the user’s email address by default. However, you can add a rule to request the email address using the Access Token returned from Twitter providing you supply a privacy policy and terms & conditions.

Auth0 provides a rule template to get email addresses from Twitter. To use it, create a new rule with the Get Email Address from Twitter template under the Enrich Profile section.

If you are using Auth0 developer keys, this functionality will not work; you will need to use your Twitter API Key and API Secret Key.

You must also explicitly request permission to retrieve user email addresses for your Twitter app:

Log in to Twitter Developer Project and App Management.  
Choose your project, and then your app settings.  
Click Edit next to Authentication settings, then toggle the switch to enable Request email address from users.  
Enter the appropriate links in the Terms of service and Privacy policy fields, then click Save.  
＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝

I don’t know what to do when I see this.  
Do I need to modify the source code or do I need to do something on the Auth0 setup screen?

★use Platforms  
EC-CUBE4

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 29, 2022, 12:08am UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023/2 "2022-06-29T00:08:37Z")

</div>

Hello there @yosuke welcome to the community!

> [@yosuke](#):
>
> Auth0 provides a rule template to get email addresses from Twitter. To use it, create a new rule with the Get Email Address from Twitter template under the Enrich Profile section.

This bit refers to adding a [Rule](https://auth0.com/docs/customize/rules) within your Auth0 dashboard. You can do so by navigating to Auth Pipeline → Rules - When you go to create a new rule you will want to choose the “Get email address from Twitter” rule template in the Enrich Profile section.

 ![Screen Shot 2022-06-28 at 5.06.57 PM](https://global.discourse-cdn.com/auth0/original/3X/6/3/63c1e1b720517a0244e6f2d4212ef8d87d8c67b4.png)

The subsequent steps refer to actions that need to be taken within your Twitter Developer account.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![yosuke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yosuke/32/33258_2.png) [@yosuke](https://community.auth0.com/u/yosuke)\
**Post date:** [June 29, 2022, 12:53am UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023/4 "2022-06-29T00:53:47Z")

</div>

Thank you for your response.

Sorry, please tell me one more thing.  
I have tried to set it up as you suggested.  
I did a Try Connection on Twitter.  
The following message was displayed.

I would like to know what settings I need to check.

Sorry for the busy time orz

 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/3/f36c5a95d48d8cdb32a0144316c7eb1decad01c1.png)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 29, 2022, 10:37pm UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023/6 "2022-06-29T22:37:04Z")

</div>

No problem @yosuke happy to help!

Did you follow the instructions below from the rule?

 ![Screen Shot 2022-06-29 at 3.31.15 PM](https://global.discourse-cdn.com/auth0/original/3X/5/5/5591f049e4dead8e418afa40376ed69b302e9a85.png)

The other thing you might want to check is that you have added your `TWITTER_CONSUMER_KEY` and `TWITTER_CONSUMER_SECRET_KEY` to the configuration object located just beneath the rules in your dashboard at Auth Pipeline → Rules:

 ![Screen Shot 2022-06-29 at 3.34.28 PM](https://global.discourse-cdn.com/auth0/original/3X/e/c/eca1c221ccf326bf8d82cc455f81761c52a451d9.png)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![yosuke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yosuke/32/33258_2.png) [@yosuke](https://community.auth0.com/u/yosuke)\
**Post date:** [July 1, 2022, 2:37am UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023/7 "2022-07-01T02:37:13Z")

</div>

Thank you very much.  
Thanks to you I have obtained an email address.

If I have any more questions, I will ask them.  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 1, 2022, 10:08pm UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023/8 "2022-07-01T22:08:29Z")

</div>

Wonderful! Good to know this is working for you now 😄

Happy to help!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 16, 2022, 10:09pm UTC](https://community.auth0.com/t/cant-log-in-on-twitter-why-no-email-returned/86023/9 "2022-07-16T22:09:01Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
