Metadata-Version: 2.1
Name: py-auth-header-parser
Version: 1.0.1
Summary: Small and simple Python library to parse JWT tokens embedded in http auth. headers.
Home-page: https://github.com/cgons/py-auth-header-parser
Author: Chrys Gonsalves
Author-email: cgons@pcxchange.ca
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'

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`.


