-
Notifications
You must be signed in to change notification settings - Fork 731
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
Support Certificate Pinning #228
Comments
I don't think we should give out control of This is also one of the possible solutions to handling token authentication. See this issue for a long discussion about this :) We should really make some decisions here and solve these issues. @MrAlek, what do you think? |
Though adding a |
I'd second the idea of opening In our app, we've needed to re-implement
I think that a subclass of @martijnwalraven , I'm happy to make a pass at a PR for that if you think that could be a viable option. Regarding the token authentication piece, I'll take some time to digest the #37 thread and add some thoughts there as well, as that's a pretty urgent topic for us right now. Related to this thread, my concern with solving token auth via the subclass approach is that for us we have token refresh logic in a separate layer, and retrieving the user's current tokens is an asynchronous operation. As a result, this makes appending them in the network transport's |
I agree with @johntmcintosh - had the same requirement here and ended up reimplementing a new NetworkTransport class, where most of the code was largely HTTPNetworkTransport including pinning support. Being able to subclass, or access the URLSession property to become the delegate would be really useful. |
Same here. I can'e help but notice that this issue was opened almost 5 months ago. Is the reason there hasn't been any progress because the maintainers aren't sure if opening for subclassing is the right move or something else? |
This feature will be possible to be written by users if library will allow to provide custom NetworkTransport. |
Apologies for the long radio silence on this issue. I'm going to be chatting with @martijnwalraven next week about the implications of giving up the ability to use the session delegate internally. |
As of If you are still having problems with this after upgrading, please open a new issue. Thank you! |
I recently updated Apollo to v0.37.0 and had to refactor the auth layer because of breaking changes. In the process of refactoring I noticed that there's seemingly no way to supply a custom Am I missing something? |
I found out that Apollo's override func urlSession(
_ session: URLSession,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void
) The |
You beat me to it! Yep, subclassing |
Public key pinning is a great step for apps to reduce MITM vulnerabilities. The current instantiation of the Apollo Client allows a parameter for the URLSession configuration. In order to implement SSL pinning, however, an entire URLSession object should be able to be passed in. This would allows the URLSession object to register a delegate that handles the pinning by implementing
This can be done simply by adding another constructor to the HttpNetworkTransport object that accepts the URLSession object instead of just it's configuration.
After that, injecting the session object with the appropriate delegate is simple.
The text was updated successfully, but these errors were encountered: