How does this line of code work?
I am trying to modify the URL for this to work, but from looking at the Apple Documentation it doesn’t give much on where I should put the password/URL.
NSString *password = [(NSString *)CFURLCopyPassword((CFURLRef)[self.request URL]) autorelease];
This line of code is part of the AFNetworking framework so I can pass authentication.
How is the URL suppose to be structured for this to grab the password correctly? I have no luck with it yet.
I tried putting it in the front username:password, but that is not right. the password doesn’t get grabbed.
So basically http://userid:password@www.anywhere.com/ completely bypasses the method and it’s not what I want to do.
You can find a short description of this authentication way here, for more details you’ll have to look for the proper standard describing URL.
URL sample in case the page is not available later:
ftp://username:password@hostname/https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html