degubowanie
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Jakub K 2024-01-22 22:52:03 +01:00
parent c9dde8d76b
commit 50d26ba2d0

View File

@ -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 = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret,
"redirect_uri": "http://izaac.izaac.pl/noexist/callback"
} }
data = {
"grant_type": "client_credentials"
}
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())