extract getRealm() on BasicAuth so subclasses can override.