The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Using Http Authentication with VisualWorks

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Using Http Authentication with VisualWorks Posted: Oct 1, 2003 1:13 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Using Http Authentication with VisualWorks
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.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement
I recently (in 3.1) got Http authentication working in BottomFeeder. I didn't have to do anything out of the oridinary - all the support I need was already in the NetClients package, which has been part of the VW distribution for a few years now. So how do you add such support? Well, let's say you issue an Http request:
request := self fillRequestHeaders.
client := HttpClient new.
response := client executeRequest: request.
response isUnauthorized ifTrue: [authInfo := self promptForAuthorization].

Now, once you have that authorization information, what do you do? Well, you create the request again, this time with the authorization information in it, then re-issue the request. Something like this:

request username: authInfo username password: authInfo password.
response := client executeRequest: request.

That should do it. Now, of course, you'll want to catch exceptions, and handle other cases (movement of a page, various error responses, etc.). To get an idea of how to do that sort of thing, load the package Http-Access from the Public Store. The package handles authentication, moved pages, and mod-gzip automatically. I use it in BottomFeeder and my blog posting tools - it's getting real world use.

Read: Using Http Authentication with VisualWorks

Topic: Small server outage Previous Topic   Next Topic Topic: withStyle, and lots more

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use