One issue that might be happening is that when its encoded to an callback URL, it's including characters that aren't URL safe. Try using base64.urlsafe_b64encode(str(encoded)) .
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.