-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Hi,
I have some problems authenticating my sandbox account with the python api.
from uphold import Uphold
api = Uphold(host='api-sandbox.uphold.com')
api.auth( <username>, <password> )
me = api.get_me()
After replacing my username and password.
Traceback (most recent call last):
File "/Users/gunz/work/pebblestudios/bitcube_mbe/bitcube_mbe/app.py", line 56, in <module>
api.auth('nikk699', 'Ff123456')
File "/Users/gunz/work/pebblestudios/bitcube_mbe/bitcube_mbe/core/uphold/uphold.py", line 67, in auth
self.headers['Authorization'] = 'Bearer ' + self.token
TypeError: coercing to Unicode: need string or buffer, NoneType found
Digging deeper leads to an invalid response from you side, on the post request
{'error': 'invalid_client'}
As currently this message does not provide me with any decipherable information, what I might be doing wrong, henceforth I am stuck.
Note: I have already registered a developer application and received a client id and secret, which is apparently not required here to my understanding.
Secondly,
While doing a curl for authentication with basic authentication works perfectly.
curl https://api-sandbox.uphold.v0/me/tok -u username:password
Thirdly,
The request for pat token creation using curl does not work
curl https://api-sandbox.uphold.com/v0/me/tokens -X POST -H "Content-Type: application/json" -u username:password -d '{description":“Hello”}'
And yields 500
{"code":"internal_server_error","message":"Internal Server Error"}
Fourthly,
I understand the python api is using a special payload for OAuth, with rather than generating a temporary code and state check as mentioned in documentation
params = {
'client_id': 'UPHOLD',
'client_secret': 'secret',
'grant_type': 'password',
'username': username,
'password': password
}
The result was again reproducible with curl which leads to an invalid client.
Can you help me figure out if I am doing something wrong or there is something wrong in the backend (most likely not the case).
Also please kindly update the python api with informative error codes.