Webrick authentication

Hello,

I am looking at the webrick authentication sample. I guess it would
probably work but it is not what I want.

Using the sample I am able to create a function that requests
authentication and returns a page.

However, I would like the authentication to stack with any existing
servlet. How do I use authentication with one of the standard servlets
or one I have written?

The only page I found recommends patching the server class to hack in
the authentication.

Thanks

Michal