Small and simple Python library to parse JWT tokens embedded in http auth. headers.
Project description
Python Auth. Header Parser
A small and simple library to parse JWT tokens embedded in Authorization or Authentication HTTP headers.
Note: This library does not decode the JWT token. It simply extracts the JWT token string from the header string.
Usage
from py_auth_header_parser import parse_auth_header
header = "Authorization: Bearer AAA, Refresh BBB"
parsed = parse_auth_header(header)
# 'parsed' will then contain:
{
"access_token": "AAA",
"refresh_token": "BBB",
}
parse_auth_header()
will always return a dict with two keys: access_token
and refresh_token
.
When a refresh token is no present in the header, the refresh_token
key will be None
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for py_auth_header_parser-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d6b0c8dca29c6797519f58e4016be02c88e7a0435f9075f9fa747f1c7c2ba33 |
|
MD5 | a7a15776ca4c26abb792c710a96a9e25 |
|
BLAKE2b-256 | 1ad4aeb92f686ad2ea107d031312efb52defb3062a3cc31466ee54078b29742e |