Simple Basic example

class PostsController<ApplicationControllerhttp_basic_authenticate_withname:"dhh",password:"secret",except::indexdef indexrenderplain:"Everyone can see me!"enddef editrenderplain:"I'm only accessible if you know the password"endend

Advanced Basic example

Here is a more advanced Basic example where only Atom feeds and the XML API
is protected by HTTP authentication, the regular HTML interface is protected by a session approach: