Hello all!
I’m having a problem when using a plus in my username and then trying to authenticate with the API using the python requests package. I’m just curious as to whether it’s a problem with requests, or if it’s a problem with auth0. Basically, what is my problem. Here’s the code I’m using, and here’s what I’m seeing from doing my own digging.
In [1]: requests.post('https://auth.taxbit.com/oauth/token', data={
...: 'grant_type': 'password',
...: 'username': 'ethan+test@taxbit.com',
...: 'password': '<password>',
...: 'client_id': '<CLIENT_ID>'
...: })
Out[1]: <Response [500]>
In [2]: resp.json()
Out[2]:
{'error': 'access_denied',
'error_description': 'Unexpected token < in JSON at position 0'}
In [3]: resp.request.body
Out[3]: 'grant_type=password&username=ethan+test@taxbit.com&password=<password>&client_id=<CLIENT_ID>'
In [4]: resp.request.headers
Out[4]: {'User-Agent': 'python-requests/2.22.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '125', 'Content-Type': 'application/x-www-form-urlencoded'}
The thing that’s really confusing, is I’m not even posting JSON anymore. I’m posting with content-type: application/x-www-form-urlencoded
. Any ideas?