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.3.tar.gz (4.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.3.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for msal_bearer-1.3.3.tar.gz
Algorithm Hash digest
SHA256 5c1e7f03505eef93e4ffce4a920a2fdd060005262fa58cafd31b9f62ab5445cf
MD5 8ef299dfc8aeed5847804bcb084219cd
BLAKE2b-256 fda6797e5b7fd4ebf8e7cdb667b24cbbfcbead45ffd786d37c5ff4194c04944a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for msal_bearer-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0cac876dc70024d57f916dafe411d5a854958addc56eca5e98465f7ba2e6a711
MD5 e4a2e87f0dfdf2d88b804d1160fc5cc0
BLAKE2b-256 f379a71e6d01e21bb15190c6374cd8a2c4e5a644b9bef705760e5f6d2260cd3a

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