GDrive OAuth allows for a state parameter to be passed from the request to the response callback. When I send a string that contains a single token, it works as expected, but if I send a json, then I can't seem to read back the value from the state parameter in the callback function.
I have tried using base64.encodestring(), base64.urlsafe_b64encode() and the decode versions of the these functions in the callback but then I get an "Incorrect Padding" error on decode.
To correct this, I tried the following snippet I found on StackOverflow:
`stateStr += "=" * ((4 - len(stateStr) % 4) % 4)`
`stateList = base64.urlsafe_b64decode(stateStr)`
But I still get the "Incorrect Padding" error.
Any help will be appreciated,
Thanks
EDIT The workaround to this problem was for me to separate the strings by using a '|' char. That way I'm still passing a single string which works fine without any padding errors. EDIT