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.2.tar.gz
.
File metadata
- Download URL: msal_bearer-1.1.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f238804ae556d6a0938b3b7d1f2eed9d796e6d60472a10be8a2ffda26a7bfb |
|
MD5 | cc0e55fed0c246f4f9762f53c0b597d1 |
|
BLAKE2b-256 | 7ef19158aad001704feb70e13cb4d93ea68e180e05352410fb6e40e591086fab |
Provenance
File details
Details for the file msal_bearer-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: msal_bearer-1.1.2-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/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c2fe284def33e80ef7c74b5fb3dcbd1df80b2fa3410a46a71107dd6b143d516 |
|
MD5 | 39a77966e013c45c834a57014c7f4054 |
|
BLAKE2b-256 | b0e8157335de580bd5d7c721c1ff76708da3c570e177ca26f9c181fd4c56a6fe |