Registry / web-framework / actix-web-httpauth

actix-web-httpauth

JSON →
library0.8.2rscratesunverified

Provides HTTP authentication schemes (e.g., Basic, Bearer) for Actix Web applications.

# Cargo.toml [dependencies] actix-web-httpauth = "0.8.2"
INSTALL
IMPORT
SIG · ACTIX-WEB-HTTPAUTH
A
actix-web-httpauth
web-frameworkrustv0.8.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HttpAuthentication
use actix_web_httpauth::middleware::HttpAuthentication;

Set up basic HTTP authentication middleware in an Actix Web server.

use actix_web::{web, App, HttpServer}; use actix_web_httpauth::middleware::HttpAuthentication; async fn index() -> &'static str { "Hello, authenticated user!" } #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .wrap(HttpAuthentication::basic(|req, cred| async move { Ok(req) })) .route("/", web::get().to(index)) }) .bind("127.0.0.1:8080")? .run() .await }
Debug
Known issues
gotchaRequires the `actix-web` runtime; authentication middleware must be added before routes.
fix
Ensure `actix-web` is a dependency and middleware is applied in the correct order.
affects: >=0.8.0
Upgrade
Version history
0.8.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
54 hits · last 30 days
node
46
Resources
actix-web-httpauth — cargo add actix-web-httpauth · libregistry