I'm updating an older project built with SolidJS and AstroJS and need to replace its OAuth setup. I only need login through providers such as Discord and Reddit, and I want the solution to be self-hosted rather than a hosted SaaS product. Database integration is optional since I'm fine handling that manually. With several popular authentication libraries being deprecated or changing direction, what would you recommend?
5 Answers
A lightweight library such as Passport-style middleware or a smaller OAuth package may still work, but check its recent releases, provider support, and security practices first. Since you only need a couple of providers and don’t mind managing the database yourself, a minimal custom integration may be simpler than adopting a full authentication platform.
ZITADEL is another self-hostable option for authentication and OAuth. If your project also needs detailed authorization rules, OpenFGA can handle that separately. This is a stronger fit for a larger application, but probably heavier than necessary for a basic social-login flow.
I’d be cautious about relying on older recommendations such as Lucia or Auth.js without checking their current maintenance status. Several previously popular options have been deprecated or now point users toward another project, so verify the latest support and migration guidance before adopting one.
You could implement the OAuth flow yourself. For basic provider login, that mostly means building the authorization URL, exchanging the callback code for tokens, validating the state value, and handling the provider response. Use a cryptographically secure random generator for both state and PKCE code verifiers, and make sure the redirect and token-handling logic follows each provider’s current documentation.
Keycloak is worth considering if you want a complete self-hosted identity server instead of implementing authentication inside the application. It supports OAuth and can manage users, providers, sessions, and administration, though it may be more infrastructure than you need for just Discord and Reddit login.

For a small OAuth-only integration, this can be a reasonable long-term option. A well-maintained framework-specific library is still preferable when available, but choosing an unmaintained authentication package can create more risk than keeping a small, well-tested implementation under your control.