{"id":23212,"library":"aiohttp-basicauth","title":"aiohttp-basicauth","description":"HTTP basic authentication middleware for aiohttp 3.0+. Current version 1.1.0. This library provides a simple middleware to add HTTP basic authentication to aiohttp web applications. Maintenance is infrequent.","status":"active","version":"1.1.0","language":"python","source_language":"en","source_url":"https://github.com/romis2012/aiohttp-basicauth","tags":["aiohttp","middleware","basic-auth","authentication"],"install":[{"cmd":"pip install aiohttp-basicauth","lang":"bash","label":"default"}],"dependencies":[],"imports":[{"note":"common misspelling of package name","wrong":"from aiohttp_basicauth_middleware import BasicAuth","symbol":"BasicAuth","correct":"from aiohttp_basicauth import BasicAuth"}],"quickstart":{"code":"from aiohttp import web\nfrom aiohttp_basicauth import BasicAuth\n\nauth = BasicAuth(username='admin', password='secret')\n\nasync def handler(request):\n    return web.Response(text='Authenticated!')\n\napp = web.Application()\napp.router.add_get('/', handler)\nauth.setup(app)\n\nweb.run_app(app)","lang":"python","description":"Set up basic auth middleware on an aiohttp app."},"warnings":[{"fix":"Upgrade to v1.1.0 and use `@auth.ignore` on handlers you want to exclude.","message":"The `setup` method configures the middleware globally on the app; you cannot apply per-route auth easily without the `ignore` decorator (added in v1.1.0).","severity":"breaking","affected_versions":"<1.1.0"},{"fix":"Apply `@auth.ignore` to static file handlers or use a separate sub-app.","message":"The middleware checks credentials on every request, including static files. If you serve static files publicly, use the `ignore` decorator to exclude those routes.","severity":"gotcha","affected_versions":"all"},{"fix":"Update your callable to accept only `username` and `password` (no request).","message":"Passing `check_credentials` callable with a request parameter (old signature) is deprecated. New signature: `check_credentials(username, password)`.","severity":"deprecated","affected_versions":">=0.2.0, <1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from aiohttp_basicauth import BasicAuth`.","cause":"Wrong import path; the package name is `aiohttp-basicauth` but the module is `aiohttp_basicauth`.","error":"ImportError: No module named 'aiohttp_basicauth_middleware'"},{"fix":"Ensure your handler is async and you await calls if you override `check_credentials`.","cause":"Forgetting to use `await` on an async handler that calls `check_credentials` directly, or misconfiguration.","error":"TypeError: object NoneType can't be used in 'await' expression"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}