Skip to main content

Python package to get auth token interactively for a public client application using msal and msal-extension for caching.

Project description

msal-bearer SNYK dependency check

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msal_bearer-1.4.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msal_bearer-1.4.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file msal_bearer-1.4.0.tar.gz.

File metadata

  • Download URL: msal_bearer-1.4.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.3 Darwin/24.6.0

File hashes

Hashes for msal_bearer-1.4.0.tar.gz
Algorithm Hash digest
SHA256 80583059cee8601711b9b7d0b9729a34369bb748b97e2fe1c3f96ac0e5a5be3e
MD5 ae535569e919748bb8d2d5d8fde2f09c
BLAKE2b-256 7a6d3cb0b5dbbc8ce0e576f734795cd39abe379e0e0fbe374b6285e7ee7f201a

See more details on using hashes here.

File details

Details for the file msal_bearer-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: msal_bearer-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.3 Darwin/24.6.0

File hashes

Hashes for msal_bearer-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f43c3b56d3a4460362490f4971e149f715eeda615446de57124ad0b9a979be40
MD5 8c343c2aa03a8f3add7a766d01d2b623
BLAKE2b-256 0f4254f992ed33ca7a38139994107916cd68fe3c0f7de42dac2522189316a0b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page