protected String getSyncopeRealm(final Principal principal) {
        return CollectionUtils.firstElement(principal.getAttributes().get("realm"))
            .map(Object::toString)
            .orElseGet(properties::getRealm);
    }
This is {@link SyncopePrincipalProvisioner}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-syncope-authentication/src/main/java/org/apereo/cas/syncope/SyncopePrincipalProvisioner.java