![](https://secure.gravatar.com/avatar/9ed8f95a7e6504d2544a118666e62b36.jpg?s=120&d=mm&r=g)
Colin Alston wrote:
class Page(object): def authenticateUser(self, request, passinfo): user, password = request.getUser(), md5.md5(request.getPassword()).digest()
FWIW, the nevow version is about the same: class MyPage(athena.LivePage or rend.Page): def renderHTTP(self, ctx): request = inevow.IRequest(ctx) username, password = request.getUser(), request.getPassword() if self.useAuth and (username, password) == (x, y): secure.info("rendering page because http auth is set") return rend.Page.renderHTTP(self, ctx) else: request.setHeader('WWW-Authenticate', 'Basic realm="topsecret"') request.setResponseCode(http.UNAUTHORIZED) return "Authentication required."