Metadata-Version: 2.1
Name: msal-bearer
Version: 1.1.3
Summary: Python package to get auth token interactively for a public client application using msal and msal-extension for caching.
Home-page: https://github.com/Equinor/msal-bearer
License: MIT
Author: Åsmund Våge Fannemel
Author-email: asmf@equinor.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: cryptography (>=43.0.3,<44.0.0)
Requires-Dist: msal (>=1.31.0,<2.0.0)
Requires-Dist: msal-extensions (>=1.2.0,<2.0.0)
Project-URL: Repository, https://github.com/Equinor/msal-bearer
Description-Content-Type: text/markdown

# msal-bearer
Python package to get authorization token interactively for a msal public client application supporting local cache and refreshing the token.

## Usage


````
from msal_bearer.BearerAuth import BearerAuth

tenantID = "YOUR_TENANT_ID"
client_id = "YOUR_CLIENT_ID"
scope = ["YOUR_SCOPE"]

auth = BearerAuth.get_auth(
    tenantID=tenantID,
    clientID=client_id,
    scopes=scope
)

# Supports requests
response = requests.get("https://www.example.com/", auth=auth)

# and httpx
client = httpx.Client()
response = client.get("https://www.example.com/", auth=auth)

````


## Installing
Clone and install using poetry or install from pypi using pip. 

````
pip install msal_bearer
````


## Alternatives
Other similar packages include https://pypi.org/project/msal-requests-auth/ (for confidential client applications) and https://pypi.org/project/msal-interactive-token-acquirer/ (no caching implemented).


