I'm trying to create a bearer token to use in an API call later in the script but am running into issues. The test times out after 30 seconds with no meaningful error. I assume my code is correct:
import requests
url = "https://mingle-sso.inforcloudsuite.com:443/TENANT_GOES_HERE/as/token.oauth2"
username = "username"
password = "password"
client_id = "id"
client_secret = "secret"
data_to_send = {
"username": username,
"password": password,
"client_id": client_id,
"client_secret": client_secret,
"grant_type": "password"
}
header = {'Content-Type' : 'application/x-www-form-urlencoded'}
try:
response = requests.post(url, headers=header, data=data_to_send)
response.raise_for_status()
print("Status Code:", response.status_code)
print("Response JSON:", response.json())
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
I also tried using the code conversion tool in Postman to convert the working token call to Python. This unfortunately produces the same result of a 30 second timeout. What is missing in the above? Or is there something that needs to be done in the API Gateway with the service user I chose?
Thank you!