Over the past several months we built a general-purpose account-management plugin for RESTHeart and, in parallel, migrated Ulabase's own authentication layer onto it. Both pieces of work landed in June. We also made the result available to Ulabase users through a new configuration interface called Sign-up Mgmt.


restheart-accounts: Application-Level Auth in a Plugin

User registration looks simple from the outside: a form, an email, a token. The work is in the details. Verification links expire. Passwords need strength checks. Invite flows for new and existing users behave differently. OAuth providers require secure state handling. Consent records must be persisted for compliance. Every project builds the same machinery again, and the details are easy to get wrong.

restheart-accounts implements that machinery once. It ships as a self-contained plugin and adds a set of HTTP endpoints to any RESTHeart deployment: POST /auth/register, GET /auth/verify, POST /auth/forgot-password, PATCH /auth/reset-password, POST /auth/invite, PATCH /auth/activate, GET /auth/oauth/authorize/{provider}, and more. All of them work with the existing RESTHeart security pipeline and issue standard JWT cookies that the rest of the stack already understands.

The registration flow enforces password strength using zxcvbn with a configurable minimum score, checks email uniqueness with a 409 Conflict before writing anything, generates a cryptographically random 256-bit verification token, and sends the verification email in the same atomic step. The forgot-password endpoint always returns 202 Accepted, whether or not the account exists, which prevents email enumeration. Token comparisons use constant-time functions throughout. A team that installs the plugin gets these behaviors without designing and testing them.

Team management is built around a MembershipProvider SPI that decouples the plugin from any particular data model. The built-in implementation stores teams in a MongoDB orgs collection and tracks memberships on the user document. A deployment can plug in its own provider without touching the plugin.

An invitation follows one of two flows, depending on whether the invited person already has an account. The plugin detects which case applies. It stores all pending invitations in a dedicated auth_invitations collection, so a single user can hold open invitations from multiple teams at the same time.

Social login via Google OAuth is included. The plugin handles the full authorization code flow server-side: CSRF state generation, code exchange, user upsert and JWT issuance. The client only redirects the browser to /auth/oauth/authorize/google and waits for the callback to land the user in the authenticated area. Invitation acceptance via OAuth is also supported: a pending invite token attached to the authorize URL is picked up and resolved at callback time.

Multi-tenant deployments are supported through a per-request override mechanism, with two interceptors in the deployment layer. AuthDbResolver maps the incoming hostname to the correct MongoDB database. TeamConfigInterceptor reads per-service configuration from MongoDB and attaches it as request attributes. With them the same plugin instance serves many distinct tenants, with no per-tenant configuration of the plugin itself.


Ulabase Migrated to restheart-accounts

We migrated Ulabase's own infrastructure to restheart-accounts before offering it to customers.

Ulabase's authentication and invitation system had grown over several years and had accumulated a lot of custom logic. The migration replaced that code with restheart-accounts endpoints and adopted the standard MembershipProvider contract for all team operations. It also removed a set of ad-hoc interceptors that had handled invite tokens, role assignment, and OAuth state separately.

As a result, the plugin had handled real traffic before customers used it. Our own environment exercised the edge cases of the OAuth callback flow, the consent-persistence interceptor pattern, and the behavior of the auth_invitations collection under concurrent invite resends.


Sign-up Mgmt: Configure Auth for Your Service from the Console

The third piece is the one Ulabase users see. Under each service in the console there is now a Sign-up Mgmt section, where you configure restheart-accounts for the users of your own application.

When you land on the page for the first time, the accounts plugin is not yet installed on your service. A single button installs it and creates the initial configuration. From then on the service exposes the authentication endpoints under its own domain (/auth/register, /auth/verify, /auth/forgot-password, and the rest), ready to be called by your frontend.

The configuration form sets three values: the application name that appears in email subjects, the frontend base URL used to build links inside transactional emails, and the URL of the authenticated area where users are redirected after a successful auto-login.

Feature toggles enable or disable each capability independently. You can keep registration and password reset and turn off team invitations, or keep every flow active except OAuth while you are still setting up your Google credentials. Disabled endpoints return 403 to callers.

The default built-in email templates carry Ulabase branding. The Sign-up Mgmt page lets you paste your own HTML for each of the three transactional emails: verification, password reset, and team invitation. You can preview them in the browser before saving, and check the layout and the placeholder substitution before any real user sees them.

Google OAuth configuration is on the same page. You enable the provider with a toggle, paste your Client ID and Client Secret from the Google Developer Console, and save. The credentials are stored server-side and never exposed to the browser. From that moment your service's /auth/oauth/authorize/google endpoint is live.

The page is also a reference for the REST API your service now exposes. It lists the available endpoints grouped by feature area, each with its HTTP method, path, and a short description. A copy-to-clipboard button assembles the full URL against your service's base address.


What This Means in Practice

With the plugin, the cloud-server refactoring and the console UI in place, adding an authentication system to a RESTHeart service is now a configuration task.

You open the Sign-up Mgmt page, click Enable, set your app name and redirect URLs, upload your email templates, optionally connect Google OAuth, and save. Your MongoDB-backed backend now handles registration, email verification, password reset, social login, and team invitations for your users, with the same logic that runs Ulabase itself. The setup takes a few minutes.

Build your app on Ulabase

Your backend is ready in minutes, and you spend your time on your app. The Free plan needs no credit card.