From f1b3365a85f6de56b0f4d4cb621318de794114c9 Mon Sep 17 00:00:00 2001 From: Olivier DRAGHI Date: Sun, 2 Oct 2022 17:43:56 +0200 Subject: [PATCH] Allow VcdClient to rehydrate from token Signed-off-by: Olivier DRAGHI --- pyvcloud/vcd/vcd_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyvcloud/vcd/vcd_client.py b/pyvcloud/vcd/vcd_client.py index 1b49809e..e7e0770b 100644 --- a/pyvcloud/vcd/vcd_client.py +++ b/pyvcloud/vcd/vcd_client.py @@ -148,6 +148,10 @@ def _initialize_openapi_client(self): self.set_default_header("Accept", f'application/*;version={self._api_version}') self.set_default_header("Authorization", api_token) + + def rehydrate_from_token(self, token, is_jwt_token=False): + super().rehydrate_from_token(token=token, is_jwt_token=is_jwt_token) + self._initialize_openapi_client() def logout(self): """Logout current user and clear the session."""