| Crates.io | indieauth-client |
| lib.rs | indieauth-client |
| version | 0.1.0 |
| created_at | 2025-01-30 15:10:02.071684+00 |
| updated_at | 2025-01-30 15:10:02.071684+00 |
| description | A small library for actix-web to log your users in using IndieAuth |
| homepage | |
| repository | https://codeberg.org/jak2k/indieauth.rs/ |
| max_upload_size | |
| id | 1536470 |
| size | 79,064 |
A simple implementation of IndieAuth in Rust.
The client library is made for actix-web. This is the all you need:
#[actix_web::main]
async fn main() -> std::io::Result<()> {
use actix_identity::IdentityMiddleware;
use actix_session::{storage::CookieSessionStore, SessionMiddleware};
use indieauth_client::{get_service, AuthConfig};
let config = AuthConfig::new("localhost:8080".to_string()); // change this to your own domain
let secret_key = actix_web::cookie::Key::generate();
actix_web::HttpServer::new(move || {
actix_web::App::new()
.wrap(IdentityMiddleware::default())
.wrap(SessionMiddleware::new(
CookieSessionStore::default(),
secret_key.clone(),
))
.service(index)
.service(get_service(&config))
})
.workers(1)
.bind("127.0.0.1:8080")?
.run()
.await
}
git clone https://codeberg.org/jak2k/indieauth.rs.git
cd indieauth.rs
cd indieauth-client
cargo run localhost:8080 # this is the issuer. If you run it on your own domain, you need to change this to that domain
If you run it on localhost using http, you will need to change the URL in the addressbar to http manually.
An IndieAuth provider that support logging in with a fediverse account.