Open hanswurscht opened 2 years ago
This also seems to happen when used with username/password instead of client_id/client_secret:
self._client = CloudFoundryClient(url, verify=cacert_path)
self._client.init_with_user_credentials(username, password)
[...] idle until token timed out
self._client.v3.organizations.get(org_guid)
self._client.v3.organizations.get(org_guid)
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/cloudfoundry_client/v3/entities.py", line 238, in get return self._get(requested_path, **kwargs)
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/cloudfoundry_client/v3/entities.py", line 133, in _get response = self.client.get(url_requested)
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/cloudfoundry_client/client.py", line 269, in get response = super(CloudFoundryClient, self).get(url, params, **kwargs)
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/oauth2_client/credentials_manager.py", line 220, in get return self._bearer_request(self._get_session().get, url, **kwargs)
File "/home/vcap/deps/0/python/lib/python3.9/site-packages/oauth2_client/credentials_manager.py", line 242, in _get_session raise OAuthError(HTTPStatus.UNAUTHORIZED, 'no_token', "no token provided")
oauth2_client.credentials_manager.OAuthError: 401 - no_token : no token provided
Hi,
we are using
cloudfoundry-client==1.30.0
.Our code is part of a servicebroker with the
openbrokerapi
framework. We are trying to access the cf api with aclient_id
and aclient_secret
.Our code is as follows in the constructor:
to access one result we later use:
If the login with
init_with_client_credentials()
is more than 12h ago, the token expires and accessing the api fails with:The stacktrace is part of some more elements, here are the parts from cloudfoundry-client:
I thought https://github.com/cloudfoundry-community/cf-python-client/pull/88 was supposed to fix that problem? Thanks!