Fix a bug for HasClientImpl.

Description of the bug: cannot restore renewed token from bytes.
Enhance tests for renew identity token.