djangorestframework-auth0
djangorestframework-auth0 copied to clipboard
Sanity check on DeprecationWarning
When doing some tests, I kept getting the following DeprecationWarning:
/xxxx/lib/python3.8/site-packages/jwt/api_jwt.py:77: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
I checked and it seems to be caused by these lines in the utils.py file:
if(client['AUTH0_ALGORITHM'].upper() == "RS256"):
logger.debug(
"Using RS256 algorithm"
)
payload = jwt.decode(
auth_token,
client['PUBLIC_KEY'],
audience=client['AUTH0_AUDIENCE'],
algorithm=client['AUTH0_ALGORITHM'],
)
This is the function jwt.decode (im using PyJWT 1.7.1 as per the config).
def decode(self,
jwt, # type: str
key='', # type: str
verify=True, # type: bool
algorithms=None, # type: List[str]
options=None, # type: Dict
**kwargs):
Contrary to the encode function it seems to have a parameter called "algorithms" instead of "algorithm". Would like to know if anyone else ran into this too or I'm overlooking something.