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.3.2.tar.gz (4.1 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.3.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: msal_bearer-1.3.2.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.5.0

File hashes

Hashes for msal_bearer-1.3.2.tar.gz
Algorithm Hash digest
SHA256 ee542eb97cf114be8bc7d77bcd4404f111845ced17d9860518a7946a4bbc1d99
MD5 387d9c4d5ce4108dfddb530ef70b0e1d
BLAKE2b-256 a4d2ba69df351492ffac643ff66cca81e3cc93de513e9c68dfc37bffe8e8d001

See more details on using hashes here.

File details

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

File metadata

  • Download URL: msal_bearer-1.3.2-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.5.0

File hashes

Hashes for msal_bearer-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2855fa850ee8d7e77b284a9a66f9321dbe71ee4b460ea4db0e3fb340e3b74c21
MD5 0d7489ab9c3ddb6c212aeabac074cc9e
BLAKE2b-256 a6b68b63fab43dfe62cb360f3caba56dd9547407153a8fb6c650f613dc93f84a

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