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 Distribution
Built Distribution
Close
Hashes for py_auth_header_parser-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95840bdade183adfd3d8b58ceb58e7f6f880e9028793b3029e9293e40c732bdf |
|
MD5 | d2b0aea2561d99157e772ec24c0aa23b |
|
BLAKE2b-256 | d35bed38f40138993260e127c2464cf58e4899c901bded7614aece94f6b7fe32 |
Close
Hashes for py_auth_header_parser-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9481862347b8501cb35aee365d3bc59591702b9782abecb35fac1d36ac96e32 |
|
MD5 | 5b2674a48d4a6b5c9f672da3b97e3f4c |
|
BLAKE2b-256 | 3d2b0f89e0c986254df1c51b3ab11686ab30c425316a5bdd5ae89e004097c657 |