Rails 2.0 offers an extremely easy way to do HTTP basic authentication. See how in this episode.

Read more at the source