User tests: Successful: Unsuccessful:
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.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Labels |
Added:
?
|
Labels |
Category | ⇒ | Libraries |
i have tested this function with JTwitterSearch Class. The first query was "#smarthome" and the second was "demografie OR demografisch".
Both query was well.
I have tested this item successfully on bc5fe71
see my comment below
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
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.
I have tested this item successfully on bc5fe71
thx @teccrow for the spnippet
why is this patch not in version 3.5?
We need 2 successful tests and then is up to maintainers to merge , we have only 1
Hm, you @alikon and i have tested, 1+1=2 or not?
Labels |
Added:
?
|
Milestone |
Added: |
Labels |
Removed:
?
|
Milestone |
Removed: |
Status | Pending | ⇒ | Ready to Commit |
Labels |
Milestone |
Added: |
Milestone |
Added: |
Labels |
Added:
?
|
@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?
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
Status | Ready to Commit | ⇒ | Needs Review |
Labels |
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
Labels |
Removed:
?
|
Milestone |
Added: |
Milestone |
Removed: |
Milestone |
Removed: |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
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.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-07 12:40:12 |
Closed_By | ⇒ | wilsonge |
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.
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?
thats are my queries prints, these goes one after the other:
here the rawurlencode versions:
Please use the Joomla Twitter Search Object and not the Twitter Search Website for testing.
and now???
please, can someone verify this bug and then open this ticket?
JLinkedin is using OAuth1Client; it is my understanding that Linkedin now uses OAuth2?