So I wrote some django unit tests for an app that uses OAuth and I ran
into this strange issue when attempting to set my verifier:
On my local dev machine it likes me to set my verifier like so:
token.set_verifier(verifier)
On my production machine it like me to set my verifier like so:
oauth_request = oauth.OAuthRequest.from_consumer_and_token(
self.apicall.consumer,
token=token,
verifier=verifier,
http_url=self.apicall.access_token_url
)
Both my dev machine and production machine can't agree on which way
they would like to set the verifier. If I perform both methods, then
both dev and production seem to be happy! Why is this? Could I have a
slightly different version of oauth on both the machines?
Here is the full snippet of code that sets the verifier and makes the
access token request:
verifier = "zNd4KsqnL9"
# Dev likes it this way
token.set_verifier(verifier)
oauth_request = oauth.OAuthRequest.from_consumer_and_token(
self.apicall.consumer,
token=token,
# prod likes it this way
verifier=verifier,
http_url=self.apicall.access_token_url
)
oauth_request.sign_request(self.apicall.signature_method,
self.apicall.consumer, token
)
params = oauth_request.parameters
response = self.client.get(self.apicall.access_token_url,
params)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.