# Error using custom social login with twitter

**URL:** <https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403>\
**Category:** Get Help\
**Tags:** other-built-in-social-connections, connections\
**Created:** [December 28, 2024, 7:45pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403 "2024-12-28T19:45:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nevosus](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nevosus](https://community.auth0.com/u/nevosus)\
**Post date:** [December 28, 2024, 7:45pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/1 "2024-12-28T19:45:41Z")

</div>

I’m trying to set up a custom oauth2 social login with Twitter/X so I can specify the scope. I’ve followed the instructions on setting up the ready-made integration from the market place and it works fine with that integration.

I set up the custom integration following the instructions in [Custom Social Connection with Twitter / X](https://community.auth0.com/t/custom-social-connection-with-twitter-x/164806) , but I get an error after I authorise the app(/user) in twitter.

The url that shows the error is `http://localhost:3000/?error=invalid_request&error_description=Missing%20valid%20authorization%20header&state=dy5QSktoYjZRNldnaEhrUEpXUVIxVFNZX0hEVDY1bzNzTzJmZ0VocjV5RQ%3D%3D` and the sample app shows the message `Oops... Missing valid authorization header`.

To test this I created a new application of type Single Page Application, using the React sample application. I configured the React sample application with the domain, client id and audience. The Auth0 app only has the custom twitter connection enabled (and the username-password-authentication db connection), the connection was configured as described in the knowledge base article.

> The Authorization URL should be set to: `https://twitter.com/i/oauth2/authorize?&code_challenge=challenge&code_challenge_method=plain` and the Token URL should be set to `https://api.x.com/2/oauth2/token?code_verifier=challenge`

On Twitter/x, the application configured as a ‘Web App, Automated App or Bot (confidential client)’.

Any ideas what I could be missing? Or could it be that the knowledge base article I linked above is missing a step?

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [December 30, 2024, 4:53pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/3 "2024-12-30T16:53:28Z")

</div>

Hi @nevosus,

I understand you are getting `missing valid authorization header` errors when configuring your custom social login Twitter/X connection. Please allow me some time to look into this and reproduce it, and I will get back to you as soon as I can!

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![nevosus](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nevosus](https://community.auth0.com/u/nevosus)\
**Post date:** [December 31, 2024, 4:03pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/4 "2024-12-31T16:03:47Z")

</div>

Thanks a lot Mary Beth! Please let me know if you need any more information.

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 6, 2025, 7:39pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/5 "2025-01-06T19:39:53Z")

</div>

Hi @nevosus,

Thank you for your patience! I’ve been looking into this and found a colleague who has this set up on a tenant of theirs. Can you try setting your “Type of App” on the Twitter side to a Native app? Additionally, could you share a screenshot or DM me a screenshot of the Twitter configuration?

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![nevosus](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nevosus](https://community.auth0.com/u/nevosus)\
**Post date:** [January 6, 2025, 8:26pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/6 "2025-01-06T20:26:35Z")

</div>

Thanks for investigating this @marybeth.hunter !

When I changed the type of app to native in Twitter it started working. Well, I did have a small error on the script that fetches the profile in which I wasn’t setting the `user_id`, but the error I got was different and clear of what was missing.

After I fixed that error, I reverted the application type in Twitter back to _Web App […]_ and the same error showed up (_Missing valid authorization header_). Between tests I made sure that the user in auth0 was deleted and the application access in twitter was revoked for the user.

I’ll DM you a screen shot of the twitter configuration.

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 6, 2025, 10:58pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/7 "2025-01-06T22:58:31Z")

</div>

Hi @nevosus,

Thank you for your reply and DM with the Twitter config!

I confirmed with my teammate that this only works for him with the app type set to Native in the Twitter settings. If you’ve resolved the other error, could you change it back to Native and go from there perhaps?

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![nevosus](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nevosus](https://community.auth0.com/u/nevosus)\
**Post date:** [January 7, 2025, 10:35am UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/8 "2025-01-07T10:35:23Z")

</div>

Setting it to an native app should be ok for what we are building.

Thanks a lot for your help @marybeth.hunter !

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 7, 2025, 2:22pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/9 "2025-01-07T14:22:30Z")

</div>

Hi @nevosus,

Awesome!! Have a great day!

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 21, 2025, 2:22pm UTC](https://community.auth0.com/t/error-using-custom-social-login-with-twitter/166403/10 "2025-01-21T14:22:46Z")

</div>

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