I think the identity should be handled at the level of the handler rather than in the JS code and sent to the handler.