HTTPS和放大器;摘要式身份验证

问题描述:

如何实现HTTPS使用摘要身份验证使用C#.NET?根据MSDN,证书类具有SSL。所以我们怎么能实现身份验证不支持?我的code适用于基本身份验证,但与消化提供了错误。

How to implement HTTPS with Digest Authentication in C#.Net? as per msdn, credential class has no support for SSL.. so how can we implement authentication? my code works with basic authentication but gives error with digest..

您可以创建在的 CredentialCache 时,其用于Web客户和WebRequests。因此,例如,以填充CredentialCache尝试文摘AUTH可以使用

You can specify the type of credential when creating a credential in the CredentialCache, which is used for WebClients and WebRequests. So, for example, to populate the CredentialCache to try Digest auth you could use

CredentialCache cache = new CredentialCache();
Uri prefix = new Uri ("http://www.example.com");
cache.Add (prefix, "Digest",  new NetworkCredential ("username", "passwd"));

WebClient wc = new WebClient();
wc.Credentials = cache;

由于摘要式身份验证依赖于目标URL和领域,如果它指定一个你需要让这些权利。

As digest authentication is dependant on the destination URL, and the realm if it specifies one you do need to get those right.