? ? Success

User tests: Successful: Unsuccessful:

avatar haydenyoung
haydenyoung
19 Nov 2015

There may be more issues with the OAuth1Client and classes using it as it is only the Twitter REST API (and in particular the JTwitterSearch class) that has thrown an exception (32 - Could not authenticate you). The problem is vague as it only results when hashtags or at symbols are used or when the query contains special characters such as space. It is assumed that the Twitter API is expecting an unescaped search string and so because #Joomla becomes %23Joomla and Twitter is expecting #Joomla, it determines that the baseString (a combination of the request details as a single string) is incorrect and so the authentication mechanism fails the connection.

Also note that any other classes which encode parameters to OAuth1Client may now not work because they need the parameters encoded prior to being used to create the OAuth signature.

avatar haydenyoung haydenyoung - open - 19 Nov 2015
avatar haydenyoung haydenyoung - change - 19 Nov 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Nov 2015
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 20 Nov 2015
Labels Added: ?
avatar haydenyoung
haydenyoung - comment - 20 Nov 2015

JLinkedin is using OAuth1Client; it is my understanding that Linkedin now uses OAuth2?

avatar zero-24 zero-24 - change - 25 Nov 2015
Labels
avatar zero-24 zero-24 - change - 25 Nov 2015
Category Libraries
avatar teccrow
teccrow - comment - 18 Feb 2016

i have tested this function with JTwitterSearch Class. The first query was "#smarthome" and the second was "demografie OR demografisch".

Both query was well.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar teccrow teccrow - test_item - 18 Feb 2016 - Tested successfully
avatar teccrow
teccrow - comment - 18 Feb 2016

I have tested this item :white_check_mark: successfully on bc5fe71

see my comment below


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar alikon
alikon - comment - 18 Feb 2016

please can you provide some more info about how to test ?
or a snippet of code etc...
i'm not so confortable with unit/system test :chicken:

avatar teccrow
teccrow - comment - 19 Feb 2016

okay, here is a snippet of code that i used:

 $oauth = new JTwitterOAuth();
 $oauth->setOption('consumer_key', $consumerKey);
 $oauth->setOption('consumer_secret', $consumerSecret);

 $token = array('key'=>$key, 'secret'=>$secret);
 $oauth->setToken($token);
 $obj = new JTwitter($oauth);

 $twitter = $this->authenticate();

 $twittersearch = $twitter->search;

 $search = $this->search; 
 $lang = $this->lang;
 $count = 100;
 $since_id = $this->since_id;

 // get the Query on Twitter
 $result = $twittersearch->search($search, $callback = null, $geocode = null, $lang, $locale = null, $result_type = null, $count, $until = null, $since_id, $max_id = 0, $entities = null);

for example a search string with '#'

 $search = "#smarthome";

with Joomla 3.4.8 have you an error "Could not authenticate you."

with this patch is the function well.

the same is by a search with 'OR', a combination from more as one search item.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar alikon alikon - test_item - 21 Feb 2016 - Tested successfully
avatar alikon
alikon - comment - 21 Feb 2016

I have tested this item :white_check_mark: successfully on bc5fe71

thx @teccrow for the spnippet


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar teccrow
teccrow - comment - 30 Mar 2016

why is this patch not in version 3.5?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar alikon
alikon - comment - 30 Mar 2016

We need 2 successful tests and then is up to maintainers to merge , we have only 1

avatar teccrow
teccrow - comment - 30 Mar 2016

Hm, you @alikon and i have tested, 1+1=2 or not?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar Kubik-Rubik Kubik-Rubik - change - 30 Mar 2016
Labels Added: ?
avatar Kubik-Rubik Kubik-Rubik - change - 30 Mar 2016
Milestone Added:
avatar alikon
alikon - comment - 30 Mar 2016

@teccrow I've missed your test, now is rtc and probably should go on 3.5.2

avatar joomla-cms-bot joomla-cms-bot - change - 30 Mar 2016
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 30 Mar 2016
Milestone Removed:
avatar Kubik-Rubik Kubik-Rubik - change - 30 Mar 2016
Status Pending Ready to Commit
Labels
avatar Kubik-Rubik Kubik-Rubik - change - 30 Mar 2016
Milestone Added:
avatar Kubik-Rubik Kubik-Rubik - change - 30 Mar 2016
Milestone Added:
avatar Kubik-Rubik Kubik-Rubik - change - 30 Mar 2016
Labels Added: ?
avatar teccrow
teccrow - comment - 12 Apr 2016

