{"id":26742,"library":"atlassian-jwt","title":"Atlassian JWT","description":"JSON Web Token (JWT) generation with Atlassian query-string-hash claim support. Wraps PyJWT and adds the 'qsh' claim needed for Atlassian Connect add-ons. Current version 3.0.0, release cadence is irregular.","status":"active","version":"3.0.0","language":"python","source_language":"en","source_url":"https://github.com/codeforamerica/atlassian-jwt","tags":["jwt","atlassian","authentication","connect"],"install":[{"cmd":"pip install atlassian-jwt","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for JWT encoding/decoding","package":"PyJWT","optional":false},{"reason":"Used for RSA signing algorithms (RS256, RS384, RS512)","package":"cryptography","optional":true}],"imports":[{"note":"Wildcard imports are discouraged and may lead to namespace pollution","wrong":"from atlassian_jwt import *","symbol":"atlassian_jwt","correct":"import atlassian_jwt"},{"note":"PyJWT's jwt module does not export create_jwt; using atlassian_jwt is required","wrong":"from jwt import create_jwt","symbol":"create_jwt","correct":"from atlassian_jwt import create_jwt"},{"note":"atlassian_jwt.encode adds the 'qsh' claim automatically; using raw PyJWT.encode will omit qsh","wrong":"import jwt; jwt.encode(...)","symbol":"encode","correct":"from atlassian_jwt import encode"}],"quickstart":{"code":"from atlassian_jwt import create_jwt\nimport os\n\n# Typically a shared secret from Atlassian Connect\nsecret = os.environ.get('ATLASSIAN_SHARED_SECRET', 'test-secret')\nissuer = 'plugin-key'\n\n# Create a JWT for a request\njwt_token = create_jwt(issuer, secret, method='GET', uri='/rest/api/2/issue')\nprint(jwt_token)","lang":"python","description":"Encode a JWT with an Atlassian query-string-hash (qsh) claim for a GET request."},"warnings":[{"fix":"Regenerate the token for each request, or compute qsh manually using compute_qsh and pass it to encode.","message":"The 'qsh' claim is automatically computed from HTTP method and URI. If you change the method or URI after calling create_jwt, the token becomes invalid.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the new API: call create_jwt(issuer, secret) or encode(payload, secret). Check the migration guide.","message":"Version 3.0.0 dropped support for Python 2 and the old API (e.g., 'create_jwt' now returns a string, not a dictionary).","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace encode_jwt with create_jwt(issuer, secret) or encode(payload, secret).","message":"The function 'encode_jwt' (with parameters as dict) was deprecated in 2.0.0 and removed in 3.0.0.","severity":"deprecated","affected_versions":"<3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to atlassian-jwt >= 3.0.0: pip install --upgrade atlassian-jwt","cause":"Installed version is too old or package not installed at all.","error":"ImportError: cannot import name 'create_jwt' from 'atlassian_jwt'"},{"fix":"Use 'from atlassian_jwt import create_jwt' instead of 'import jwt'.","cause":"Imported the wrong module (PyJWT's jwt instead of atlassian_jwt).","error":"AttributeError: module 'jwt' has no attribute 'create_jwt'"},{"fix":"Ensure the issuer matches the add-on key registered in Atlassian Connect.","cause":"The issuer string does not match the expected key in the secret store.","error":"atlassian_jwt.exceptions.InvalidIssuerError: Invalid issuer"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}