protected void afterRealmsSet() {
        super.afterRealmsSet();
        if (this.authenticator instanceof ModularRealmAuthenticator) {
            ((ModularRealmAuthenticator) this.authenticator).setRealms(getRealms());
        }
    }
Passes on the {@link #getRealms() realms} to the internal delegate <code>Authenticator</code> instance so
that it may use them during authentication attempts.
core/src/main/java/org/apache/shiro/mgt/AuthenticatingSecurityManager.java