@Kubik-Rubik I wanted to check this point with "Joomla! 3.5.2-dev Development [ Unicorn ] 05-April-2016 22:45 GMT". But the problem is the same.

This point is already solved in this version?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar brianteeman
brianteeman - comment - 12 Apr 2016

It has not been merged yet - there are over 100 RTC issues waiting to be merged into staging and like this one they will be in the next release


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar rdeutz rdeutz - change - 12 Apr 2016
Status Ready to Commit Needs Review
Labels
avatar rdeutz
rdeutz - comment - 12 Apr 2016

After reading the comments it seems to me that we are not really know what it the right way "escaped or unescaped" so I will set the state to needs review


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8503.

avatar joomla-cms-bot joomla-cms-bot - change - 12 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 29 Apr 2016
Milestone Added:
avatar rdeutz rdeutz - change - 29 Apr 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar wilsonge
wilsonge - comment - 7 May 2016

This isn't backwards compatible. People currently using this class and using rawurlencode to encode their data properly before the request are now going to find their data requests fail because they are being double encoded. I'm therefore going to close this issue.

avatar wilsonge wilsonge - change - 7 May 2016
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2016-05-07 12:40:12
Closed_By wilsonge
avatar wilsonge wilsonge - close - 7 May 2016
avatar teccrow
teccrow - comment - 4 Jan 2017

hello,
i want to reopen this ticket, because i still this problem with twitter search api. I wrote on top on 19 february this problem.

If the search string a combination of several search terms, for example "joomla OR developer" then i have with Joomla 3.6.5 an error "Could not authenticate you." At the moment my solution is override the search.php in the folder "libraries/joomla/twitter/".

from Joomla row 50:

// Set query parameter.
$data['q'] = rawurlencode($query);

i change this in

// Set query parameter.
$data['q'] = $query;

then is the function well and the tweets flow. I think, that can not to be decoded the search string.

please discuss with me over this problem.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8503.
avatar zero-24
zero-24 - comment - 4 Jan 2017

hmm

rawurlencode result for that given $query is: joomla%20OR%20developer

and the twitter search works with that too https://twitter.com/search?q=joomla%20OR%20developer

The same code is used in the framework: https://github.com/joomla-framework/twitter-api/blob/master/src/Search.php#L50

And per Twitter API Doc it should be:

A UTF-8, URL-encoded search query of 500 characters maximum, including operators. Queries may additionally be limited by complexity.

https://dev.twitter.com/rest/reference/get/search/tweets

can you print out the $query (befor the call) and rawurlencode($query) with the actual query?

avatar teccrow
teccrow - comment - 4 Jan 2017

thats are my queries prints, these goes one after the other:

  • smarthome
  • demografie OR demografisch OR flüchtlinge
  • nanotechno OR graphen OR bionik
  • frauen beruf OR gleichberechtigung OR frauenquote
  • urbanisierung OR mobilität
  • bildung OR schule OR universität OR elerning OR gamifikation
  • arbeitswelt OR arbeitszeit OR rente
  • #industrie40 OR 3D Drucker
  • energiewende OR windkraft OR solar
  • #iot OR bigdata OR crowd
  • hekatron

here the rawurlencode versions:

  • smarthome
  • demografie%20OR%20demografisch%20OR%20fl%C3%BCchtlinge
  • nanotechno%20OR%20graphen%20OR%20bionik
  • frauen%20beruf%20OR%20gleichberechtigung%20OR%20frauenquote
  • urbanisierung%20OR%20mobilit%C3%A4t
  • bildung%20OR%20schule%20OR%20universit%C3%A4t%20OR%20elerning%20OR%20gamifikation
  • arbeitswelt%20OR%20arbeitszeit%20OR%20rente
  • %23industrie40%20OR%203D%20Drucker
  • energiewende%20OR%20windkraft%20OR%20solar
  • %23iot%20OR%20bigdata%20OR%20crowd
  • hekatron

Please use the Joomla Twitter Search Object and not the Twitter Search Website for testing.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8503.

avatar teccrow
teccrow - comment - 8 Jan 2017

and now???

please, can someone verify this bug and then open this ticket?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8503.

Add a Comment

Login with GitHub to post a comment