Secure, stateless auth library for Go. AES-256-GCM encrypted cookies and opaque tokens inspired by ASP.NET Core Identity.
Most authentication libraries either force you into heavy server-side session stores (like Redis) or rely on standard JWTs that expose user claims in plain text to the client.
xvelope takes a different approach by bringing the robust architecture of ASP.NET Core Identity to Go, focusing strictly on statelessness and data privacy.
- Stateless by Design: Your server doesn't need to track session state in memory or a database cache. The entire authentication context travels securely with the HTTP request.
- Sealed, Unreadable Cookies: Instead of base64-encoded JWTs,
xvelopeuses AES-256-GCM Envelope Encryption. The client receives a mathematically sealed cookie. If they try to decode it, they see nothing. If they tamper with it, the GCM auth tag instantly rejects it.- Opaque Bearer Tokens: For API and mobile clients,
xvelopeissues opaque access and refresh tokens. Zero Personally Identifiable Information (PII) or internal role data is exposed to the frontend.- Familiar Identity Engine: Built around the tried-and-true concepts of
UserManager,SignInManager, andClaimsfrom ASP.NET Core, giving you an enterprise-grade API tailored for Go.
When a user logs in, xvelope processes the identity:
- Gathers the user's
Claims(ID, Email, Roles). - Serializes and compresses the payload.
- Encrypts the payload using an AES-256-GCM master key.
- Wraps the cipher in an
HttpOnly,Secure,SameSite=Strictcookie or an Opaque Token pair. - On the next request, the middleware instantly decrypts and reconstructs the Go context—with zero database lookups.