« Tagzania: Folksonomies for Google Maps | Main | WebDosBeta: Web 2.0 workshop in Madrid »

WSSE for JavaScript

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 JohnstonJF Walker and  aardwulf systems.

Download wsse.js - version 1.0.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/15294/2862194

Listed below are links to weblogs that reference WSSE for JavaScript:

» JavascriptでWSSE認証ヘッダを生成するライブラリ from ベイエリア情報局
WSSE for JavaScript AtomAPIで使用されるWSSE認証用... [Read More]

» [javascript][atom]wsse.jsのタイムゾーンの計算がおかしい気がする from fami-note
Movable TypeではAtomAPIでの認証にWSSEというのを使うらしい。よくわからないので調べてたところJavascriptでWSSEを生成できるVictor R. Ruiz氏作のwsse.jsを発見。これをありがたく使わせてもらってかなり良い感じに動いてたけど、それから何もいじらず置いといたのに、夜... [Read More]

Comments

強いです

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 ?

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 ?


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?

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.

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). :)

Has anyone done a quick web-based form to generate WSSE authentication strings for testing?

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().

Post a comment

If you have a TypeKey or TypePad account, please Sign In

Blog powered by TypePad

Flickr

  • www.flickr.com