private Object getPrimaryPrincipal(PrincipalCollection principals) {
        if (!isEmpty(principals)) {
            return principals.getPrimaryPrincipal();
        }
        return null;
    }
Returns the host name or IP associated with the client who created/is interacting with this Subject.

@return the host name or IP associated with the client who created/is interacting with this Subject.
core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java