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 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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msal_bearer-1.3.1.tar.gz.
File metadata
- Download URL: msal_bearer-1.3.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.3 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37c75fab4a60b50bbe65f1bc8517fff15319c8a3e784624bfa407adebd73c9d2
|
|
| MD5 |
cf7f94aa1474ebfc83347ad0ba845908
|
|
| BLAKE2b-256 |
e5a5cf3fc5206cf9f7349b5c1f28924296b94b11d5d48ae66b54208fd42eebb8
|
File details
Details for the file msal_bearer-1.3.1-py3-none-any.whl.
File metadata
- Download URL: msal_bearer-1.3.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.3 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e367b8f1f13de8aa32bed9fe0cf0dad78a99f9560e2ddb007c51eaac3f70e9df
|
|
| MD5 |
999b1c7d896f36e11e25e8889bfb2be9
|
|
| BLAKE2b-256 |
13799344915f20bce6570734a788c7d130c455f44142b29847f734743fd462c7
|