Skip to main content

NTLM authentication middleware for aiohttp

Project description

aiohttp-ntlm

Python 3.11+ License: MIT

NTLM authentication middleware for aiohttp (client support middleware since v3.12.0).

Installation

Using pip:

pip install aiohttp-ntlm

Usage Example

import asyncio
import aiohttp
from aiohttp_ntlm import HttpNtlmAuthMiddleware

async def test_ntlm_auth_middleware() -> None:
    request_url: str = "<your_request_url>" 
    user_name: str = "<your_user_name>"
    password: str = "<your_password>"

    async with aiohttp.ClientSession() as session:
        try:
            async with session.get(
                request_url, 
                headers={}, 
                middlewares=[HttpNtlmAuthMiddleware(user_name, password)]
            ) as response:
                if response.status == 200:
                    print("success:", await response.text())
        except Exception as e:
            raise Exception("error: " + str(e)) from e

if __name__ == "__main__":
    asyncio.run(test_ntlm_auth_middleware())

Requirements

  • Python >= 3.11
  • aiohttp >= 3.12.13
  • pyspnego >= 0.11.2

Implementation Notes

This middleware is inspired by requests_ntlm and implemented for aiohttp.

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

aiohttp_ntlm-0.1.3.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

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

aiohttp_ntlm-0.1.3-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file aiohttp_ntlm-0.1.3.tar.gz.

File metadata

  • Download URL: aiohttp_ntlm-0.1.3.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aiohttp_ntlm-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5168b677926412e2cb7bbecb950a8345459bdfc413e5009fca42dc512ca05f35
MD5 9be8d1b9eaae27f0dc19ff4b312ebb59
BLAKE2b-256 a516286121b22c51e75bef9f7cc4c5df7f36371a6e6765d83af602f0c6aa0d35

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohttp_ntlm-0.1.3.tar.gz:

Publisher: python-publish.yml on modestme/aiohttp-ntlm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiohttp_ntlm-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: aiohttp_ntlm-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aiohttp_ntlm-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 499e5d9c861f4fca7b9b7b74d36d660f5b0090c71560f5b2e989a662c45b9636
MD5 34f38db8f890fac53e9587d339b4d156
BLAKE2b-256 85a0d5f9a9c0bc5ca2ba2149f771f09739b2b1b29457c8e3150e8de9ba734d28

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohttp_ntlm-0.1.3-py3-none-any.whl:

Publisher: python-publish.yml on modestme/aiohttp-ntlm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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