protected Principal getPrincipal(final String name, final boolean isNtlm) throws Throwable {
        if (this.principalWithDomainName) {
            return this.principalFactory.createPrincipal(name);
        }
        if (isNtlm) {
            if (Pattern.matches("\\S+\\\\\\S+", name)) {
                val splitList = Splitter.on(Pattern.compile("\\\\")).splitToList(name);
                if (splitList.size() == 2) {
                    return this.principalFactory.createPrincipal(splitList.get(1));
                }
            }
            return this.principalFactory.createPrincipal(name);
        }
        val splitList = Splitter.on("@").splitToList(name);
        return this.principalFactory.createPrincipal(splitList.getFirst());
    }
Gets the principal from the given name. The principal
is created by the factory instance.

@param name   the name
@param isNtlm the is ntlm
@return the simple principal
support/cas-server-support-spnego/src/main/java/org/apereo/cas/support/spnego/authentication/handler/support/JcifsSpnegoAuthenticationHandler.java