Today we are launching
Auth — a modern lightweight authentication library for your SST apps.
With a simple set of configuration, it’ll create a function that’ll handle various authentication flows. You can then attach this function to your API and SST will help you manage the session tokens.
Auth is completely stateless, standards based, and free to use.
You can read more about it over on our docs.
Auth is made up of the following pieces:
Auth— a construct that creates the necessary infrastructure.
- The API routes to handle the authentication flows.
- Securely generates a RSA public/private keypair to sign sessions.
- Stores the RSA keypair as secrets in the app’s
AuthHandler— a Lambda handler function that can handle authentication flows for various providers.
- High level adapters for common providers like Google, GitHub, Twitch, etc.
- OIDC and OAuth adapters that work with any compatible service.
LinkAdapterto generate login links that can be sent over email or SMS.
- Can be extended with custom adapters to support more complex workflows, like multi-tenant SSO.
Session — a library for issuing and validating authentication sessions in your Lambda function code.
- Implemented with stateless JWT tokens that are signed with the RSA keypairs mentioned above.
- Support for passing tokens to the frontend via a cookie or the query string.
- Full typesafety for issuing and validating sessions with the
We hosted a launch livestream on YouTube where we did a demo and a deep dive into the internals.
The video is timestamped and here’s roughly what we covered.
- What is Auth?
- Setting up the construct
- Configuring the AuthHandler function
- Magic link adapter
- Issuing a session
- Validating a session
- Behind the scenes
Follow the Setup section in our docs to get started.