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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp_ntlm-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 fd19b838fc019bd618f1eb7875a2aba8399e122dfa22f4a2f25baf7fe8dff915
MD5 556715305b5722a2dcba407280985635
BLAKE2b-256 d90d32c0163296d3cf9f34edec4e1f7714a2881478f55a3fd793d1a9d866a2b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohttp_ntlm-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: aiohttp_ntlm-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 651a03a3cf9ce6a81e0a1fdd56583d0dedbe8b91fb818203fc3ebcae69625a59
MD5 1d5e3d562ba5f028f32ad4c9f2e43958
BLAKE2b-256 c45005efb21730476a7e21aa37188f959c31bda3927a8f67f4490eea3ca0a409

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohttp_ntlm-0.1.2-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