¡@

Home 

2014/10/15 ¤U¤È 10:04:16

iphone Programming Glossary: authenticationmethod

NSURLConnection, NSURLRequest, untrusted cert and user authentication

http://stackoverflow.com/questions/2949640/nsurlconnection-nsurlrequest-untrusted-cert-and-user-authentication

for that challenge. You can determine what type of challenge you've received using challenge protectionSpace authenticationMethod The possible values are documented here . In the case of an invalid server certificate the authentication method will be.. bad credentials here challenge sender cancelAuthenticationChallenge challenge return if challenge protectionSpace authenticationMethod NSURLAuthenticationMethodServerTrust check if the user has previously accepted the certificate otherwise prompt else if.. check if the user has previously accepted the certificate otherwise prompt else if challenge protectionSpace authenticationMethod your supported authentication method here challenge sender useCredential your user's credential forAuthenticationChallenge..

JSON POST Request on the iPhone (Using HTTPS)

http://stackoverflow.com/questions/4085978/json-post-request-on-the-iphone-using-https

connection didReceiveAuthenticationChallenge NSURLAuthenticationChallenge challenge if challenge.protectionSpace.authenticationMethod isEqualToString NSURLAuthenticationMethodServerTrust challenge.sender useCredential NSURLCredential credentialForTrust.. connection canAuthenticateAgainstProtectionSpace NSURLProtectionSpace protectionSpace if protectionSpace authenticationMethod isEqualToString NSURLAuthenticationMethodServerTrust return YES This allows me to get this far. If I don't use them I.. connection didReceiveAuthenticationChallenge NSURLAuthenticationChallenge challenge if challenge.protectionSpace.authenticationMethod isEqualToString NSURLAuthenticationMethodServerTrust challenge.sender useCredential NSURLCredential credentialForTrust..

NSURLCredentialStorage and client certificate authentication

http://stackoverflow.com/questions/4164846/nsurlcredentialstorage-and-client-certificate-authentication

protectionSpace NSURLProtectionSpace alloc initWithHost @ myhostname port 443 protocol @ https realm nil authenticationMethod NSURLAuthenticationMethodClientCertificate NSURLCredentialStorage sharedCredentialStorage setDefaultCredential credential..