extract getRealm() on BasicAuth so subclasses can override.

The usecase is a multitenant app where I want different realms for paths like /foo/homepage and /bar/homepage.