Closed ryanermita closed 6 years ago
base64.b64encode returns bytes, not an str. You need to decode it before you can use it in a format string to create your Authorization header.
>>> client_id = 'A_CLIENT_ID'
>>> client_secret = 'A_CLIENT_SECRET'
>>> encoded = base64.b64encode('{}:{}'.format(client_id, client_secret).encode('utf-8'))
>>> type(encoded)
<class 'bytes'>
>>> print('Basic {}'.format(encoded))
Basic b'QV9DTElFTlRfSUQ6QV9DTElFTlRfU0VDUkVU'
>>> print('Basic {}'.format(encoded.decode('utf-8')))
Basic QV9DTElFTlRfSUQ6QV9DTElFTlRfU0VDUkVU
ohhh thats why! Thank you @jscholes :+1:
I want to implement same code in Javascript please help with that For mass payouts in Epayments.
using client_id and client_secret in payload works fine.
but im curious why does spotify raises invalid_client when im passing my base64encoded client id and client secret?