2π
β
I still think there should be something more straight forward or a bug fix to this, but hereβs my own workaround:
def oauth_decode(data):
import json
new_data = data.decode("utf-8", "strict")
return json.loads(new_data)
...
session = sso.get_auth_session(data=data, decoder=oauth_decode)
The problem is that get_auth_session
decodes the byte stream from the response to UTF-8 by default. If you specify a new decoder, you override that. So I guess we need both here (UTF-8 + JSON).
π€Leonardo Pessoa
Source:stackexchange.com