Probably not in a portable manner. The point of container-managed auth is that the container does it, not the app itself, and so there are no hooks into it.
If you're using a particular
servlet container (such as
Tomcat), you could write a Valve (I think), or extend the Realm being used, to do extra stuff, but not with the Servlet API.