HTTPS和放大器;摘要式身份验证 [英] HTTPS & Digest Authentication

查看:148
本文介绍了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.

这篇关于HTTPS和放大器;摘要式身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