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.1.4.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.1.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: msal_bearer-1.1.4.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.1.4.tar.gz
Algorithm Hash digest
SHA256 e62450b7d2843f1f35276e0d6bd73a5a0cd798dfd080df99f348ee0062ca61bc
MD5 dc6db0d67362b742bd1ec036dcd45585
BLAKE2b-256 331391709de12faa5ae001bc0279cc04a0fa53bc7a5e4847320cdbf5e57a1ade

See more details on using hashes here.

File details

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

File metadata

  • Download URL: msal_bearer-1.1.4-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.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c19b9b415aef188f140a3e4fe239fa03b3f62df44d8a3795cb4aa92cbb5f4be3
MD5 34c095786c3fb47fb4328f197c5c7e0f
BLAKE2b-256 01755bc648cb53f3ed44ac2cd112efaa2add5ec4409a8187dd0b5e10fd87d6bc

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