summaryrefslogtreecommitdiff
path: root/docs/usage.rst
diff options
context:
space:
mode:
authorMichael Haines <michael.c.haines@gmail.com>2022-11-15 20:47:00 -0700
committerGitHub <noreply@github.com>2022-11-16 09:47:00 +0600
commit300348f7bc4a520448b8fbefa525c9434e82141d (patch)
tree9be0c65bf211db218f027eee36a580f98330da87 /docs/usage.rst
parente6d0a83bbafb0b26b4ba7924f2f5e26eb995845a (diff)
downloadpyjwt-300348f7bc4a520448b8fbefa525c9434e82141d.tar.gz
Custom header configuration in jwk client (#823)
* allow configuration of custom headers in JWKClient * revert changes to algorithms * document example usage of custom headers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * black format tests * Add a release note for optional headers arg Co-authored-by: thundercat1 <michael.haines@recursionpharma.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'docs/usage.rst')
-rw-r--r--docs/usage.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/usage.rst b/docs/usage.rst
index a85fa18..9a673c3 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -286,7 +286,8 @@ Retrieve RSA signing keys from a JWKS endpoint
>>> token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5FRTFRVVJCT1RNNE16STVSa0ZETlRZeE9UVTFNRGcyT0Rnd1EwVXpNVGsxUWpZeVJrUkZRdyJ9.eyJpc3MiOiJodHRwczovL2Rldi04N2V2eDlydS5hdXRoMC5jb20vIiwic3ViIjoiYVc0Q2NhNzl4UmVMV1V6MGFFMkg2a0QwTzNjWEJWdENAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZXhwZW5zZXMtYXBpIiwiaWF0IjoxNTcyMDA2OTU0LCJleHAiOjE1NzIwMDY5NjQsImF6cCI6ImFXNENjYTc5eFJlTFdVejBhRTJINmtEME8zY1hCVnRDIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.PUxE7xn52aTCohGiWoSdMBZGiYAHwE5FYie0Y1qUT68IHSTXwXVd6hn02HTah6epvHHVKA2FqcFZ4GGv5VTHEvYpeggiiZMgbxFrmTEY0csL6VNkX1eaJGcuehwQCRBKRLL3zKmA5IKGy5GeUnIbpPHLHDxr-GXvgFzsdsyWlVQvPX2xjeaQ217r2PtxDeqjlf66UYl6oY6AqNS8DH3iryCvIfCcybRZkc_hdy-6ZMoKT6Piijvk_aXdm7-QQqKJFHLuEqrVSOuBqqiNfVrG27QzAPuPOxvfXTVLXL2jek5meH6n-VWgrBdoMFH93QEszEDowDAEhQPHVs0xj7SIzA"
>>> kid = "NEE1QURBOTM4MzI5RkFDNTYxOTU1MDg2ODgwQ0UzMTk1QjYyRkRFQw"
>>> url = "https://dev-87evx9ru.auth0.com/.well-known/jwks.json"
- >>> jwks_client = PyJWKClient(url)
+ >>> optional_custom_headers = {"User-agent": "custom-user-agent"}
+ >>> jwks_client = PyJWKClient(url, headers=optional_custom_headers)
>>> signing_key = jwks_client.get_signing_key_from_jwt(token)
>>> data = jwt.decode(
... token,