The current default authentication method in TypePad and Movable Type's Atom implementation is WSSE. WSSE is a header containing a token based on username, password and date and looks like:
X-WSSE: UsernameToken Username="name", PasswordDigest="digest", Created="timestamp", Nonce="nonce"
I have implented a library in JavaScript to generate this header, quite useful for XmlHttpRequest and GM_XmlHttpRequest functions. An example of use:
<html>
<head>
<script language="JavaScript1.2" src="wsse.js">
</head>
<body>
<script language="JavaScript1.2">
var w = wsseHeader(Username, Password);
alert('X-WSSE: ' + w);
</script>
</body>
This library uses code from Paul Johnston, JF Walker and aardwulf systems.
強いです
Posted by: shilei | July 29, 2005 at 07:35 AM
I hava a problem and want to ask you .Can you help me ?
The problem is :
where does the user's information save? for example ,user's name,password. is it Cookie,session or any other ?
Posted by: shilei | August 03, 2005 at 04:04 AM
I hava a problem and want to ask you .Can you help me ?
The problem is :
where does the user's information save? for example ,user's name,password. is it Cookie,session or any other ?
Posted by: shi | August 03, 2005 at 04:14 AM
Hi,
I would like to use your script, but it doesn't say what license the complete thing is released under.. could you add that to the script?
Posted by: Morten W. Petersen | August 25, 2005 at 12:25 AM
shilei: You just call the function in JavaScript passing the parameters.
Morten: Right, I forgot to specify a license. I release my code under BSD, but please take care of other ones' licenses.
Posted by: Víctor R. Ruiz | August 25, 2005 at 03:31 PM
Great, thanks for releasing this bit under the BSD. I was looking to create exactly what you created with the same base libraries, and stumbled upon this by chance (googling for wsse). :)
Posted by: Morten W. Petersen | August 25, 2005 at 11:34 PM
Has anyone done a quick web-based form to generate WSSE authentication strings for testing?
Posted by: Eric Jacksch | June 14, 2007 at 07:28 PM
The wsse.js has a problem on the timezone calculation in isodatetime(). It is necessary to add or subtract 24 to the variable hour, if Date.getDate() is different from Date.getUTCDate().
Posted by: P | September 12, 2007 at 02:18 AM
Able to work under high pressure and time limitation with leadership quality.
Posted by: Cheap Jordan shoes | December 15, 2010 at 06:47 AM
Nice Script
But have a suggestion for a small update on it, more specifically in the isodatetime method.
At the line 313, you get the difference between the current hour and the UTC hour. That woks most of the time but there is some specific moment where it does not give the right result. Note that JS return hour base on 24 hours not 12am and 12pm in this case.
Here is the explanation:
Any town where the difference is -4. It works all the time except between 8pm and midnight.
Anytime : hour - hourUTC = -4
At 8pm : 20 - 00 = 20
At 9pm : 21 - 01 = 20
...
Same thing for any other minus number, as example difference of -8.
Anytime : hour - hourUTC = -8
At 8pm : 16 - 00 = 16
At 9pm : 21 - 05 = 16
...
You can change value for city with different time like -6 or -11, you'll face the problem, but at different time of the day, when the UTC get at 00 and up to the time where the current hour reach midnight itself.
The same problem for the positive difference, but at different time again. As example, +11
Anytime : hour - hourUTC = +11
At 8pm : 10 - 23 = -13
At 9pm : 11 - 24 = -13
...
To fix that, we can just add this in the code :
var diff = hour - hourUTC; // That's ok
if(diff > 12) diff -= 24; // Fix the problem for town with real negative diff
if(diff <= -12) diff += 24; // Fix the problem for town with real positive diff
Note that this have been done and test fast. May be someone may optimize it. For example, it does not take into account some exception of a specific places in the World where the difference is 13 or the other place where the difference is 12 3/4.
Here is a map reference of it:
http://www.srh.noaa.gov/jetstream/synoptic/timezones.htm
Just select 24 hour in the top of it, unchek the Full Map option at the bottom and check the Off hours at the bottom. You'll see the weird time zone exception.
We face the problem and fix it because of the server that refused or WSSE connection based on the fact that timezone was not right. Server restriction in our case validate timezone in the WSSE header for many reasons.
Hope that can help.
Posted by: JFFortierQC | August 10, 2012 at 03:14 PM
Hi JF: I just uploaded the code to github.com/vrruiz/wsse-js/. Patches welcomed! :)
There is a thread about ISO date methods in StackOverflow that may be worth to look at.
Posted by: rvr | August 10, 2012 at 04:27 PM
I've never changed code in github before. I just did it in your file.
let me know if that was the way you wanted.
hope that help!
Posted by: JFFortierQC | August 11, 2012 at 03:32 AM