@Override
    public boolean isWildcardedAccount(final String surrogate, final Principal principal, final Optional<? extends Service> service) throws Throwable {
        return super.isWildcardedAccount(surrogate, principal, service) && doesSurrogateAccountExistInLdap(surrogate);
    }
This is {@link SurrogateLdapAuthenticationService}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-surrogate-authentication-ldap/src/main/java/org/apereo/cas/authentication/surrogate/SurrogateLdapAuthenticationService.java