This commit is contained in:
parent
c9dde8d76b
commit
50d26ba2d0
@ -101,16 +101,16 @@ class GetAuthTokenView(APIView):
|
|||||||
credential = "{0}:{1}".format(client_id, client_secret)
|
credential = "{0}:{1}".format(client_id, client_secret)
|
||||||
base64.b64encode(credential.encode("utf-8"))
|
base64.b64encode(credential.encode("utf-8"))
|
||||||
|
|
||||||
headers = {'Content-Type': 'application/x-www-form-urlencoded',
|
headers = {
|
||||||
'Authorization': 'Basic '+credential,
|
"Authorization": f"Basic {credential}",
|
||||||
'Cache-Control': 'no-cache'
|
"Cache-Control": "no-cache",
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded"
|
||||||
}
|
}
|
||||||
data = {
|
data = {
|
||||||
"grant_type": "client_credentials",
|
"grant_type": "client_credentials"
|
||||||
"client_id": client_id,
|
|
||||||
"client_secret": client_secret,
|
|
||||||
"redirect_uri": "http://izaac.izaac.pl/noexist/callback"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print("DATA READY")
|
print("DATA READY")
|
||||||
response = requests.post('http://izaac.izaac.pl/o/token/'+"grant_type=client_credentials", headers=headers)
|
response = requests.post('http://izaac.izaac.pl/o/token/', headers=headers, data=data)
|
||||||
|
print(response.text)
|
||||||
return Response(response.json())
|
return Response(response.json())
|
||||||
Loading…
x
Reference in New Issue
Block a user