From 773c26284c4aa3754cd6dd9073b33253cda0cac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Nov 2020 10:39:32 +0100 Subject: [PATCH] Fix usage example The algorithms parameter for decode accepts list not a string. --- docs/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.rst b/docs/usage.rst index 9e83d28c..9264b22e 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -23,7 +23,7 @@ Encoding & Decoding Tokens with RS256 (RSA) >>public_key = b'-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEAC...' >>encoded = jwt.encode({'some': 'payload'}, private_key, algorithm='RS256') 'eyJhbGciOiJIU...' - >>decoded = jwt.decode(encoded, public_key, algorithms='RS256') + >>decoded = jwt.decode(encoded, public_key, algorithms=['RS256']) {'some': 'payload'} If your private key needs a passphrase, you need to pass in a ``PrivateKey`` object from ``cryptography``.