Icehouse version of hybrid_identity.py

Icehouse compatible version of hybrid_identity.py fixing issues raised by @mapleoin.