This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Digest Authorization support
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
I've just added digest authorization support to BottomFeeder - this allows users to deal with protected feeds on LiveJournal. Grab the Http-Access update from the server, and you should be all set.
Adding this was made easier by Smalltalk. The basic Http libraries in VisualWorks do not handle digest authorization. All the support for Basic auth was in, but not for digest. Fortunately, I can extend those libraries in Smalltalk. Sure, it would have been simpler yet had the support been in the libraries, but face it - no matter what vendor and language you pick, you aren't going to find support for everything. VW supports most of what I needed in Http, and it was a fairly simple matter to extend the support to digest
The hardest part for me was reading the spec and following it - I'm not normally dealing with IETF specs, and I'm more of an application level developer than I am a framework/library developer. Fortunately, all of the code necessary to produce an md5 hash are already in VisualWorks - the basic code for creating what the spec wants looks like this:
Now, that's a mouthful to write everywhere I needed it (digest auth has you hash a bunch of stuff). So, I added a method to class String, so that I could just call it naturally:
Which allowed me to get the hash string easily, That's one of the niftiest things about Smalltalk, actually - the ability to toss extension code exactly where it belongs, which ends up empowering the developer later on - it's just that much less code to write downstream
In any event, Digest Authorization is now in Bf; enjoy! I'd like to thank Mark for providing a test site for me to hit (and a nice sample request!), and Michael Lucas-Smith for some useful tips when I was a little stuck