Getting rid of OAUTH_CALLBACK? #59

Closed
opened 2012-02-24 09:40:15 -08:00 by michaelhelmick · 5 comments
michaelhelmick commented 2012-02-24 09:40:15 -08:00 (Migrated from github.com)

So, you can't specify your oauth_callback in the request for a token; it must be done in the Twitter application at https://dev.twitter.com

Should we get rid of this whole logic?:

# Try and gauge the old OAuth2 library spec. Versions 1.5 and greater no longer have the callback
# url as part of the request object; older versions we need to patch for Python 2.5... ugh. ;P
OAUTH_CALLBACK_IN_URL = False
OAUTH_LIB_SUPPORTS_CALLBACK = False
if not hasattr(oauth, '_version') or float(oauth._version.manual_verstr) <= 1.4:
    OAUTH_CLIENT_INSPECTION = inspect.getargspec(oauth.Client.request)
    try:
        OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in OAUTH_CLIENT_INSPECTION.args
    except AttributeError:
        # Python 2.5 doesn't return named tuples, so don't look for an args section specifically.
        OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in OAUTH_CLIENT_INSPECTION
else:
    OAUTH_CALLBACK_IN_URL = True

And any places in get_authentication_tokens() where it refs the callback url?

So, you can't specify your oauth_callback in the request for a token; it must be done in the Twitter application at https://dev.twitter.com Should we get rid of this whole logic?: ``` python # Try and gauge the old OAuth2 library spec. Versions 1.5 and greater no longer have the callback # url as part of the request object; older versions we need to patch for Python 2.5... ugh. ;P OAUTH_CALLBACK_IN_URL = False OAUTH_LIB_SUPPORTS_CALLBACK = False if not hasattr(oauth, '_version') or float(oauth._version.manual_verstr) <= 1.4: OAUTH_CLIENT_INSPECTION = inspect.getargspec(oauth.Client.request) try: OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in OAUTH_CLIENT_INSPECTION.args except AttributeError: # Python 2.5 doesn't return named tuples, so don't look for an args section specifically. OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in OAUTH_CLIENT_INSPECTION else: OAUTH_CALLBACK_IN_URL = True ``` And any places in get_authentication_tokens() where it refs the callback url?
ryanmcgrath commented 2012-03-03 16:54:14 -08:00 (Migrated from github.com)

Mmm, so I'm not sure we wanna take this out just yet. Twitter actually does still respect this parameter (to my knowledge), but upon researching it there's been a change somewhere down the line.

http://stackoverflow.com/questions/2940528/twitter-oauth-callback-parameter-being-ignored/3351724#3351724

It's a matter of how it's sent over, it seems. I think we should endeavor to fix this issue, instead of just ripping it out completely - after all, people requested/patched it in the first place for a reason. ;)

Mmm, so I'm not sure we wanna take this out just yet. Twitter actually _does_ still respect this parameter (to my knowledge), but upon researching it there's been a change somewhere down the line. http://stackoverflow.com/questions/2940528/twitter-oauth-callback-parameter-being-ignored/3351724#3351724 It's a matter of how it's sent over, it seems. I think we should endeavor to fix this issue, instead of just ripping it out completely - after all, people requested/patched it in the first place for a reason. ;)
michaelhelmick commented 2012-03-03 17:48:58 -08:00 (Migrated from github.com)

I tried to use my own callback_url and it still redirected me to my apps redirect URL.

Sent from my iPhone

On Mar 3, 2012, at 7:54 PM, Ryan McGrathreply@reply.github.com wrote:

Mmm, so I'm not sure we wanna take this out just yet. Twitter actually does still respect this parameter (to my knowledge), but upon researching it there's been a change somewhere down the line.

http://stackoverflow.com/questions/2940528/twitter-oauth-callback-parameter-being-ignored/3351724#3351724

It's a matter of how it's sent over, it seems. I think we should endeavor to fix this issue, instead of just ripping it out completely - after all, people requested/patched it in the first place for a reason. ;)


Reply to this email directly or view it on GitHub:
https://github.com/ryanmcgrath/twython/issues/59#issuecomment-4306580

I tried to use my own callback_url and it still redirected me to my apps redirect URL. Sent from my iPhone On Mar 3, 2012, at 7:54 PM, Ryan McGrathreply@reply.github.com wrote: > Mmm, so I'm not sure we wanna take this out just yet. Twitter actually _does_ still respect this parameter (to my knowledge), but upon researching it there's been a change somewhere down the line. > > http://stackoverflow.com/questions/2940528/twitter-oauth-callback-parameter-being-ignored/3351724#3351724 > > It's a matter of how it's sent over, it seems. I think we should endeavor to fix this issue, instead of just ripping it out completely - after all, people requested/patched it in the first place for a reason. ;) > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/ryanmcgrath/twython/issues/59#issuecomment-4306580
ryanmcgrath commented 2012-03-12 15:28:35 -07:00 (Migrated from github.com)

Mmm, but did you swap it from doing it with a GET to submitting it in a POST body? I believe that's the difference (oddly...).

Could tackle this after finishing the requests merge (which I owe you, yes).

Mmm, but did you swap it from doing it with a `GET` to submitting it in a `POST` body? I believe that's the difference (oddly...). Could tackle this after finishing the `requests` merge (which I owe you, yes).
michaelhelmick commented 2012-03-12 15:31:24 -07:00 (Migrated from github.com)

I didn't swap it. I have some time tomorrow. I'll try.

Sent from my iPhone

On Mar 12, 2012, at 6:28 PM, Ryan McGrathreply@reply.github.com wrote:

Mmm, but did you swap it from doing it with a GET to submitting it in a POST body? I believe that's the difference (oddly...).

Could tackle this after finishing the requests merge (which I owe you, yes).


Reply to this email directly or view it on GitHub:
https://github.com/ryanmcgrath/twython/issues/59#issuecomment-4463269

I didn't swap it. I have some time tomorrow. I'll try. Sent from my iPhone On Mar 12, 2012, at 6:28 PM, Ryan McGrathreply@reply.github.com wrote: > Mmm, but did you swap it from doing it with a `GET` to submitting it in a `POST` body? I believe that's the difference (oddly...). > > Could tackle this after finishing the `requests` merge (which I owe you, yes). > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/ryanmcgrath/twython/issues/59#issuecomment-4463269
ryanmcgrath commented 2012-03-18 07:41:31 -07:00 (Migrated from github.com)

Closing this, as it's taken care of by other issues/pull-requests here.

Closing this, as it's taken care of by other issues/pull-requests here.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#59
No description provided.