I have this code:
import requests
import json
data={"client_id" : "a", "client_secret" : "thisissecret", "grant_type" : "clientcredentials", "scope" : "PublicApi"}
url = 'http://MYURL/connect/token'
response = requests.post(url, json=data, verify=False)
print(response)
print response.reason
print(response.json())
I'm trying to test connection to a new auth service in test environment (which is why verify is FALSE) This should give me the access token and the token type and with them I can POST to the API.
But I always get:
<Response [400]> Bad Request {u'error': u'invalid_request'}
I'm not sure what is the problem? Why is it a bad request?
json=datatojson=json.dumps(data)but callimport jsonfirst.