public IAuthenticator Next(WebException ex) { // No user name provided, just throw if (string.IsNullOrEmpty(_user)) return null; var response = (HttpWebResponse)ex.Response; var header = response.Headers["WWW-Authenticate"]; if (response.StatusCode != HttpStatusCode.Unauthorized || string.IsNullOrEmpty(header)) return null; var digest = new DigestToken(header, _user, _password); return new DigestAuthenticator(digest); }
public DigestAuthenticator(DigestToken digest) { if (digest == null) throw new ArgumentNullException("digest"); _digest = digest; }