On Tue, 2009-01-13 at 18:54 -0800, Chris wrote:
> Hello,
> 
> I have been using django-oauth and am getting the below error using
> this code http://dpaste.com/108808/
> 
> I get this when running the dpaste code in the python shell.
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "<stdin>", line 7, in get_unauthorised_request_token
>   File "/usr/lib/python2.5/site-packages/oauth.py", line 70, in
> from_string
>     key = params['oauth_token'][0]
> KeyError: 'oauth_token'
> 
> so when I make a request to /oauth/request_token/, it initializes the
> oauth classes and methods using:
> oauth_server, oauth_request = initialize_server_request(request)
> 
> next, this call which seems to be where it breaks:
> token = oauth_server.fetch_request_token(oauth_request)
> 
> so the oauth_request does not have the oauth_token key (as the error
> describes) which after traversing through the oauth library and the
> django-oauth app I do not see where an oauth_token is being generated
> and added to the oauth_request.

It looks like the server you're talking to might not be returning the
right data. The data you're getting back from the fetch_response() call
should contain information that can be passed to from_string(). Your
fetch_response() isn't too different from the sample client
implementation at [1], so you might want to check out the minor
difference there, to verify you've omitted it intentionally. Then check
out whatever is printed in fetch_response() to see why it isn't what
you're expecting (you're printing that information out already).

[1] http://oauth.googlecode.com/svn/code/python/oauth/example/client.py

If I understand the code correctly, the key that from_string() is
looking for is the token and secret that the oauth server returns to you
(the client) that is your (temporary) authorisation to access some data
on the server. So it's server-side generated.

Regards,
Malcolm


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

Reply via email to