I'm roughly following this SO questions, and this article. The use case in each is just a bit different than mine.
I'm trying to, given the token and url only, decode the JTW token received from Auth0;
def get_key():
KEY_URL = r"https://dev-dluzlcxa.us.auth0.com/pem"
filename = wget.download(KEY_URL)
public_key = open(filename, 'r').read()
key = public_key.encode()
return key
token = get_token()
key = get_key()
jwt.decode(token, key=key, algorithms=['RS256', ])
For security reasons, I'm not providing the token (or the get_token()) method here, but I have verified using jwt.io that I, indeed, have a valid token. I'v tried various permutations but nothing seems to get me there.
My latest error, in a slew of them, is this;
ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [_OpenSSLErrorWithText(code=151584876, lib=9, reason=108, reason_text=b'error:0909006C:PEM routines:get_name:no start line')])