ios - How do you handle a 401 error when using willSendRequestForAuthenticationChallenge? -
i'm using apple's preferred method dealing ntlm authentication challenges through nsurlconnection via willsendrequestforauthenticationchallenge. i'm trying determine how deal situations challenge fails (such if user's password had changed or first time user has ever made web service request device) , application needs handle obtaining new password , retrying url request.
but, i'm stuck.
here's i'm trying do. in doing basic testing, first wipe out credentials storage can pretend if user's first time making request url needs authenticated. call using [challenge performdefaulthandlingforauthenticationchallenge] expect fail in way since there's no credentials yet in storage. well, unexpectedly response in didreceivedata has 401 authentication error buried in html response string; it's disguised data received url (web service request). if make subsequent call , observe [challenge previousfailurecount], it's still @ 0 (and think know why; still don't have credentials saved in credential storage).
how deal 401 error without having parse response data? think 401 have automatically been recognized nsurlconnection , allow me see way.
Comments
Post a Comment