Skip to main content

No project description provided

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp_ntlm-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 aa94243df964302a902c6a890790b7eddcd44700ec5187bd8a29834ac67571c3
MD5 a8941ddccb4d6bbbe68b57f6474d7828
BLAKE2b-256 9ada64b509bdd75b8d319b8e76d6b50ac5b8128ea961e33d784092a61c954198

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: aiohttp_ntlm-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5114f1d8a8d6500daefbab21b5ee40931712c97552f8714bb48446a978ab5a50
MD5 c4fa392c5a1c16d4ebbaa4699f7b7d54
BLAKE2b-256 b1defabf2cd44e037f40ada785913d99eebe072a3644fa23d560f865e61f81a8

See more details on using hashes here.

Provenance

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