Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

AFNetworking 2.6 breaks Twitter Oauth #36

Closed
kolpanic opened this issue Sep 22, 2015 · 6 comments
Closed

AFNetworking 2.6 breaks Twitter Oauth #36

kolpanic opened this issue Sep 22, 2015 · 6 comments

Comments

@kolpanic
Copy link
Contributor

I just logged an issue (AFNetworking/AFNetworking/issues/2999) about AFNetworking 2.6 not percent-encoding slashes in the parameters. In particular, the oauth_callback parameter's slashes are left intact, so I get a 401 Unauthorized error from Twitter's API.

Is there any approach from within BDBOAuth1Manager you can think of to work around this issue in the meantime?

Thanks.

@bdbergeron
Copy link
Owner

Hi @kolpanic. I actually encountered this issue on Sunday while attempting to work through issue #35, but didn't have time to resolve it. From what I read in the release notes, it appears it was a conscious decision by the maintainers of AFNetworking to change the way percent encoding works to abide by a certain RFC:

This release migrates query parameter serialization to model AlamoFire and adhere to RFC standards. Note that / and ? are no longer encoded by default.

Unfortunately, this means it comes down to me to restore the previous encoding in this library. I'll do my best to make that happen later this evening. You're more than welcome to submit a PR if you beat me to it! 😃

@kolpanic
Copy link
Contributor Author

@bdbergeron From my reading of the RFC, it's more of a suggestion than a requirement. However, they've chosen to follow it, so, thanks.

@kolpanic
Copy link
Contributor Author

@bdbergeron If you can think of a better approach, feel free to ignore my PR.

@kolpanic
Copy link
Contributor Author

@bdbergeron I just tried this fix with AFNetworking 2.5.4, and (predictably) it doesn't work. I'm not aware of a way to check the AFNetworking version at runtime, so you may have to require 2.6 going forward.

@bdbergeron
Copy link
Owner

I definitely plan on the next release (1.6.0) bumping the requirement for AFNetworking to 2.6.+. I've been sticking to the versioning convention of BDBOAuth1Manager 1.x.+ utilizing AFNetworking 2.x.+ as much as possible, just so that it's as clear to developers that AFNetworking changes might result in changes to this library.

@bdbergeron
Copy link
Owner

So it looks like @skj4sc solved this issue in a PR to a different fork of this project (toopher#2), so I just cherry-picked his fixes into here. Should be good to go with AFNetworking 2.6.+ as of commit f4288a8.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants