-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oauth issue #34
Comments
Finally i was able to get the tests to work... ====
Ran 28 tests in 0.064s
OK
=== but when i try to call import pytumblr
# Authenticate via OAuth
client = pytumblr.TumblrRestClient(
'correctvalueentered',
'correctvalueentered',
'correctvalueentered',
'correctvalueentered'
)
# Make the request
client.info() # Grabs the current user information above calls give blank output... pip listdistribute (0.6.49) |
That call alone won't make any output - you need to do something with the results of that call |
client.info() i thought it is supposed to spit out the connected client information... infact i tried to change the credentials to see if it works...it didn't through any error...and showed not output message still... i was expecting out is spitted out as shown in this url... |
you need to put the result of print client.info() |
thanks..my bad.... now i get this blank info...even though i have given correct credentials... {u'meta': {u'status': 401, u'msg': u'Not Authorized'}, u'response': []} |
Hmm - that's definitely indicative of incorrect credentials (or possibly given in the wrong order?) |
Entered in this order... Consumer Key |
And they are the exact values (with no extra spaces) that you get from a fresh, working session on |
are your calls running successfully in the API console? You may need to open a new browser session and reauthenticate |
Yes - it needs to be accepted every time you authenticate |
the call i am making is from linux machine...from command line.. basically i am not calling from the web page...will the api work? i made a tinfo.py and calling from shell python tinfo.py is it supposed to work from command line like this? |
Of course - that's what the API is for. I'm asking if the example calls with the same credentials are working properly from the tumblr API console website (I'm trying to verify that the credentials you have are valid) |
it should be...as the api credentials i have taken from tumblr website... only thing is callback url that i have mentioned in the api i didn't configured it...would that be any cause of this issue? when i clicked on the explore api, it gives authentication message with prompt like shown and all examples give correct results in the tumblr console...on the top right i see api keys buttons..i took those four values from there and pasted into the python file... |
nope the callback URL won't matter. from pytumblr import TumblrRestClient
client = TumblrRestClient(
'consumer_key',
'consumer_secret',
'token',
'token_secret'
)
print client.info()['user']['name'] |
i am using latest Python 2.7.6 i even kept callback url active...still same issue.. |
from pytumblr import TumblrRestClient
# Authenticate via OAuth
client = TumblrRestClient(
'Somekeyvalue111111111111111111111',
'Somekeyvalue222222222222222222',
'Somekeyvalue333333333333333333',
'Somekeyvalue444444444444444444'
)
print client.info() this is my code. |
python 2.7.6 should be all good - are all four of your keys the same length? |
yes...all 4 keys same length also is it anything to do with oauth2? how can i enable debug call trace to see what is going on... |
i just registered another account with tumbler and signed up new api app and changed the keys...still the result same... probably i will try from different machine in my next run |
i just tried another machine...still same error... is there any other way it can take the properties from? ~/.tumblr is not created for me why? |
when i run interactive-console.py it gives below message and exits # python tests/test_pytumblr.py
............................
----------------------------------------------------------------------
Ran 28 tests in 0.079s
OK No tokens are stored in ~/.tumblr as mentioned in the README file... also i changed the values of keys in the tumblr_credentials.json and kept some dummy values still it says the same result as if it is successful...looks like something fundamentally missing which i can't figure out... |
python setup.py test when i ran above command i got below error...
|
got this error in second machine |
i tried it with php application as well...i can access api calls which doesn't need authentication such as avatar etc. but i am not able to access anything which needs API Key or oAUTH based authentication privileges... |
You must be using the wrong tokens, or in the wrong order |
On my machine with python 2.7.5 that code prints out 'netzeta-kota' - it's odd that you're not getting an import error. You should delete that app now (really) |
that is dummy app...i will delete it once finished testing... why we need to get import error? it is amazon AWS EC2 instance, installed latest python and installed packages through pip |
installed packages? are you running |
earlier i have tried it from downloaded package... now i just reinstalled pytumblr using pip install pytumblr and then launched the script using #python script.py still i got same issue... |
can you provide what are the versions of python packages? pip list[root@aws.zetaclouds.com .softroot]# pip list |
Python 2.7.6 is my python version |
do we need to open any ports in firewall? |
BTW, the token that i used are the tokens from the tumblr site, as i shared in the snapshot. But in the Readme file i see below line...This client comes with a nice interactive console to run you through the OAuth process, grab your tokens (and store them for future use).does that mean i need to use tokens generated from the interactive console? but you mentioned you were able to run my code with no problem... now i have 2 questions... what are the required modules and their versions? (i shared my pip list, please check ) will there be any firewall block oauth? also the feedback url that i gave in the configuring the app can that be some dummy url? |
i have got interactive console working by copying the ~/.tumblr with the keys I executed the client.info() from there and it still gave the same error... (InteractiveConsole)
|
The console OAuth process and the api.tumblr.com process are exactly the same thing - all they do is walk you through the same process in different ways. Once you have the keys there is no difference. Now, to answer your 3 questions: what are the required modules and their versions? (i shared my pip list, please check )pip install pytumblr will install the packages you need will there be any firewall block oauth?no - but the machine needs to be able to call out to other hosts - which I think is fine because also the feedback url that i gave in the configuring the app can that be some dummy url?you don't need to supply any at all |
I tried uninstalling and we installing several times, on 2 different machines on amazon ec2, the behaviour is the same.....I am suspecting it is oauth issue.... Can you please give your Pip list Output so I can compare packages and versions.…... |
i used some other program, got this error... i got 401 error with oauth time stamp issue...do you know how to fix this kind of issue? most likely this is causing oauth to fail... raise TumblpyAuthError('Seems something couldn't be verified with your OAuth junk. Error: %s, Message: %s' % (response.status_code, response.content)) |
If your system clock not set to a real time? That is meaningful. |
what you mean by not set to real time... when i type date it gives correct date...but i still get lag of 6 hours On Sat, Jan 25, 2014 at 6:58 PM, John Crepezzi notifications@github.comwrote:
|
still couldn't find solution why tumblr api fails even after date command on my server gives correct time...what you meant by real time setting of the time? is your system configured with UTC zone? |
Not the time zone, the actual time. IE: from your error: oauth_timestamp is too far away; we believe it is now 1390667052, you sent 1390645441, 21611 seconds away That's 6 hours behind the timestamp that should have been received by the server. |
the thing is the time seen in the server is exactly same as my local On Thu, Jan 30, 2014 at 6:18 AM, John Crepezzi notifications@github.comwrote:
|
What output do you get when running: |
date +%s1391094277 On Thu, Jan 30, 2014 at 3:03 PM, John Crepezzi notifications@github.comwrote:
|
That corresponds to: |
how do we fix it? On Thu, Jan 30, 2014 at 3:06 PM, John Crepezzi notifications@github.comwrote:
|
Ideally you're going to set up to synchronize with an NTP server somewhere: |
finally....it works now...i was able to access tumblr server... thanks for your help... Note: code didn't give appropriate error message, i have to find the time On Thu, Jan 30, 2014 at 3:16 PM, John Crepezzi notifications@github.comwrote:
|
No problem - thank you! |
thanks closing the issue now... |
Hello,
I received this error when i launched
python interactive_console.py
I did give correct "consumer key" and "consumer secret" when prompted
I am using latest python and installed required modules it requested using
python setup.py install
Python 2.7.6
Appreciate your help...
Traceback (most recent call last):
File "interactive_console.py", line 65, in
tokens = new_oauth(yaml_path)
File "interactive_console.py", line 32, in new_oauth
print '\nPlease go here and authorize:\n%s?oauth_token=%s' % (authorize_url, request_token['oauth_token'][0])
KeyError: 'oauth_token'
The text was updated successfully, but these errors were encountered: