{
  "id": "task_libraries:jwt/python",
  "path": "/exapedia/python-jwt-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python JWT libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python JWT libraries create, sign, and verify JSON Web Tokens, the signed tokens that carry identity claims between services. Libraries that implement the full JOSE standards also encrypt tokens and manage the keys that sign them. These libraries let APIs and AI agents check who sent each request."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python JWT libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#pyjwt-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F157"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#authlib-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F174"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#joserfc",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F191"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-jose",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwcrypto",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwt",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwskate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F253"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F262"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#pyjwt-library",
          "label": [
            {
              "t": "text",
              "text": "PyJWT"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F158"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "JWE encryption",
            "EdDSA signatures"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#pyjwt-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F157"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#authlib-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F174"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#joserfc",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F191"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-jose",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwcrypto",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwt",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwskate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F253"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F263"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "pyjwt-library",
          "name": [
            {
              "t": "fact",
              "fact": "F157"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/jpadilla/pyjwt"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyjwt"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/pyjwt/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F164"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/pyjwt/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F157"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/mozilla/mozilla-django-oidc",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F172"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def retrieve_matching_jwk(self, token):\n    \"\"\"Get the signing key by exploring the JWKS endpoint of the OP.\n\n    Don't use jwt.PyJWKClient()get_signing_key_from_jwt() because it doesn't check\n    the algorithm in case of multiple jwk with the same kid.\n    \"\"\"\n    response_jwks = requests.get(\n        self.OIDC_OP_JWKS_ENDPOINT,\n        verify=self.get_settings(\"OIDC_VERIFY_SSL\", True),\n        timeout=self.get_settings(\"OIDC_TIMEOUT\", None),\n        proxies=self.get_settings(\"OIDC_PROXY\", None),\n    )\n    response_jwks.raise_for_status()\n    jwks = response_jwks.json()\n\n    # Compute the current header from the given token to find a match\n    jws = jwt.get_unverified_header(token)\n\n    key = None\n    for jwk in jwks[\"keys\"]:\n        if import_from_settings(\"OIDC_VERIFY_KID\", True) and jwk[\n            \"kid\"\n        ] != smart_str(jws[\"kid\"]):\n            continue\n        if \"alg\" in jwk and jwk[\"alg\"] != smart_str(jws[\"alg\"]):\n            continue\n        key = jwk\n    if key is None:\n        raise SuspiciousOperation(\"Could not find a valid JWKS.\")\n    return jwt.PyJWK(key)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/mozilla/mozilla-django-oidc/blob/86660c22c842d935551e3da7ab14709e53facd12/mozilla_django_oidc/auth.py#L151-L180",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F171"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pyjwt%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F157"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import os\nimport jwt\ntoken = jwt.encode({'sub': '123'}, os.environ['JWT_SECRET'], algorithm='HS256')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pyjwt.readthedocs.io/en/stable/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "api.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F162"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "authlib-library",
          "name": [
            {
              "t": "fact",
              "fact": "F174"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/authlib/authlib"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/authlib"
            },
            {
              "label": "Docs",
              "href": "https://docs.authlib.org/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F181"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.authlib.org/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F174"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/element-hq/synapse",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F189"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def _verify_jwt(\n    self,\n    alg_values: list[str],\n    token: str,\n    claims_cls: type[C],\n    claims_options: dict | None = None,\n    claims_params: dict | None = None,\n) -> C:\n    \"\"\"Decode and validate a JWT, re-fetching the JWKS as needed.\n\n    Args:\n        alg_values: list of `alg` values allowed when verifying the JWT.\n        token: the JWT.\n        claims_cls: the JWTClaims class to use to validate the claims.\n        claims_options: dict of options passed to the `claims_cls` constructor.\n        claims_params: dict of params passed to the `claims_cls` constructor.\n\n    Returns:\n        The decoded claims in the JWT.\n    \"\"\"\n    jwt = JsonWebToken(alg_values)\n\n    logger.debug(\"Attempting to decode JWT (%s) %r\", claims_cls.__name__, token)\n\n    # Try to decode the keys in cache first, then retry by forcing the keys\n    # to be reloaded\n    jwk_set = await self.load_jwks()\n    try:\n        claims = jwt.decode(\n            token,\n            key=jwk_set,\n            claims_cls=claims_cls,\n            claims_options=claims_options,\n            claims_params=claims_params,\n        )\n    except ValueError:\n        logger.info(\"Reloading JWKS after decode error\")\n        jwk_set = await self.load_jwks(force=True)  # try reloading the jwks\n        claims = jwt.decode(\n            token,\n            key=jwk_set,\n            claims_cls=claims_cls,\n            claims_options=claims_options,\n            claims_params=claims_params,\n        )\n\n    logger.debug(\"Decoded JWT (%s) %r; validating\", claims_cls.__name__, claims)\n\n    claims.validate(\n        now=self._clock.time(), leeway=120\n    )  # allows 2 min of clock skew\n    return claims",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/element-hq/synapse/blob/5ed830b3b4c74c89d876cc07756c5d98a100cbed/synapse/handlers/oidc.py#L958-L1009",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F188"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=authlib%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F174"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from authlib.jose import jwt\nwith open('private.pem', 'rb') as key_file:\n    token = jwt.encode({'alg': 'RS256'}, {'sub': '123'}, key_file.read())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.authlib.org/en/latest/jose/jwt.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "jwt.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F179"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "joserfc",
          "name": [
            {
              "t": "fact",
              "fact": "F191"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/authlib/joserfc"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/joserfc"
            },
            {
              "label": "Docs",
              "href": "https://jose.authlib.org/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F63"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://jose.authlib.org/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F191"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F71"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F72"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F73"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/authlib/authlib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F204"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def _decode_jwt(self, value, metadata, algorithms):\n    \"\"\"Decode a JWT signed with a key of the provider JWK set.\"\"\"\n    registry = JWSRegistry(algorithms=algorithms, strict_check_header=False)\n    key_set = KeySet.import_key_set(await self.fetch_jwk_set())\n    try:\n        return jwt.decode(value, key=key_set, registry=registry)\n    except InvalidKeyIdError:\n        if metadata.get(\"jwks_uri\") and not _may_refresh_jwk_set(self):\n            raise\n\n    key_set = KeySet.import_key_set(await self.fetch_jwk_set(force=True))\n    return jwt.decode(value, key=key_set, registry=registry)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/authlib/authlib/blob/549bda30e72d605673f065f4c44b2cead53c6621/authlib/integrations/base_client/async_openid.py#L49-L60",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F203"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20that%20use%20joserfc%20for%20signed%20token%20verification%2C%20JWT%20claims%2C%20key%20selection%20and%20authentication%20integrations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F191"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from joserfc import jwt\nfrom joserfc.jwk import OctKey\nkey = OctKey.generate_key()\ntoken = jwt.encode({'alg': 'HS256'}, {'sub': '123'}, key)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://jose.authlib.org/en/guide/jwt/",
                  "label": [
                    {
                      "t": "text",
                      "text": "jwt.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F196"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "python-jose",
          "name": [
            {
              "t": "fact",
              "fact": "F206"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/mpdavis/python-jose"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/python-jose"
            },
            {
              "label": "Docs",
              "href": "https://python-jose.readthedocs.io/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F86"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://python-jose.readthedocs.io/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F87"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F88"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F89"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F90"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F91"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F92"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/wecode-ai/Wegent",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F219"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def verify_token(token: str) -> Dict[str, Any]:\n    \"\"\"\n    Verify token\n\n    Args:\n        token: Authentication token\n\n    Returns:\n        Data contained in the token\n\n    Raises:\n        HTTPException: Exception thrown when token is invalid\n    \"\"\"\n    credentials_exception = HTTPException(\n        status_code=status.HTTP_401_UNAUTHORIZED,\n        detail=\"Could not validate credentials\",\n        headers={\"WWW-Authenticate\": \"Bearer\"},\n    )\n\n    try:\n        payload = jwt.decode(\n            token, settings.SECRET_KEY, algorithms=[settings.ALGORITHM]\n        )\n        if not is_user_session_payload(payload):\n            raise credentials_exception\n        username: str = payload.get(\"sub\")\n        if username is None:\n            raise credentials_exception\n        token_data = TokenData(username=username)\n        return {\"username\": token_data.username}\n    except JWTError:\n        raise credentials_exception",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/wecode-ai/Wegent/blob/4e3383794ad1ba8f3cfcbd7d316bf54604f454a6/backend/app/core/security.py#L264-L295",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20that%20use%20python-jose%20for%20signed%20token%20verification%2C%20JWT%20claims%2C%20key%20selection%20and%20authentication%20integrations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import os\nfrom jose import jwt\ntoken = jwt.encode({'sub': '123'}, os.environ['JWT_SECRET'], algorithm='HS256')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/python-jose/3.5.0/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F211"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "jwcrypto",
          "name": [
            {
              "t": "fact",
              "fact": "F221"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/latchset/jwcrypto"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/jwcrypto"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/jwcrypto/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F110"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/jwcrypto/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F221"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F111"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F112"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F113"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F114"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F115"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F116"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/istio/istio",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F234"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def main(args):\n    \"\"\"Generates a signed JSON Web Token from local private key.\"\"\"\n    with open(args.key) as f:\n        pem_data = f.read()\n    f.closed\n\n    pem_data_encode = pem_data.encode(\"utf-8\")\n    key = jwk.JWK.from_pem(pem_data_encode)\n\n    if args.jwks:\n        with open(args.jwks, \"w+\") as fout:\n            fout.write(\"{ \\\"keys\\\":[ \")\n            fout.write(key.export(private_key=False))\n            fout.write(\"]}\")\n        fout.close\n\n    now = int(time.time())\n    payload = {\n        # expire in one hour.\n        \"exp\": now + args.expire,\n        \"iat\": now,\n    }\n    if args.iss:\n        payload[\"iss\"] = args.iss\n    if args.sub:\n        payload[\"sub\"] = args.sub\n    else:\n        payload[\"sub\"] = args.iss\n\n    if args.aud:\n        if \",\" in args.aud:\n            payload[\"aud\"] = args.aud.split(\",\")\n        else:\n            payload[\"aud\"] = args.aud\n\n    if args.claims:\n        for item in args.claims.split(\",\"):\n            k, v = item.split(':')\n            payload[k] = v\n\n    if args.listclaim:\n        for item in args.listclaim:\n            if (len(item) > 1):\n                k = item[0]\n                v = item[1:]\n                payload[k] = v\n\n    if args.nestedclaim:\n        nested = {}\n        for item in args.nestedclaim:\n            if (len(item) > 1):\n                k = item[0]\n                v = item[1:]\n                if len(v) == 1:\n                    v = v[0]\n                nested[k] = v\n        nested[\"nested-2\"] = copy.copy(nested)\n        payload[args.nestedkey] = nested\n\n    token = jwt.JWT(header={\"alg\": \"RS256\", \"typ\": \"JWT\", \"kid\": key.key_id},\n                    claims=payload)\n\n    token.make_signed_token(key)\n\n    return token.serialize()",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/istio/istio/blob/3b89051c0e92164421bbc83c893e48b3bd0186ef/security/tools/jwt/samples/gen-jwt.py#L30-L94",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F233"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20that%20use%20jwcrypto%20for%20signed%20token%20verification%2C%20JWT%20claims%2C%20key%20selection%20and%20authentication%20integrations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F221"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from jwcrypto import jwk, jwt\nkey = jwk.JWK.generate(kty='oct', size=256)\ntoken = jwt.JWT(header={'alg': 'HS256'}, claims={'sub': '123'})\ntoken.make_signed_token(key)\nserialized = token.serialize()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://jwcrypto.readthedocs.io/en/latest/jwt.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "jwt.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F226"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "jwt",
          "name": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/GehirnInc/python-jwt"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/jwt"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/jwt/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F243"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/jwt/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/unclecode/crawl4ai",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F251"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def create_access_token(data: dict, expires_delta: Optional[timedelta] = None) -> str:\n    \"\"\"Create a JWT access token with an expiration.\"\"\"\n    to_encode = data.copy()\n    expire = datetime.now(timezone.utc) + (expires_delta or timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES))\n    to_encode.update({\"exp\": get_int_from_datetime(expire)})\n    signing_key = get_jwk_from_secret(SECRET_KEY)\n    return instance.encode(to_encode, signing_key, alg='HS256')",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/unclecode/crawl4ai/blob/55de32d92594721e2ad4df59e74fe15769e0a978/deploy/docker/auth.py#L23-L29",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F250"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=jwt%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from jwt import JWT, jwk_from_pem\nwith open('private.pem', 'rb') as key_file:\n    key = jwk_from_pem(key_file.read())\ntoken = JWT().encode({'sub': '123'}, key, alg='RS256')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/GehirnInc/python-jwt",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "jwskate",
          "name": [
            {
              "t": "fact",
              "fact": "F253"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/guillp/jwskate"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/jwskate"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/jwskate/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F260"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F262"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/jwskate/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F253"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from jwskate import Jwk, Jwt\nkey = Jwk.generate(alg='ES256')\ntoken = Jwt.sign({'sub': '123'}, key)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://guillp.github.io/jwskate/usage/",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=jwskate%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F253"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F258"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python JWT library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#pyjwt-library",
          "label": [
            {
              "t": "text",
              "text": "PyJWT"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits applications that sign and verify tokens and fetch keys from a JWKS endpoint. "
        },
        {
          "t": "link",
          "href": "#joserfc",
          "label": [
            {
              "t": "text",
              "text": "joserfc"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#jwcrypto",
          "label": [
            {
              "t": "text",
              "text": "JWCrypto"
            }
          ]
        },
        {
          "t": "text",
          "text": " suit applications that also need encrypted tokens. "
        },
        {
          "t": "link",
          "href": "#authlib-library",
          "label": [
            {
              "t": "text",
              "text": "Authlib"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits applications that build OAuth or OpenID Connect clients and servers alongside their token handling."
        }
      ]
    },
    {
      "q": "What is PyJWT?",
      "a": [
        {
          "t": "link",
          "href": "#pyjwt-library",
          "label": [
            {
              "t": "text",
              "text": "PyJWT"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a JSON Web Token implementation for Python that encodes and decodes signed tokens. Its PyJWKClient fetches signing keys from a JWKS endpoint."
        }
      ]
    },
    {
      "q": "What is python-jose?",
      "a": [
        {
          "t": "link",
          "href": "#python-jose",
          "label": [
            {
              "t": "text",
              "text": "python-jose"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a JOSE implementation that signs, encrypts, and handles keys. It runs on the cryptography package, PyCryptodome, or a native Python backend."
        }
      ]
    },
    {
      "q": "What is joserfc?",
      "a": [
        {
          "t": "link",
          "href": "#joserfc",
          "label": [
            {
              "t": "text",
              "text": "joserfc"
            }
          ]
        },
        {
          "t": "text",
          "text": " implements the JOSE standards, including JWS, JWE, JWK, and JWT. It decodes a token and validates its claims as separate steps."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, PyJWT",
      "display": "PyJWT",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, PyJWT",
      "display": "735.7M",
      "asOf": "2026-11-17"
    },
    "F3": {
      "label": "License, PyJWT",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, PyJWT",
      "display": "2.15.1, Sep 2026",
      "asOf": "2026-09-28"
    },
    "F5": {
      "label": "Package release date, PyJWT",
      "display": "Sep 2026",
      "asOf": "2026-09-28"
    },
    "F6": {
      "label": "Repository stars, PyJWT",
      "display": "5.7K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Asymmetric signatures, PyJWT",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "JWK sets, PyJWT",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Claim validation, PyJWT",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Install, PyJWT",
      "display": "pip install \"PyJWT[crypto]\"",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "What it does, PyJWT",
      "display": "Encodes and verifies signed JSON Web Tokens in Python.",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths lead, PyJWT",
      "display": "Encodes and verifies signed tokens",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths, PyJWT",
      "display": "Encode claims and verify tokens with jwt.encode() and jwt.decode().",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, PyJWT",
      "display": "Loads signing keys from JWKS",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, PyJWT",
      "display": "Use PyJWKClient to select the signing key for a token.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations lead, PyJWT",
      "display": "Missing claims need explicit requirements",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations, PyJWT",
      "display": "Use require to reject tokens missing mandatory claims.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, PyJWT",
      "display": "Asymmetric signing needs cryptography",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, PyJWT",
      "display": "Install the crypto extra for RSA or ECDSA signatures.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Quickstart, PyJWT",
      "display": "import jwt\nencoded_jwt = jwt.encode({\"some\": \"payload\"}, \"secret\", algorithm=\"HS256\")\njwt.decode(encoded_jwt, \"secret\", algorithms=[\"HS256\"])\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function, PyJWT",
      "display": "def _verify_jws(self, payload, key):\n    \"\"\"Verify the given JWS payload with the given key and return the payload\"\"\"\n    jws = jwt.get_unverified_header(payload)\n\n    try:\n        alg = jws[\"alg\"]\n    except KeyError:\n        msg = \"No alg value found in header\"\n        raise SuspiciousOperation(msg)\n\n    if alg != self.OIDC_RP_SIGN_ALGO:\n        msg = (\n            \"The provider algorithm {!r} does not match the client's \"\n            \"OIDC_RP_SIGN_ALGO.\".format(alg)\n        )\n        raise SuspiciousOperation(msg)\n\n    try:\n        # Maybe add a settings to enforce audiance validation\n        return jwt.decode(\n            payload, key, algorithms=alg, options={\"verify_aud\": False}\n        )\n    except jwt.DecodeError:\n        msg = \"JWS token verification failed.\"\n        raise SuspiciousOperation(msg)\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function reference, PyJWT",
      "display": "auth.py · _verify_jws()",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project repository, PyJWT",
      "display": "mozilla/mozilla-django-oidc",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project stars, mozilla/mozilla-django-oidc",
      "display": "560",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project push date, mozilla/mozilla-django-oidc",
      "display": "Jan 2026",
      "asOf": "2026-01-07"
    },
    "F26": {
      "label": "Library name, Authlib",
      "display": "Authlib",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Monthly downloads, Authlib",
      "display": "130.2M",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "License, Authlib",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Package release, Authlib",
      "display": "1.9.6, Nov 2026",
      "asOf": "2026-11-14"
    },
    "F30": {
      "label": "Package release date, Authlib",
      "display": "Nov 2026",
      "asOf": "2026-11-14"
    },
    "F31": {
      "label": "Repository stars, Authlib",
      "display": "5.5K",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Asymmetric signatures, Authlib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "JWK sets, Authlib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Claim validation, Authlib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Token encryption, Authlib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Install, Authlib",
      "display": "pip install Authlib",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "What it does, Authlib",
      "display": "Provides legacy JOSE JWT APIs with configurable claim classes and rules.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths lead, Authlib",
      "display": "Customizes JWT claim rules",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths, Authlib",
      "display": "Supply claim classes, required values, and custom claim validators.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, Authlib",
      "display": "Selects keys from JWK sets",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, Authlib",
      "display": "Resolve the signing key from the token’s key identifier.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations lead, Authlib",
      "display": "JOSE API is deprecated",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations, Authlib",
      "display": "Use joserfc for new JOSE integrations.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, Authlib",
      "display": "Decoded claims need validation",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, Authlib",
      "display": "Call claims.validate() after decoding to enforce the configured claim rules.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, Authlib",
      "display": "from authlib.jose import jwt\n\njwt.encode({\"alg\": \"HS256\"}, {\"iss\": \"https://jose.authlib.org\"}, \"your-secret-key\")\n\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, Authlib",
      "display": "async def _verify_jwt(\n    self,\n    alg_values: list[str],\n    token: str,\n    claims_cls: type[C],\n    claims_options: dict | None = None,\n    claims_params: dict | None = None,\n) -> C:\n    # ...\n    jwt = JsonWebToken(alg_values)\n\n    logger.debug(\"Attempting to decode JWT (%s) %r\", claims_cls.__name__, token)\n\n    # Try to decode the keys in cache first, then retry by forcing the keys\n    # to be reloaded\n    jwk_set = await self.load_jwks()\n    try:\n        claims = jwt.decode(\n            token,\n            key=jwk_set,\n            claims_cls=claims_cls,\n            claims_options=claims_options,\n            claims_params=claims_params,\n        )\n    except ValueError:\n        logger.info(\"Reloading JWKS after decode error\")\n        jwk_set = await self.load_jwks(force=True)  # try reloading the jwks\n        claims = jwt.decode(\n            token,\n            key=jwk_set,\n            claims_cls=claims_cls,\n            claims_options=claims_options,\n            claims_params=claims_params,\n        )\n\n    logger.debug(\"Decoded JWT (%s) %r; validating\", claims_cls.__name__, claims)\n\n    claims.validate(\n        now=self._clock.time(), leeway=120\n    )  # allows 2 min of clock skew\n    return claims\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, Authlib",
      "display": "oidc.py · _verify_jwt()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, Authlib",
      "display": "element-hq/synapse",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, element-hq/synapse",
      "display": "4.8K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, element-hq/synapse",
      "display": "Nov 2026",
      "asOf": "2026-11-13"
    },
    "F52": {
      "label": "Library name, joserfc",
      "display": "joserfc",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, joserfc",
      "display": "122.2M",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "License, joserfc",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, joserfc",
      "display": "1.8.0, Nov 2026",
      "asOf": "2026-11-03"
    },
    "F56": {
      "label": "Package release date, joserfc",
      "display": "Nov 2026",
      "asOf": "2026-11-03"
    },
    "F57": {
      "label": "Repository stars, joserfc",
      "display": "184",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Asymmetric signatures, joserfc",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "JWK sets, joserfc",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Claim validation, joserfc",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Token encryption, joserfc",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Install, joserfc",
      "display": "pip install joserfc",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "What it does, joserfc",
      "display": "Provides JOSE JWT encoding, decoding, and separate claim validation.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, joserfc",
      "display": "Supports signed and encrypted JWTs",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, joserfc",
      "display": "Choose signed tokens or encrypted tokens through the JWT API.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, joserfc",
      "display": "Checks required and allowed claims",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, joserfc",
      "display": "Use JWTClaimsRegistry to require claims and restrict accepted values.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "strengths lead, joserfc",
      "display": "Replaces deprecated Authlib JOSE",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "strengths, joserfc",
      "display": "Use the separate JOSE library when migrating Authlib JWT code.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations lead, joserfc",
      "display": "Decoding skips claim validation",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations, joserfc",
      "display": "Validate token.claims separately with JWTClaimsRegistry.",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "limitations lead, joserfc",
      "display": "Encryption needs its own registry",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "limitations, joserfc",
      "display": "Pass JWERegistry when encoding or decoding encrypted JWTs.",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Quickstart, joserfc",
      "display": "from joserfc import jwt, jwk\nfrom joserfc.jwk import OctKey\n\nheader = {\"alg\": \"HS256\"}\nclaims = {\"iss\": \"https://authlib.org\"}\nkey = jwk.import_key(\"your-secret-key\", \"oct\")\ntext = jwt.encode(header, claims, key)\n\n",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Library name, python-jose",
      "display": "python-jose",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Monthly downloads, python-jose",
      "display": "30.7M",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "License, python-jose",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Package release, python-jose",
      "display": "3.5.0, May 2025",
      "asOf": "2025-05-28"
    },
    "F79": {
      "label": "Package release date, python-jose",
      "display": "May 2025",
      "asOf": "2025-05-28"
    },
    "F80": {
      "label": "Repository stars, python-jose",
      "display": "1.8K",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Asymmetric signatures, python-jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "JWK sets, python-jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Claim validation, python-jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Token encryption, python-jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Install, python-jose",
      "display": "pip install \"python-jose[cryptography]\"",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "What it does, python-jose",
      "display": "Implements JOSE signing, encryption, and key handling in Python.",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths lead, python-jose",
      "display": "Signs and encrypts JOSE messages",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths, python-jose",
      "display": "Use separate JWS and JWE APIs for signing and encryption.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths lead, python-jose",
      "display": "Offers cryptographic backend choices",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths, python-jose",
      "display": "Choose the cryptography, pycryptodome, or native Python backend.",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "limitations lead, python-jose",
      "display": "Native backend cannot read certificates",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "limitations, python-jose",
      "display": "Use the cryptography backend when keys arrive as certificates.",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Quickstart, python-jose",
      "display": "from jose import jwt\ntoken = jwt.encode({'key': 'value'}, 'secret', algorithm='HS256')\njwt.decode(token, 'secret', algorithms=['HS256'])\n",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project function, python-jose",
      "display": "def create_access_token(\n    data: Dict[str, Any], expires_delta: Optional[int] = None\n) -> str:\n    \"\"\"\n    Create access token\n\n    Args:\n        data: Token data\n        expires_delta: Expiration time (minutes)\n\n    Returns:\n        Access token\n    \"\"\"\n    from datetime import timezone\n\n    to_encode = data.copy()\n    if expires_delta:\n        expire = datetime.now(timezone.utc) + timedelta(minutes=expires_delta)\n    else:\n        expire = datetime.now(timezone.utc) + timedelta(\n            minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES\n        )\n    to_encode.update({\"exp\": expire})\n    encoded_jwt = jwt.encode(\n        to_encode, settings.SECRET_KEY, algorithm=settings.ALGORITHM\n    )\n    return encoded_jwt\n",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Project function reference, python-jose",
      "display": "security.py · create_access_token()",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Project repository, python-jose",
      "display": "wecode-ai/Wegent",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project stars, wecode-ai/Wegent",
      "display": "888",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Project push date, wecode-ai/Wegent",
      "display": "Nov 2026",
      "asOf": "2026-11-15"
    },
    "F99": {
      "label": "Library name, jwcrypto",
      "display": "JWCrypto",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Monthly downloads, jwcrypto",
      "display": "18.2M",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "License, jwcrypto",
      "display": "LGPL-3.0-or-later",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Package release, jwcrypto",
      "display": "1.6.1, Sep 2026",
      "asOf": "2026-09-15"
    },
    "F103": {
      "label": "Package release date, jwcrypto",
      "display": "Sep 2026",
      "asOf": "2026-09-15"
    },
    "F104": {
      "label": "Repository stars, jwcrypto",
      "display": "481",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Asymmetric signatures, jwcrypto",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "JWK sets, jwcrypto",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Claim validation, jwcrypto",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Token encryption, jwcrypto",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Install, jwcrypto",
      "display": "pip install jwcrypto",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "What it does, jwcrypto",
      "display": "Creates signed or encrypted JSON Web Token objects.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "strengths lead, jwcrypto",
      "display": "Encrypts token payloads",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "strengths, jwcrypto",
      "display": "Create encrypted JWTs with make_encrypted_token().",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "strengths lead, jwcrypto",
      "display": "Accepts JSON Web Key sets",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "strengths, jwcrypto",
      "display": "Pass a JWKSet when verification needs a set of candidate keys.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "limitations lead, jwcrypto",
      "display": "Missing expiry is accepted",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "limitations, jwcrypto",
      "display": "Set check_claims when expiration must be present.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "Quickstart, jwcrypto",
      "display": "from jwcrypto import jwt, jwk\nkey = jwk.JWK(generate='oct', size=256)\nkey.export()  # doctest: +ELLIPSIS\nToken = jwt.JWT(header={\"alg\": \"HS256\"},\n                claims={\"info\": \"I'm a signed token\"})\nToken.make_signed_token(key)\nToken.serialize()       #doctest: +ELLIPSIS\n",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "Project function, jwcrypto",
      "display": "def main(args):\n    \"\"\"Generates a signed JSON Web Token from local private key.\"\"\"\n    with open(args.key) as f:\n        pem_data = f.read()\n    f.closed\n\n    pem_data_encode = pem_data.encode(\"utf-8\")\n    key = jwk.JWK.from_pem(pem_data_encode)\n\n    if args.jwks:\n        with open(args.jwks, \"w+\") as fout:\n            fout.write(\"{ \\\"keys\\\":[ \")\n            fout.write(key.export(private_key=False))\n            fout.write(\"]}\")\n        fout.close\n\n    now = int(time.time())\n    payload = {\n        # expire in one hour.\n        \"exp\": now + args.expire,\n        \"iat\": now,\n    }\n    if args.iss:\n        payload[\"iss\"] = args.iss\n    if args.sub:\n        payload[\"sub\"] = args.sub\n    else:\n        payload[\"sub\"] = args.iss\n\n    if args.aud:\n        if \",\" in args.aud:\n            payload[\"aud\"] = args.aud.split(\",\")\n        else:\n            payload[\"aud\"] = args.aud\n\n    if args.claims:\n        for item in args.claims.split(\",\"):\n            k, v = item.split(':')\n            payload[k] = v\n\n    if args.listclaim:\n        for item in args.listclaim:\n            if (len(item) > 1):\n                k = item[0]\n                v = item[1:]\n                payload[k] = v\n\n    if args.nestedclaim:\n        nested = {}\n        for item in args.nestedclaim:\n            if (len(item) > 1):\n                k = item[0]\n                v = item[1:]\n                if len(v) == 1:\n                    v = v[0]\n                nested[k] = v\n        nested[\"nested-2\"] = copy.copy(nested)\n        payload[args.nestedkey] = nested\n\n    token = jwt.JWT(header={\"alg\": \"RS256\", \"typ\": \"JWT\", \"kid\": key.key_id},\n                    claims=payload)\n\n    token.make_signed_token(key)\n\n    return token.serialize()\n",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "Project function reference, jwcrypto",
      "display": "gen-jwt.py · main()",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "Project repository, jwcrypto",
      "display": "istio/istio",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "Project stars, istio/istio",
      "display": "38.5K",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "Project push date, istio/istio",
      "display": "Nov 2026",
      "asOf": "2026-11-15"
    },
    "F123": {
      "label": "Developer need",
      "display": "Signed token basics",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "Why choose PyJWT",
      "display": "encode and verify signed tokens",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "Developer need in introduction",
      "display": "signed token basics",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "When to consider joserfc",
      "display": "tokens also need encryption",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "Developer need",
      "display": "Alternative cryptographic backends",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "Why choose python-jose",
      "display": "selectable cryptographic backends",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "Developer need in introduction",
      "display": "alternative cryptographic backends",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "When to consider jwcrypto",
      "display": "verification uses JWKSet objects",
      "asOf": "2026-11-17"
    },
    "F131": {
      "label": "Developer need",
      "display": "Existing Authlib claim customizations",
      "asOf": "2026-11-17"
    },
    "F132": {
      "label": "Why choose Authlib",
      "display": "configurable claim classes and rules",
      "asOf": "2026-11-17"
    },
    "F133": {
      "label": "Developer need in introduction",
      "display": "existing Authlib claim customizations",
      "asOf": "2026-11-17"
    },
    "F134": {
      "label": "When to consider joserfc",
      "display": "moving off deprecated JOSE APIs",
      "asOf": "2026-11-17"
    },
    "F135": {
      "label": "Developer need",
      "display": "Encrypted token workflows",
      "asOf": "2026-11-17"
    },
    "F136": {
      "label": "Why choose jwcrypto",
      "display": "encrypted JWT support",
      "asOf": "2026-11-17"
    },
    "F137": {
      "label": "Developer need in introduction",
      "display": "encrypted token workflows",
      "asOf": "2026-11-17"
    },
    "F138": {
      "label": "When to consider python-jose",
      "display": "alternate crypto backends matter",
      "asOf": "2026-11-17"
    },
    "F139": {
      "label": "Developer need",
      "display": "Replacing Authlib JOSE",
      "asOf": "2026-11-17"
    },
    "F140": {
      "label": "Why choose joserfc",
      "display": "dedicated JOSE replacement",
      "asOf": "2026-11-17"
    },
    "F141": {
      "label": "Developer need in introduction",
      "display": "replacing Authlib JOSE",
      "asOf": "2026-11-17"
    },
    "F142": {
      "label": "When to consider PyJWT",
      "display": "only signed token encoding and verification are needed",
      "asOf": "2026-11-17"
    },
    "F143": {
      "label": "Page introduction",
      "display": "Python JWT libraries let application developers create and verify JSON Web Tokens.",
      "asOf": "2026-11-17"
    },
    "F144": {
      "label": "FAQ: What is the best Python JWT library?",
      "display": "Choose PyJWT for signed token encoding and verification.",
      "asOf": "2026-11-17"
    },
    "F145": {
      "label": "FAQ: What is the best Python JWT library?",
      "display": "Consider JWCrypto when the workflow requires encrypted JWTs.",
      "asOf": "2026-11-17"
    },
    "F146": {
      "label": "FAQ: What is the best Python JWT library?",
      "display": "Use joserfc when replacing deprecated Authlib JOSE code.",
      "asOf": "2026-11-17"
    },
    "F147": {
      "label": "FAQ: PyJWT vs python-jose: which should I choose?",
      "display": "PyJWT provides a direct API for signed token encoding and verification.",
      "asOf": "2026-11-17"
    },
    "F148": {
      "label": "FAQ: PyJWT vs python-jose: which should I choose?",
      "display": "python-jose also exposes a JWE API for encrypted payloads.",
      "asOf": "2026-11-17"
    },
    "F149": {
      "label": "FAQ: PyJWT vs python-jose: which should I choose?",
      "display": "python-jose offers selectable cryptographic backends.",
      "asOf": "2026-11-17"
    },
    "F150": {
      "label": "FAQ: Does decoding a JWT validate every claim?",
      "display": "Authlib claim checks run through claims.validate().",
      "asOf": "2026-11-17"
    },
    "F151": {
      "label": "FAQ: Does decoding a JWT validate every claim?",
      "display": "joserfc requires separate JWTClaimsRegistry validation of decoded claims.",
      "asOf": "2026-11-17"
    },
    "F152": {
      "label": "FAQ: Does decoding a JWT validate every claim?",
      "display": "PyJWT requires explicit claim requirements when missing claims must be rejected.",
      "asOf": "2026-11-17"
    },
    "F153": {
      "label": "FAQ: How do I encrypt a JWT in Python?",
      "display": "JWCrypto creates encrypted tokens through make_encrypted_token().",
      "asOf": "2026-11-17"
    },
    "F154": {
      "label": "FAQ: How do I encrypt a JWT in Python?",
      "display": "joserfc requires JWERegistry for encrypted JWT encoding and decoding.",
      "asOf": "2026-11-17"
    },
    "F155": {
      "label": "FAQ: Should new applications use Authlib JOSE or joserfc?",
      "display": "Authlib marks its JOSE API deprecated and directs new JOSE work to joserfc.",
      "asOf": "2026-11-17"
    },
    "F156": {
      "label": "FAQ: How do I load a signing key from a JWKS endpoint?",
      "display": "Use PyJWKClient to fetch a remote JWK set and select the token’s signing key.",
      "asOf": "2026-11-17"
    },
    "F157": {
      "label": "Library name, pyjwt",
      "display": "PyJWT",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Monthly downloads, pyjwt",
      "display": "761.0M",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "License, pyjwt",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Package release, pyjwt",
      "display": "2.15.1",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Package release date, pyjwt",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Install, pyjwt",
      "display": "pip install \"PyJWT[crypto]\"",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Quickstart, pyjwt",
      "display": "import os\nimport jwt\ntoken = jwt.encode({'sub': '123'}, os.environ['JWT_SECRET'], algorithm='HS256')\n",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Official description, pyjwt",
      "display": "Encodes and decodes JSON Web Tokens.",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Quickstart source file, pyjwt",
      "display": "docs/api.rst (API recipe)",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Repository stars, pyjwt",
      "display": "5.7K",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "JWE encryption, pyjwt",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "EdDSA signatures, pyjwt",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Scope, pyjwt",
      "display": "Signed-token codec and PyJWKClient",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Project function, pyjwt",
      "display": "def retrieve_matching_jwk(self, token):\n    \"\"\"Get the signing key by exploring the JWKS endpoint of the OP.\n\n    Don't use jwt.PyJWKClient()get_signing_key_from_jwt() because it doesn't check\n    the algorithm in case of multiple jwk with the same kid.\n    \"\"\"\n    response_jwks = requests.get(\n        self.OIDC_OP_JWKS_ENDPOINT,\n        verify=self.get_settings(\"OIDC_VERIFY_SSL\", True),\n        timeout=self.get_settings(\"OIDC_TIMEOUT\", None),\n        proxies=self.get_settings(\"OIDC_PROXY\", None),\n    )\n    response_jwks.raise_for_status()\n    jwks = response_jwks.json()\n\n    # Compute the current header from the given token to find a match\n    jws = jwt.get_unverified_header(token)\n\n    key = None\n    for jwk in jwks[\"keys\"]:\n        if import_from_settings(\"OIDC_VERIFY_KID\", True) and jwk[\n            \"kid\"\n        ] != smart_str(jws[\"kid\"]):\n            continue\n        if \"alg\" in jwk and jwk[\"alg\"] != smart_str(jws[\"alg\"]):\n            continue\n        key = jwk\n    if key is None:\n        raise SuspiciousOperation(\"Could not find a valid JWKS.\")\n    return jwt.PyJWK(key)",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Project source file, pyjwt",
      "display": "mozilla_django_oidc/auth.py",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Project full_name, pyjwt",
      "display": "mozilla/mozilla-django-oidc",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Project stargazers_count, pyjwt",
      "display": "560",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Library name, authlib",
      "display": "Authlib",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Monthly downloads, authlib",
      "display": "137.9M",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "License, authlib",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Package release, authlib",
      "display": "1.9.9",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Package release date, authlib",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Install, authlib",
      "display": "pip install Authlib",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Quickstart, authlib",
      "display": "from authlib.jose import jwt\nwith open('private.pem', 'rb') as key_file:\n    token = jwt.encode({'alg': 'RS256'}, {'sub': '123'}, key_file.read())\n",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Official description, authlib",
      "display": "Builds OAuth and OpenID Connect servers and clients.",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Quickstart source file, authlib",
      "display": "docs/jose/jwt.rst (API recipe)",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Repository stars, authlib",
      "display": "5.5K",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "JWE encryption, authlib",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "EdDSA signatures, authlib",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Scope, authlib",
      "display": "OAuth/OIDC clients and servers plus JOSE APIs",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Project function, authlib",
      "display": "async def _verify_jwt(\n    self,\n    alg_values: list[str],\n    token: str,\n    claims_cls: type[C],\n    claims_options: dict | None = None,\n    claims_params: dict | None = None,\n) -> C:\n    \"\"\"Decode and validate a JWT, re-fetching the JWKS as needed.\n\n    Args:\n        alg_values: list of `alg` values allowed when verifying the JWT.\n        token: the JWT.\n        claims_cls: the JWTClaims class to use to validate the claims.\n        claims_options: dict of options passed to the `claims_cls` constructor.\n        claims_params: dict of params passed to the `claims_cls` constructor.\n\n    Returns:\n        The decoded claims in the JWT.\n    \"\"\"\n    jwt = JsonWebToken(alg_values)\n\n    logger.debug(\"Attempting to decode JWT (%s) %r\", claims_cls.__name__, token)\n\n    # Try to decode the keys in cache first, then retry by forcing the keys\n    # to be reloaded\n    jwk_set = await self.load_jwks()\n    try:\n        claims = jwt.decode(\n            token,\n            key=jwk_set,\n            claims_cls=claims_cls,\n            claims_options=claims_options,\n            claims_params=claims_params,\n        )\n    except ValueError:\n        logger.info(\"Reloading JWKS after decode error\")\n        jwk_set = await self.load_jwks(force=True)  # try reloading the jwks\n        claims = jwt.decode(\n            token,\n            key=jwk_set,\n            claims_cls=claims_cls,\n            claims_options=claims_options,\n            claims_params=claims_params,\n        )\n\n    logger.debug(\"Decoded JWT (%s) %r; validating\", claims_cls.__name__, claims)\n\n    claims.validate(\n        now=self._clock.time(), leeway=120\n    )  # allows 2 min of clock skew\n    return claims",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Project source file, authlib",
      "display": "synapse/handlers/oidc.py",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Project full_name, authlib",
      "display": "element-hq/synapse",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Project stargazers_count, authlib",
      "display": "4.8K",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Library name, joserfc",
      "display": "joserfc",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Monthly downloads, joserfc",
      "display": "128.5M",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "License, joserfc",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Package release, joserfc",
      "display": "1.8.0",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Package release date, joserfc",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Install, joserfc",
      "display": "pip install joserfc",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Quickstart, joserfc",
      "display": "from joserfc import jwt\nfrom joserfc.jwk import OctKey\nkey = OctKey.generate_key()\ntoken = jwt.encode({'alg': 'HS256'}, {'sub': '123'}, key)\n",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Repository stars, joserfc",
      "display": "184",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "JWE encryption, joserfc",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "EdDSA signatures, joserfc",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Validation boundary, joserfc",
      "display": "Decode and claims validation are separate steps",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Project function, joserfc",
      "display": "async def _decode_jwt(self, value, metadata, algorithms):\n    \"\"\"Decode a JWT signed with a key of the provider JWK set.\"\"\"\n    registry = JWSRegistry(algorithms=algorithms, strict_check_header=False)\n    key_set = KeySet.import_key_set(await self.fetch_jwk_set())\n    try:\n        return jwt.decode(value, key=key_set, registry=registry)\n    except InvalidKeyIdError:\n        if metadata.get(\"jwks_uri\") and not _may_refresh_jwk_set(self):\n            raise\n\n    key_set = KeySet.import_key_set(await self.fetch_jwk_set(force=True))\n    return jwt.decode(value, key=key_set, registry=registry)",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Project source file, joserfc",
      "display": "authlib/integrations/base_client/async_openid.py",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Project full_name, joserfc",
      "display": "authlib/authlib",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Project stargazers_count, joserfc",
      "display": "5.5K",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Library name, python-jose",
      "display": "python-jose",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Monthly downloads, python-jose",
      "display": "31.8M",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "License, python-jose",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Package release, python-jose",
      "display": "3.5.0",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Package release date, python-jose",
      "display": "May 2025",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Install, python-jose",
      "display": "pip install \"python-jose[cryptography]\"",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Quickstart, python-jose",
      "display": "import os\nfrom jose import jwt\ntoken = jwt.encode({'sub': '123'}, os.environ['JWT_SECRET'], algorithm='HS256')\n",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Repository stars, python-jose",
      "display": "1.8K",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "JWE encryption, python-jose",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "EdDSA signatures, python-jose",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Backend boundary, python-jose",
      "display": "cryptography, PyCryptodome, or native-Python backends",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project function, python-jose",
      "display": "def verify_token(token: str) -> Dict[str, Any]:\n    \"\"\"\n    Verify token\n\n    Args:\n        token: Authentication token\n\n    Returns:\n        Data contained in the token\n\n    Raises:\n        HTTPException: Exception thrown when token is invalid\n    \"\"\"\n    credentials_exception = HTTPException(\n        status_code=status.HTTP_401_UNAUTHORIZED,\n        detail=\"Could not validate credentials\",\n        headers={\"WWW-Authenticate\": \"Bearer\"},\n    )\n\n    try:\n        payload = jwt.decode(\n            token, settings.SECRET_KEY, algorithms=[settings.ALGORITHM]\n        )\n        if not is_user_session_payload(payload):\n            raise credentials_exception\n        username: str = payload.get(\"sub\")\n        if username is None:\n            raise credentials_exception\n        token_data = TokenData(username=username)\n        return {\"username\": token_data.username}\n    except JWTError:\n        raise credentials_exception",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Project source file, python-jose",
      "display": "backend/app/core/security.py",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Project full_name, python-jose",
      "display": "wecode-ai/Wegent",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Project stargazers_count, python-jose",
      "display": "888",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Library name, jwcrypto",
      "display": "JWCrypto",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Monthly downloads, jwcrypto",
      "display": "19.4M",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "License, jwcrypto",
      "display": "LGPL-3.0-or-later",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Package release, jwcrypto",
      "display": "1.6.1",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Package release date, jwcrypto",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Install, jwcrypto",
      "display": "pip install jwcrypto",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Quickstart, jwcrypto",
      "display": "from jwcrypto import jwk, jwt\nkey = jwk.JWK.generate(kty='oct', size=256)\ntoken = jwt.JWT(header={'alg': 'HS256'}, claims={'sub': '123'})\ntoken.make_signed_token(key)\nserialized = token.serialize()\n",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Repository stars, jwcrypto",
      "display": "481",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "JWE encryption, jwcrypto",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "EdDSA signatures, jwcrypto",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Token boundary, jwcrypto",
      "display": "Signed or encrypted JWT with expected token type",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Project function, jwcrypto",
      "display": "def main(args):\n    \"\"\"Generates a signed JSON Web Token from local private key.\"\"\"\n    with open(args.key) as f:\n        pem_data = f.read()\n    f.closed\n\n    pem_data_encode = pem_data.encode(\"utf-8\")\n    key = jwk.JWK.from_pem(pem_data_encode)\n\n    if args.jwks:\n        with open(args.jwks, \"w+\") as fout:\n            fout.write(\"{ \\\"keys\\\":[ \")\n            fout.write(key.export(private_key=False))\n            fout.write(\"]}\")\n        fout.close\n\n    now = int(time.time())\n    payload = {\n        # expire in one hour.\n        \"exp\": now + args.expire,\n        \"iat\": now,\n    }\n    if args.iss:\n        payload[\"iss\"] = args.iss\n    if args.sub:\n        payload[\"sub\"] = args.sub\n    else:\n        payload[\"sub\"] = args.iss\n\n    if args.aud:\n        if \",\" in args.aud:\n            payload[\"aud\"] = args.aud.split(\",\")\n        else:\n            payload[\"aud\"] = args.aud\n\n    if args.claims:\n        for item in args.claims.split(\",\"):\n            k, v = item.split(':')\n            payload[k] = v\n\n    if args.listclaim:\n        for item in args.listclaim:\n            if (len(item) > 1):\n                k = item[0]\n                v = item[1:]\n                payload[k] = v\n\n    if args.nestedclaim:\n        nested = {}\n        for item in args.nestedclaim:\n            if (len(item) > 1):\n                k = item[0]\n                v = item[1:]\n                if len(v) == 1:\n                    v = v[0]\n                nested[k] = v\n        nested[\"nested-2\"] = copy.copy(nested)\n        payload[args.nestedkey] = nested\n\n    token = jwt.JWT(header={\"alg\": \"RS256\", \"typ\": \"JWT\", \"kid\": key.key_id},\n                    claims=payload)\n\n    token.make_signed_token(key)\n\n    return token.serialize()",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Project source file, jwcrypto",
      "display": "security/tools/jwt/samples/gen-jwt.py",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Project full_name, jwcrypto",
      "display": "istio/istio",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Project stargazers_count, jwcrypto",
      "display": "38.5K",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Library name, jwt",
      "display": "jwt",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Monthly downloads, jwt",
      "display": "3.1M",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "License, jwt",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Package release, jwt",
      "display": "1.4.0",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Package release date, jwt",
      "display": "Jun 2025",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Install, jwt",
      "display": "pip install jwt",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Quickstart, jwt",
      "display": "from jwt import JWT, jwk_from_pem\nwith open('private.pem', 'rb') as key_file:\n    key = jwk_from_pem(key_file.read())\ntoken = JWT().encode({'sub': '123'}, key, alg='RS256')\n",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Official description, jwt",
      "display": "Implements JSON Web Tokens.",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Quickstart source file, jwt",
      "display": "README.rst (API recipe)",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Repository stars, jwt",
      "display": "157",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "JWE encryption, jwt",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "EdDSA signatures, jwt",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Package/import identity, jwt",
      "display": "PyPI jwt; GehirnInc/python-jwt; JWT() API",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Project function, jwt",
      "display": "def create_access_token(data: dict, expires_delta: Optional[timedelta] = None) -> str:\n    \"\"\"Create a JWT access token with an expiration.\"\"\"\n    to_encode = data.copy()\n    expire = datetime.now(timezone.utc) + (expires_delta or timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES))\n    to_encode.update({\"exp\": get_int_from_datetime(expire)})\n    signing_key = get_jwk_from_secret(SECRET_KEY)\n    return instance.encode(to_encode, signing_key, alg='HS256')",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Project source file, jwt",
      "display": "deploy/docker/auth.py",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Project full_name, jwt",
      "display": "unclecode/crawl4ai",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Project stargazers_count, jwt",
      "display": "87.5K",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Library name, jwskate",
      "display": "jwskate",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Monthly downloads, jwskate",
      "display": "1.7M",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "License, jwskate",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Package release, jwskate",
      "display": "0.12.2",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Package release date, jwskate",
      "display": "Apr 2025",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Install, jwskate",
      "display": "pip install jwskate",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Quickstart, jwskate",
      "display": "from jwskate import Jwk, Jwt\nkey = Jwk.generate(alg='ES256')\ntoken = Jwt.sign({'sub': '123'}, key)\n",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Official description, jwskate",
      "display": "Implements the JOSE standards, including JWS, JWK, JWE, and JWT.",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Quickstart source file, jwskate",
      "display": "docs/usage.md (API recipe)",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Repository stars, jwskate",
      "display": "24",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "JWE encryption, jwskate",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "EdDSA signatures, jwskate",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Scope, jwskate",
      "display": "JOSE objects, explicit JWT validation, and nested encryption",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Python JWT libraries PyJWT python-jose Authlib jwcrypto joserfc code examples claim validation JWK encryption",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
