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.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

msal_bearer-1.2.1.tar.gz (4.4 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.2.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: msal_bearer-1.2.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Darwin/24.3.0

File hashes

Hashes for msal_bearer-1.2.1.tar.gz
Algorithm Hash digest
SHA256 850a08446501eecf59a35cb340f0a8a75ef64ab764859b2c255690a7f1872c71
MD5 a1da6384b83b13e295bcea194bca4b79
BLAKE2b-256 668111ab0cff04ed9aa0b67a4ea5249291a07c81869579207db4da853498f474

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for msal_bearer-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f479182ed8507869306f14e23d8b12955e0fc4110fd01d0267c0667d1ab37776
MD5 a2dfc0258ee8e7f0753b6a5f4cf5d236
BLAKE2b-256 69baea0f7cc7d045bc3c130e765449eeeac74803f07166e873fdde4f00507c24

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