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 auth token interactively for a msal public client application and cache it locally.
Usage
tenantID = "YOUR_TENANT_ID"
client_id = "YOUR_CLIENT_ID"
scope = ["YOUR_SCOPE"]
auth = BearerAuth.get_bearer_token_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)
THe auth object can be used as an auth for both requests and httpx.
Installing
Install using pip or poetry from pypi.
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-0.2.1.tar.gz
.
File metadata
- Download URL: msal_bearer-0.2.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e94addbaef9c1166f01417f41f9a13280176ad2d539f1d5448b773d25b2c936b |
|
MD5 | 2e0a35ba61dd0c38122149bc16a5d28d |
|
BLAKE2b-256 | 049f0ff888c048b90dfafd3c2ccac3dc3d00aaa40c741bb9ebd08b405bf131e2 |
Provenance
File details
Details for the file msal_bearer-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: msal_bearer-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37d45f09fab423bcbbd226e4df11c759406df64970b06e3f13f18930117c3fa1 |
|
MD5 | 3ff56190d9df963e0d93258ffb118409 |
|
BLAKE2b-256 | 65c56b792637e4d4ef5150e922c0aeb0a109fdb3e5247575231f7fc54ae7686d |