internal AuthenticationChallenge(AuthenticationSchemes scheme, string realm) : base(scheme, new NameValueCollection()) { this.Parameters["realm"] = realm; if (scheme == AuthenticationSchemes.Digest) { this.Parameters["nonce"] = AuthenticationBase.CreateNonceValue(); this.Parameters["algorithm"] = "MD5"; this.Parameters["qop"] = "auth"; } }
private void initAsDigest() { string text = Parameters["qop"]; if (text != null) { if (text.Split(',').Contains((string qop) => qop.Trim().ToLower() == "auth")) { Parameters["qop"] = "auth"; Parameters["cnonce"] = AuthenticationBase.CreateNonceValue(); Parameters["nc"] = $"{++_nonceCount:x8}"; } else { Parameters["qop"] = null; } } Parameters["method"] = "GET"; Parameters["response"] = CreateRequestDigest(Parameters); }
private void initAsDigest() { string item = this.Parameters["qop"]; if (item != null) { if (!item.Split(new char[] { ',' }).Contains <string>((string qop) => qop.Trim().ToLower() == "auth")) { this.Parameters["qop"] = null; } else { this.Parameters["qop"] = "auth"; this.Parameters["cnonce"] = AuthenticationBase.CreateNonceValue(); uint num = this._nonceCount + 1; this._nonceCount = num; this.Parameters["nc"] = string.Format("{0:x8}", num); } } this.Parameters["method"] = "GET"; this.Parameters["response"] = AuthenticationResponse.CreateRequestDigest(this.Parameters); }