How can I do the same authentication stuff in this page using a subclass like this:
class Configuration < HTTPServlet::AbstractServlet
def do_
Seems to work OK for me if you do it in pretty much the same style e.g.
class Configuration < HTTPServlet::AbstractServlet
def do_GET(req, res)
HTTPAuth.basic_auth(req, res, "My Realm") {|user, pass|
# block should return true if
# authentication token is valid
user == 'user' && pass == 'topsecret'
}
res.body =
"Authenticated OK\n"
end
end
What is the problem you're having?