post_body_data = {
"grant-type": "client_credentials",
"client_assertion_type" : "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"client_assertion" : private_signature
}
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
}
try:
auth_response = requests.post(base_auth_url,headers=headers, data = post_body_data)
auth_response.raise_for_status()
data = auth_response.json()
except requests.exceptions.RequestException as e:
print(f"Request error: {e}")
except json.decoder.JSONDecodeError as e:
print(f"JSON decoding error: {e}")
print(f"Response text: {auth_response.text}")