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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp_ntlm-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 4b4e32eebef6d3177c92536cddc934346f894386766dae9ebac1bfdd71f176fb
MD5 58f7ede3d1eefa692c33f41f76f1b079
BLAKE2b-256 0d2493d08f41c0dcd1cee8218135df9cf10dc1a9c9290b3af3ca9aeda3b62ea2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: aiohttp_ntlm-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03d9781ba4ed98d26b1a551d83301de812a037a8394fc7875423d6531202c609
MD5 3e544e3eafd05f237b158b8145267c5c
BLAKE2b-256 9e7aa30497dc69c4ca4eec8df9e2f50535a43b31d47b9071b062f9250c2ddaab

See more details on using hashes here.

Provenance

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