darto_auth 1.1.0
darto_auth: ^1.1.0 copied to clipboard
Authentication for the Darto web framework — password hashing (PBKDF2), session-based auth, and OAuth 2.0 / OpenID Connect (Google, GitHub).
1.1.0 #
- OAuth 2.0 / OIDC —
OAuthProviderwith PKCE S256 on by default, randomisedstate(CSRF), Authorization-Code flow exchange and a pluggableuserMapper. OAuthProvider.oidc(issuer: ...)— async factory that discovers the authorization, token and userinfo endpoints from.well-known/openid-configuration.- Pre-configured
OAuthProvider.google(...)(via OIDC) andOAuthProvider.github(...)factories. provider.attach(app, prefix, onSignIn: ...)— registersGET <prefix>(redirect) andGET <prefix>/callback(exchange + sign-in) in one call. Integrates directly with the session-basedsignInhelper.id_tokenclaims decoded (no signature verification — TLS to the token endpoint is the source of authenticity; JWKS verification is a future optional add-on).OAuthUser,pkceVerifier,pkceChallenge,randomTokenexported.
1.0.0 #
- Initial release.
- Password hashing — PBKDF2-HMAC-SHA256 with random salt, no native
dependencies.
hashPassword/verifyPasswordand the configurablePasswordHasher. Hashes are self-describing and verified in constant time. - Session auth (built on
package:darto/session.dart):signIn,signOut,authUser, and theauthGuard()middleware (401 / custom handler when unauthenticated; setsc.useron success).