CredentialCache.Add 方法中的 authType 参数
CredentialCache.Add 方法中的 authType 是什么? http://msdn.microsoft.com/en-us/library/czdw7s9e。 ASPX 我不明白根据我传递给此 Add 方法的 uRi 应该传递什么。而我的 uRi 实际上是一个 asmx 页面地址
what is the authType in CredentialCache.Add Method ?
http://msdn.microsoft.com/en-us/library/czdw7s9e.aspx
I do not understand what should I pass to it based on the uRi that I am passing to this Add method. and my uRi is actually an asmx page address
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
主要有两种 HTTP 身份验证方案:
authType 参数是将凭据添加到缓存的 HTTP 身份验证方案。发出请求时,服务器将首先响应 403 并指定支持的身份验证方案,以及领域和随机数(如果需要)。如果请求的身份验证类型在缓存中(基本或摘要),则请求将使用凭据缓存来响应质询。第一次调用后的后续调用可能会预先发送身份验证信息,如果 预验证已设置。
There are two main HTTP authentication schemes:
The authType parameters is the HTTP authentication scheme for which the credentials are added to the cache. When making a request, the server will first respond with a 403 and specify an authentication schem supported, along with the realm and the nonce (if required). The request will then use the credentials cache to respond to the chalenge, if the requested authentication type is in the cache (basic or digest). Subsequent calls after the first call may pre-send the authentication info, if PreAuthenticate is set.
我查看了 CredentialCache.Add() 方法的其他重载:
可以在此处找到定义:
https://msdn.microsoft.com/en -us/library/59x2s2s6(v=vs.110).aspx
在这里,他们将字符串称为“authenticationType”(而不是“authType”)并指出:
我觉得这很令人困惑,因为“authType”和“authenticationType”似乎可以互换使用。
当我在问题中引用的方法重载中使用“NTLM”和“Negotiate”作为“authType”时,它对我的 URL 有效:
I looked at the other Overload of the CredentialCache.Add() Method:
The definition may be found here:
https://msdn.microsoft.com/en-us/library/59x2s2s6(v=vs.110).aspx
Here they call the string "authenticationType" (instead of "authType") and states:
I find this confusing because "authType " and "authenticationType" appear to be used interchangeably.
It worked for my URL when I used "NTLM" and "Negotiate" for "authType" in the Method Overload you reference in your Question:
authType 似乎指的是如何通过 http Web 请求发送您提供的凭据(用户名和密码)。基本大致意味着未加密,而摘要意味着您随请求一起发送哈希值以对其进行身份验证。请注意,此身份验证类型由服务器决定,您无法选择遵循哪一种身份验证类型。
请参阅基本身份验证和摘要式身份验证
The authType seems to refer to how the credential(username and password) you provide is sent with a http web request. Basic roughly means unencrypted, and digest means that you send a hash along with the request to authenticate it. Note that this authentication type is decided by the server adn you dont have a choice as to which one to follow.
See Basic Authentication and Digest Authentication