Twitter integration not working

Sim

Well-known member
After a report from a user that they couldn't log in via Twitter, I confirmed I was having the same difficulty.

I checked my Twitter app settings and tried resetting the keys, but still getting the error. It also fails the Tools > Test Twitter Integration test.

This is happening on multiple sites (v 1.5.19 & 1.5.21).

Error message is as follows:

Whoa there!
The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake.​
 

Divvens

Well-known member
The changes to callback links mentioned above helped us sort the integration problem, people can register new accounts & log-in via existing connected accounts, however when you go to /external-accounts (1.x) and try to connect to Twitter, it gets you back to the board and tries to register a new account resulting in an error.

Is there any other callback that should be added to make sure adding an external account doesn't try to create a new account but actually connect to the existing account?

Screenshot for reference (when you try to integrate a Twitter account to an existing forum account)
Capture.PNG
 

ibrian

Well-known member
I've had this problem reported now, too, for XF2:


1529299810929-png.178139


For the people having issues, what do you have your callback URLs set as?

I tried to find Twitter callback settings in my XF admin panel, but all I find is an API key, Consumer Key, and Consumer Secret.
 

ibrian

Well-known member
The callback URL is set to http://www.sffchronicles.com/connected_account.php, but the error is still there. Did I get the callback URL wrong??

Oops! We ran into some problems.
An error occurred while connecting with Twitter. Error: <?xml version="1.0" encoding="UTF-8"?><errors><error code="415">Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings</error></errors>
 

Divvens

Well-known member
The changes to callback links mentioned above helped us sort the integration problem, people can register new accounts & log-in via existing connected accounts, however when you go to /external-accounts (1.x) and try to connect to Twitter, it gets you back to the board and tries to register a new account resulting in an error.

Is there any other callback that should be added to make sure adding an external account doesn't try to create a new account but actually connect to the existing account?

Screenshot for reference (when you try to integrate a Twitter account to an existing forum account)
View attachment 180395
Has this been fixed in 1.5.22 or is this still an issue?
 

Hristo Avramov

Active member
I just upgraded from xenforo 1 to 2 and I got this error when testing the twitter integration. What does it mean, how can I fix this?
EDIT: It was my mistake. I needed to whitelist in the twitter application this url.
site.com/connected_account.php

Code:
An error occurred while connecting with Twitter. Error: <?xml version="1.0" encoding="UTF-8"?><errors><error code="415">Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings</error></errors>
 
Last edited:

colcar

Active member
Was there ever a fix for this for Xenforo 1? Test Twitter integration suddenly stopped working, just gives me the "The request token for this page is invalid. It may have already been used, or expired because it is too old." error every time.

Tried all kinds of settings in the Twitter app settings, renewed the keys, tried different Callback URL's, tried different browsers and devices, and still no joy.

Thoroughly sick and tired of trying to fix something that was once so simple and now is a massive pain.
 

snoopy5

Well-known member
I need also a solution for XF1.5.24

What is the current status quo on this?

If I add a second callback URL like https://mydomain.com/admin.php?tools/test-twitter , I get an alert below it that Query parameters are not allowed.

The test tool within XF/ACP does not work.

Whoa there!
The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake.

So what now´?
 

snoopy5

Well-known member
update:

Twitter changed a few thing last summer. Add as a second URL yourboardurl/admin.php


You neither can create new apps all the sudden. You have to apply first for a develper account and that seems to take ages. I applied 2 days ago and have not heard anything yet.

The third issue are external accounts. I managed to pass all tests with XF/ACP, but whe I try to register with a testtwitter account, it shows me a link to an externalaccount. I have no solution yet for this.

To associate with an existing account, you must first log into that account and then start the association via the external accounts area.

What is the point of a registration with a Twitter account, if everything has to be entered newly like someone without a Twitter account? Where is the benefit for the user?
 

snoopy5

Well-known member
update:

I have created in one of my Twitter developper accounts now different apps for different XF forums of mine.

Each forum with its app has a unique Name, image, API and a unique API secret key. This is how Twitter offers it.

different_twitter_apps_inone_developer_account.jpg

But as soon as I make the test in XF/ACP/tools Twitter test, it connects with the wrong app name. It only takes the app name of the developper account, although the API used in XF is from the other forum.

I tested this now only with XF 1.5.24, but I guess tzhe way how XF works it is the same problem with XF2.1. Can somebody confirm this behaviour for XF2.1x?

How can I fix this?


Addendum:

When I go with a different browser on that forum and try to register/login with Twitter, it shows me nevertheless the correct forumname. So it seems to be only a mismatch of what I see in ACP and what a users see on the front?
 
Last edited:
Top