django-oauth-toolkit error: Unable to parse query string

31 views Asked by At

I'm trying to access the /o/authorize/ domain with the following parameters: Postman Parameters

I'm redirected to login at an admin portal and once I successfully login, I get this: "Error: invalid_request. Unable to parse query string"

This is the code I'm using to generate the code_challenge:

import random
import string
import base64
import hashlib

code_verifier = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(random.randint(43, 128)))
code_verifier = base64.urlsafe_b64encode(code_verifier.encode('utf-8'))

code_challenge = hashlib.sha256(code_verifier).digest()
code_challenge = base64.urlsafe_b64encode(code_challenge).decode('utf-8').replace('=', '')

print(fr'code verifier: {code_verifier}')
print(fr'code challenger: {code_challenge}')
0

There are 0 answers