Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_auth_header_parser-1.0.2.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_auth_header_parser-1.0.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file py_auth_header_parser-1.0.2.tar.gz.

File metadata

  • Download URL: py_auth_header_parser-1.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for py_auth_header_parser-1.0.2.tar.gz
Algorithm Hash digest
SHA256 95840bdade183adfd3d8b58ceb58e7f6f880e9028793b3029e9293e40c732bdf
MD5 d2b0aea2561d99157e772ec24c0aa23b
BLAKE2b-256 d35bed38f40138993260e127c2464cf58e4899c901bded7614aece94f6b7fe32

See more details on using hashes here.

File details

Details for the file py_auth_header_parser-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: py_auth_header_parser-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for py_auth_header_parser-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9481862347b8501cb35aee365d3bc59591702b9782abecb35fac1d36ac96e32
MD5 5b2674a48d4a6b5c9f672da3b97e3f4c
BLAKE2b-256 3d2b0f89e0c986254df1c51b3ab11686ab30c425316a5bdd5ae89e004097c657

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page