コード例 #1
0
ファイル: BasicAuthenticator.cs プロジェクト: nthobois/7Pass
        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);
        }
コード例 #2
0
ファイル: DigestAuthenticator.cs プロジェクト: nthobois/7Pass
 public DigestAuthenticator(DigestToken digest)
 {
     if (digest == null)
         throw new ArgumentNullException("digest");
     _digest = digest;
 }