MOSS 2007 Web 部件中的 system.net.credentialcache.defaultcredentials 始终为空
我正在尝试使用
MOSS 2007 Web 部件内的 system.net.credentialcache.defaultcredentials 将用户凭据传递给 Web 服务。但凭据显示始终为空。我使用集成 Windows 身份验证
I am trying to pass user credential to a webservice using
system.net.credentialcache.defaultcredentials inside MOSS 2007 webpart. But the credential shows always empty.I ma using integrated windows authentication
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您永远不会在调试中看到凭据。但它们会被正确地传递到需要它们的地方。当使用匿名身份验证时,客户端将不会发送要使用的身份验证标头。您需要将匿名身份验证设置为禁用。
You will never see the credentials in debug. But they will be correctly passed to where they are needed. And when using anonymous authentication the client will not send the authentication header to be used. You need to set anonymous authentication disabled.
您是否希望提取凭证?如果是,请参阅此 -
http://msdn.microsoft.com/en -us/library/system.net.credentialcache.defaultcredentials.aspx
这是 MSDN 的说法 - “DefaultCredentials 返回的 ICredentials 实例不能用于查看用户名、密码或域当前的安全环境。”
但是,当您调用 Web 服务时,API 知道它需要做什么,因此它将传递您当前正在运行的凭据。
Are you expecting to extract the credentials? If yes, please see this -
http://msdn.microsoft.com/en-us/library/system.net.credentialcache.defaultcredentials.aspx
Here is what MSDN says - "The ICredentials instance returned by DefaultCredentials cannot be used to view the user name, password, or domain of the current security context."
However when you call the web service the API knows what it needs to do, so it will pass the credentials under which you are currently running.
其实我不是在回答。但我找不到回复你的帖子的方法。我有同样的问题。您可以尝试以下操作。
如果您已经知道答案,请告诉我。
Actually, I am not answering. But I could not find a way to reply your post. I have the same issue. You can try below things.
If you already know the answer let me know.