OnVif集成错误-未经授权的客户端身份验证方案“摘要" [英] OnVif integration error - unauthorized with client authentication scheme 'Digest'
问题描述
使用此代码在C#.Net 4.5中连接到我的IP摄像机上的OnVif服务.
在该代码的旁边,我试图获取设备信息,如下所示:
Using this code to connect to OnVif service on my IP Camera in C# .Net 4.5.
Very next to that code, I am trying to get Device information as follows:
string str = client.GetDeviceInformation(out model, out firmware, out serial, out hardwareId);
处理此错误:
An exception of type 'System.ServiceModel.Security.MessageSecurityException' occurred in mscorlib.dll but was not handled in user code
Additional information: The HTTP request is unauthorized with client authentication scheme 'Digest'. The authentication header received from the server was 'Basic realm="CBBA"'.
我尝试了的请求中.但没有运气.
I tried this information about Basic realm. By adding an Http header WWW-Authenticate
to the request with value Basic realm="Our Site"
. But no luck.
那到底是什么?如何解决?
What the heck is that? How to fix it?
推荐答案
I had a relevant issue - I had to authenticate with ONVIF cameras for which I did not know the authentication HTTP authentication modes (Basic/Digest). In my answer you can see how to properly iterate through all the HTTP authentication schemes or you can just take the code for Digest, hope it helps.
这篇关于OnVif集成错误-未经授权的客户端身份验证方案“摘要"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!