Python package to get auth token interactively for a public client application using msal and msal-extension for caching.
Project description
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).
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
Built Distribution
File details
Details for the file msal_bearer-1.1.3.tar.gz
.
File metadata
- Download URL: msal_bearer-1.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/24.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea5cd38c639d82629352cb1bb16d2a9b075dc5b642b642e3a11306dab084efd |
|
MD5 | 50d58bbc8faf8ac81fc9e4f372f9e647 |
|
BLAKE2b-256 | f8582b571830f59cc5c42180b76b332d94b0dd82806975bdd5ec92a2b00cc96c |
File details
Details for the file msal_bearer-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: msal_bearer-1.1.3-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/24.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b669ef806d606484fc87ccb688858347c6d122cf19cbddfcec745170afbf0492 |
|
MD5 | 18aeee105ffbbebbea4279177c20eefc |
|
BLAKE2b-256 | b2d699949bec344432391078ccea30fcee37be317c47cb5231ae4aed30f4d46f |