Issue 176 in python-twitter: PostUpdate (still) returns IncorrectSignature (continuation of issue #157)

22 views
Skip to first unread message

python-...@googlecode.com

unread,
Nov 12, 2010, 12:18:05 PM11/12/10
to python-twi...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 176 by ocelma: PostUpdate (still) returns IncorrectSignature
(continuation of issue #157)
http://code.google.com/p/python-twitter/issues/detail?id=176

- What steps will reproduce the problem?
1. api = twitter.Api(...)
2. message ='Just testing OAuth...please work! ;-('
3. status = api.PostUpdate(message)

- What is the expected output?
The user message has been correctly posted

- What do you see instead?
Error: twitter.TwitterError: Incorrect signature

- What version of the product are you using?
0.9-devel
(I just did an hg clone https://python-twitter.googlecode.com/hg/
python-twitter)

- On what operating system?
Ubuntu 10.04

- Please provide any additional information below.
Please find attached file with a python script that reproduces this problem

Attachments:
test_post_update.py 428 bytes

python-...@googlecode.com

unread,
Nov 12, 2010, 2:31:36 PM11/12/10
to python-twi...@googlegroups.com

Comment #1 on issue 176 by adam.aviv: PostUpdate (still) returns
IncorrectSignature (continuation of issue #157)
http://code.google.com/p/python-twitter/issues/detail?id=176

Have you tied regenerating your access tokens? Also, check that your
application is still listed.

I've also found that if your clock skew is too far off, this will mess up
the nonce, and thus the signature.

ocelma

unread,
Nov 13, 2010, 11:32:26 AM11/13/10
to python-twitter


On Nov 12, 8:31 pm, python-twit...@googlecode.com wrote:
> Comment #1 on issue 176 by adam.aviv: PostUpdate (still) returns  
> IncorrectSignature (continuation of issue #157)http://code.google.com/p/python-twitter/issues/detail?id=176
>
> Have you tied regenerating your access tokens?

I just did that, using the get_access_token.py script:

====
Requesting temp token from Twitter

Please visit this Twitter page and retrieve the pincode to be used
in the next step to obtaining an Authentication Token:

https://api.twitter.com/oauth/authorize?oauth_token=B9zeRILjowPA5S7bCbX7SJUfYHczMNgRxEqQMeDQNQ

Pincode? **********

Generating and signing request for an access token

Your Twitter Access Token key: ****
Access Token secret: ****
====

> Also, check that your  
> application is still listed.

Yes, it is.
These are the settings:

====
App type: client
Access: read & write
Use twitter for login: [no]
====

The app ( http://twitter.com/groovify ) is just python script that
scans the spotify/last.fm/grooveshark links in the tweets, and replies
that user with a link that has playlist generated based on that (seed)
song.
More info here:
http://denoiserthebetter.posterous.com/groovify-your-music-tweets

And here's an example:
http://ella.bmat.me/groovify?id=515c13bd-3eea-4f4f-a6e6-9055d3ca7654&artist=Ryan+Adams&track=Wonderwall

That's it!

Any help would be very much appreciated.

Thanks!

Oscar

ocelma

unread,
Nov 13, 2010, 12:16:22 PM11/13/10
to python-twitter
BTW, in the issue #176 I attached some code to test it. and I paste
it here as well.
So, can anyone please try this out and let me know whether it works
fine for you, or not...
Thanks!

====
import twitter

USER = 'YOUR_USERNAME'
PASSWD = '****'
CONSUMER_KEY = '****' # generated via get_access_token.py
CONSUMER_SECRET = '****' # generated via get_access_token.py

api = twitter.Api(consumer_key=USER, consumer_secret=PASSWD,
access_token_key=CONSUMER_KEY, access_token_secret=CONSUMER_SECRET,
debugHTTP=True)

print api.GetUserTimeline()[0] #This works fine...

message ='Just testing OAuth...please work! ;-
('
status = api.PostUpdate(message)
#Error: twitter.TwitterError: Incorrect signature
====

On Nov 13, 5:32 pm, ocelma <oce...@gmail.com> wrote:
> On Nov 12, 8:31 pm, python-twit...@googlecode.com wrote:
>
> > Comment #1 on issue 176 by adam.aviv: PostUpdate (still) returns  
> > IncorrectSignature (continuation of issue #157)http://code.google.com/p/python-twitter/issues/detail?id=176
>
> > Have you tied regenerating your access tokens?
>
> I just did that, using the get_access_token.py script:
>
> ====
> Requesting temp token from Twitter
>
> Please visit this Twitter page and retrieve the pincode to be used
> in the next step to obtaining an Authentication Token:
>
> https://api.twitter.com/oauth/authorize?oauth_token=B9zeRILjowPA5S7bC...
>
> Pincode? **********
>
> Generating and signing request for an access token
>
> Your Twitter Access Token key: ****
> Access Token secret: ****
> ====
>
> > Also, check that your  
> > application is still listed.
>
> Yes, it is.
> These are the settings:
>
> ====
> App type: client
> Access: read & write
> Use twitter for login: [no]
> ====
>
> The app (http://twitter.com/groovify) is just python script that
> scans the spotify/last.fm/grooveshark links in the tweets, and replies
> that user with a link that has playlist generated based on that (seed)
> song.
> More info here:http://denoiserthebetter.posterous.com/groovify-your-music-tweets
>
> And here's an example:http://ella.bmat.me/groovify?id=515c13bd-3eea-4f4f-a6e6-9055d3ca7654&...

bear

unread,
Nov 13, 2010, 3:35:53 PM11/13/10
to python-...@googlegroups.com
On Sat, Nov 13, 2010 at 12:16, ocelma <oce...@gmail.com> wrote:
> BTW,  in the issue #176 I attached some code to test it. and I paste
> it here as well.
> So, can anyone please try this out and let me know whether it works
> fine for you, or not...
> Thanks!
>
> ====
> import twitter
>
> USER = 'YOUR_USERNAME'
> PASSWD = '****'
> CONSUMER_KEY = '****' # generated via get_access_token.py
> CONSUMER_SECRET = '****' # generated via get_access_token.py
>
> api = twitter.Api(consumer_key=USER, consumer_secret=PASSWD,
> access_token_key=CONSUMER_KEY, access_token_secret=CONSUMER_SECRET,
> debugHTTP=True)

The values for the parameters of consumer_key and consumer_secret are
not your web-based twitter userid and password, but rather the values
you are assigned by twitter when you created the Application (and also
what you had to give inside of get_access_token.py.)

I would change your code to read:

import twitter

CONSUMER_KEY = 'value_of_your_apps_consumer_key'
CONSUMER_SECRET = 'value_of_your_apps_consumer_secret'
ACCESS_KEY = '****' # generated via get_access_token.py
ACCESS_SECRET = '****' # generated via get_access_token.py

api = twitter.Api(consumer_key=CONSUMER_KEY, consumer_secret=CONSUMER_SECRET,
access_token_key=ACCESS_KEY, access_token_secret=ACCESS_SECRET,
debugHTTP=True)

> --
> You received this message because you are subscribed to the Google Groups "python-twitter" group.
> To post to this group, send email to python-...@googlegroups.com.
> To unsubscribe from this group, send email to python-twitte...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/python-twitter?hl=en.
>
>

--
Bear

be...@xmpp.org (email)
bea...@gmail.com (xmpp, email)
be...@code-bear.com (xmpp, email)
http://code-bear.com/bearlog (weblog)

PGP Fingerprint = 9996 719F 973D B11B E111  D770 9331 E822 40B3 CD29

ocelma

unread,
Nov 13, 2010, 10:04:42 PM11/13/10
to python-twitter
Hi,

On Nov 13, 9:35 pm, bear <bea...@gmail.com> wrote:
> The values for the parameters of consumer_key and consumer_secret are
> not your web-based twitter userid and password, but rather the values
> you are assigned by twitter when you created the Application (and also
> what you had to give inside of get_access_token.py.)

...this (plus another problem with the app config) was the (stupid)
problem. My fault!
Now it works again.

Thanks!

Oscar

python-...@googlecode.com

unread,
Nov 14, 2010, 12:57:56 AM11/14/10
to python-twi...@googlegroups.com
Updates:
Status: Invalid

Comment #2 on issue 176 by bear42: PostUpdate (still) returns

IncorrectSignature (continuation of issue #157)
http://code.google.com/p/python-twitter/issues/detail?id=176

marking as closed as it was solved in the discussion group

Reply all
Reply to author
Forward
0 new messages