Hi
Using Twitter Pull 7.x-2.0-alpha3 with Twitter 7.x-5.11.
I have added an authenticated account, and a non-authenticated 'pull only' account.
Twitter Pull will display tweets from the authenticated account name no problem. But if I try to use the non-authenticated account name (or a Twitter account that has not been added via Twitter module), nothing displays and these errors are reported:
- Could not retrieve data from Twitter. Forbidden
- Twitter Pull is using an Unauthenticated request to twitter apis. Download, enable and configure the twitter module to allow for authenticated requests
- Twitter module is not properly configured and could not be used.
I am aware of previous issues regarding changes to Twitter API, but I'm using latest, fixed code. Twitter module is properly configured afaics; if I set it to pull tweets and run cron, it pulls tweets from both accounts. But this shouldn't be necessary for Twitter Pull?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#8 | 2658176-8-twitter-pull-twitter-pull-auth.patch | 501 bytes | fengtan |
#7 | 2658176-twitter-pull-auth.patch | 682 bytes | carloswwe |
#6 | 2658176-twitter-pull-get-first-oauth.patch | 913 bytes | Brian Milea |
Screenshot from 2016-01-28 11:31:43.png | 24.86 KB | Jason Dean |
Comments
Comment #2
Jason Dean CreditAttribution: Jason Dean commentedAfter some experimentation, I found that reverting Twitter module to 7.x-5.8 and Twitter Pull module to 7.x-2.0-alpha2 did the trick.
Twitter Pull is now pulling tweets for any account correctly, with only a single authenticated account added to the Twitter module config.
Comment #3
caspervoogt CreditAttribution: caspervoogt at Plethora commentedI have been experiencing the same thing, Jason. I also reverted back. I did first try to re-authenticate, in case that had anything to do with it. That didn't help. I don't why it thinks I am unauthenticated now.
Comment #4
bgilhome CreditAttribution: bgilhome commentedThis comes from the last block in twitter_connect() (line 44 of twitter.inc in twitter module):
If the oauth_token/secret are NULL (ie. for unauthenticated users), this returns FALSE.
So twitter_puller::twitter_get_items() logs a watchdog entry and returns FALSE (line 178 of twitter_pull.class.inc).
What should be done here? Use array_key_exists() instead of isset() in twitter_connect()?
Comment #5
Brian Milea CreditAttribution: Brian Milea commentedI may have an option with Twitter module 7.x-5.11 and Twitter Pull module 7.x-2.0-alpha3.
Line 177 of twitter_pull.class.inc uses the twitter_connect function to check that Twitter module has an authenticated OAuth token.
$twitter = twitter_connect($twitter_account, $access_global);
. However, the variables passed into the function assume that the account being pulled is an authorized account, which may not necessarily be the case.The twitter_connect function already has the necessary logic in twitter_load_authenticated_accounts to get OAuth credentials from an authenticated user so my proposal is to pass no account into the function
$twitter = twitter_connect(NULL, $access_global, TRUE);
. If Twitter is properly configured, twitter_connect will return the OAuth token for the authenticated account. If no authenticated user exists, twitter_connect returns false, as it did previously, retaining the original intention of the function call.Comment #6
Brian Milea CreditAttribution: Brian Milea commentedTest patch for aforementioned solution.
Comment #7
carloswwe CreditAttribution: carloswwe commentedThis patch will only use Authentication Keys when needed. Otherwise it call the twiiter_connect function as it previously did,
Comment #8
fengtanWe are also experiencing this issue when upgrading from twitter-7.x-5.8 to twitter-7.x-5.9.
Confirmed that downgrading to twitter-7.x-5.8 resolves the problem.
Patch #6 works for me. Patch #7 does not seem to work.
It looks like twitter_connect() was changed by #2559239: Embedded tweets aren't working.
Maybe we could keep the ability to connect to authenticated twitter accounts.
Comment #9
hey_germanoThe patch in #6 works here, with Twitter 7.x-5.10.
Comment #10
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedPatch #8 solves the issue in 7.x-2.0-alpha3 for me.
Comment #11
DamienMcKennaThis appears to make it work fine now.