Skip to content
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

Not using didReceiveAuthenticationChallenge:? #15

Open
tciuro opened this issue May 24, 2012 · 2 comments
Open

Not using didReceiveAuthenticationChallenge:? #15

tciuro opened this issue May 24, 2012 · 2 comments

Comments

@tciuro
Copy link
Contributor

tciuro commented May 24, 2012

Hello Sam,

I was just wondering... is there a reason why you're not implementing the challenge callback?:

- (void)connection:(NSURLConnection *)aConnection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

That would take care of BASIC and DIGEST-based authentication.

@samvermette
Copy link
Member

@tciuro I'm not too familiar with request authentications. How would this be different than settings the Authorization HTTP header field as I currently do?

@tciuro
Copy link
Contributor Author

tciuro commented Sep 6, 2012

The difference is that you're providing Basic-type authentication, which is weaker than its Digest-based counterpart. Digest Authentication communicates credentials in an encrypted form by applying a hash function to the the username, the password, a server supplied nonce value, the HTTP method, and the requested URI, whereas Basic Authentication uses unencrypted base64 encoding. Basic Authentication should generally only be used where transport layer security is provided such as https.

Checkout the example of using the connection:didReceiveAuthenticationChallenge: delegate method:

http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/urlloadingsystem/Articles/AuthenticationChallenges.html

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

No branches or pull requests

2 participants