pepOS
pepOS

Reputation: 355

How to set the creation time for the WSE 3.0 UsernameToken

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");

Upvotes: 1

Views: 568

Answers (0)

Related Questions