Skip to content

Commit 1423ee3

Browse files
Merge pull request #282 from jamesmyatt/patch-1
Bug fix: getToken for TG 3.x and username-password pair
2 parents 696a138 + 5768890 commit 1423ee3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pyTigerGraph/common/auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def _parse_token_response(response: dict,
113113
mainVer: int,
114114
base64_credential: str) -> Tuple[Union[Tuple[str, str], str], dict]:
115115
if not response.get("error"):
116-
token = response["token"]
116+
# Note that /requesttoken has sightly different response using username-password pair.
117+
# See https://docs.tigergraph.com/tigergraph-server/3.10/api/built-in-endpoints#_request_a_token
118+
token = response.get("results", response)["token"]
117119
if setToken:
118120
apiToken = token
119121
authHeader = {'Authorization': "Bearer " + apiToken}

0 commit comments

Comments
 (0)