in libs/google/admin.py [0:0]
def list_tokens(self, user_key):
"""
Lists a user's OAuth Tokens.
:param user_key: userKey
:return: list of OAuth Token clientIds
"""
try:
client_ids = []
r = json.loads(self.call_google_api(service=self.service,
api_resource="tokens",
api_method="list",
response_field="items",
userKey=user_key))
if r is not None:
for token in r:
client_ids.append(token["clientId"])
return client_ids
except(ValueError, KeyError, TypeError):
return None