Not able to get token using getToken command in TigerGraph

Hi I am not able to get token using getToken command in TigerGraph. The python script is keep on running and not giving me the token.

@ranojitsingh Is it generating any errors? Is there a screenshot or additional information you can share to help us resolve the issue?

@Jon_Herke I am not getting any error. But the script is keep on running only for infinite time, and eventually I need to stop the script. Below is the script I am using for connecting

conn = tg.TigerGraphConnection(
host=‘http://localhost’,
graphname = ‘MyGraph’,
username=‘tigergraph’,
password=‘tigergraph’)

secret = conn.createSecret()
token = conn.getToken(secret)
print(token)

The line which is keep on running is “token = conn.getToken(secret)”, secret token is getting generated in TigerGraph Admin portal

@ranojitsingh Here are a few steps you can take to troubleshoot the issue:

  1. Check Connection Parameters: Ensure that the connection parameters such as host, graphname, username, and password are correctly set to match your TigerGraph instance.
  2. Verify Secret Creation: Double-check that the createSecret() method is successfully generating a secret. You can print the secret variable to ensure that it’s not empty.
  3. Verify Token Generation: If you have access to the TigerGraph Admin portal, you can manually verify that the secret you generated corresponds to a valid application token. Ensure that the secret has the necessary privileges to access the specified graph