Client bug on publish authorization

The client was not shared between the `authorizePublish` and the `authenticate`. The problem has need fixed and tests added. On the subscribe tests name correction has been applied.