Repository navigation
v0.1.0
The first release of the Seamless Auth server adapter for Rust and Axum.
cargo add seamless-authRust 1.88 or later, Axum 0.8. Documentation: https://docs.rs/seamless-auth
What it does
- Serves the Seamless Auth routes at
/auth(Router::new().nest("/auth", auth.router())). Which routes it serves, and what each does to the session, comes from the auth API's adapter manifest. It is fetched live, with a bundled copy as the fallback. - Browsers get
HttpOnlycookies on your own domain. Native clients use bearer tokens (x-seamless-auth-transport: bearer). - Silent refresh restores a missing access cookie from the refresh cookie. One rotation per refresh token is shared for 5 seconds, so parallel tabs don't trip reuse detection.
require_auth()is a tower layer, andUseris an extractor, for your own routes.TrustedProxiesresolves the end user's address by walkingX-Forwarded-Forfrom the right. There is deliberately no hop-count option.deliverhands OTP codes and magic links to your own transports.
Security
- Every session token is verified against the API's JWKS (RS256 with the algorithm pinned, plus iss, aud and exp checks) before any cookie is issued from it. The token type and subject must also match the route.
- Each cookie is bound to its slot by a signed
kindclaim. The guard also requires the inner API token to be an access token, so a sign-in flow cookie never passes for a session. - No token reaches a cookie-transport response body, and delivery payloads are stripped in both transports.
- Request bodies must be JSON. Cross-site state changes are blocked while cookies are
SameSite=None, on the auth routes and behind the guard. - The upstream client follows no redirects.
Conformance
Passes the seamless-cli adapter conformance suite (25 of 25), in CI on every change, alongside the Express, Fastify and Go adapters.