Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanity check on DeprecationWarning #55

Open
robindebois opened this issue Jan 2, 2021 · 0 comments
Open

Sanity check on DeprecationWarning #55

robindebois opened this issue Jan 2, 2021 · 0 comments

Comments

@robindebois
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant