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())

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp_ntlm-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 b286374c3f878f54a3c3cb923c7708c263d290be75f6df1cde802410e34c8695
MD5 a28f6052372e7ee185d69446f4d34ba1
BLAKE2b-256 1fdb86548abe3c2a1b302307eaf9f95d05679cb97f44a68ecbd7cca7eff884ac

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: aiohttp_ntlm-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 040ff493878c33f5559e9db2551d80761a620b86f49bccea3ea805ed08f21831
MD5 0a8a9bcc4808007a0469e8105f27267c
BLAKE2b-256 c1a40421b8118e5e9431ef69979fadaf548c96e90758fd655c7f74434a1bbbda

See more details on using hashes here.

Provenance

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