Socket
Socket
Sign inDemoInstall

py-auth-header-parser

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

py-auth-header-parser

Small and simple Python library to parse JWT tokens embedded in http auth. headers.


Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc