How to set the creation time for the WSE 3.0 UsernameToken

懵懂的女人 提交于 2020-01-05 10:32:13

问题


I'm using the WSE 3.0 UsernameToken to communicate with a network camera. Due the time difference between my PC and the network camera I can't authenticate, the allowed time difference is +- 5 sec UTC time, my current difference is 59 minutes and 19 seconds. The problem is that when I create the UsernameToken instance, the Created property is already set, and it's read only.

var token = new UsernameToken(Username, Password, PasswordOption.SendHashed);

I've tried to change manually the xmlelement generated by the UsernameToken instance to correct the time gap, but keep getting error 400.

XmlElement securityToken = token.GetXml(new XmlDocument()); securityToken.ChildNodes[3].InnerText = time.ToString("yyyy-MM-ddTHH:mm:ss.fffZ");

来源:https://stackoverflow.com/questions/26767093/how-to-set-the-creation-time-for-the-wse-3-0-usernametoken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!