Zabbix is expecting user name to be $_SERVER['PHP_AUTH_USER']. The user name will not always be there (esp when doing HTTP Auth).
Recommend adding a configuration item to map where Zabbix should find the user name for external authentication:
ZBX_AUTH_USER_MAP = $_SERVER['PHP_AUTH_USER'];
Doing this would also give the user flexibility to use not only HTTP Authentication, but other types of external authentication (without having to add $_SERVER['PHP_AUTH_USER'] = $username in the index...)