Custom Web Apps

Client portal architecture: scaling secure B2B access

A portal that assigns one database to every client can become an operational burden long before it becomes a security advantage.

Client portal architecture: scaling secure B2B access

Schema changes have to be repeated, connection pools multiply, and a platform team can end up maintaining bespoke data plumbing for each tenant. The opposite shortcut is no safer: a shared table with a tenant_id column, but no reliable enforcement at the data-access layer, is not isolation. It is a promise that every query will remember to keep customers apart.

Those are two ends of a problem that shapes client portal architecture for custom web applications. The answer is rarely a clever storage trick. It is a set of connected decisions about how organizations, users, permissions, and data relate—and where those relationships are enforced.

The commercial case for getting those decisions right is straightforward. B2B customers want to find documents, check status, and resolve routine questions without waiting for a person to respond. When the portal can do that reliably, support teams have more room for issues that need judgment. But self-service only works when customers trust the access boundary. A portal that saves time for one user by making another tenant’s information visible has failed at its central job.

A client portal is not a side door into the product. It is part of the relationship customers trust the product to protect.

The economics of self-service: why B2B portals are essential

For years, many B2B companies treated the client portal as a polite concession: a place to download invoices, submit tickets, and perhaps check an order. That view understates what the portal is doing. It is where customers increasingly expect to manage the everyday parts of a business relationship on their own schedule.

Self-service does not mean removing people from support. It means giving customers a useful first option when the answer is already in a document, a status update, or a familiar workflow. A customer who can check a project’s progress without emailing an account manager gets an answer sooner. The account manager gets time back for work that actually benefits from a conversation. Repeated across routine interactions, that changes how a growing service team spends its capacity.

The economics depend on the details. A portal only deflects support work when its information is current, its search and navigation make sense, and users can reach the actions they are allowed to take. Publishing documents is not enough if customers cannot tell which version is current. Showing an order status is not useful if the displayed state lags behind the system that operations use. And a clean interface does little for self-service if a user has to ask an administrator to recover access every time a team changes.

That is why the portal should be treated as operating infrastructure, not a thin layer over the “real” application. It needs owners for its content and workflows, a dependable connection to the systems of record, and a security model that can be explained to a customer’s IT team. When those foundations are in place, support can focus on ambiguous and high-stakes cases rather than routine retrieval.

The procurement implications arrive early, too. A customer’s security review may ask how identities are verified, how access changes when an employee leaves, what gets recorded in an audit log, and where customer data is stored. Those are not finishing touches. If the architecture cannot answer them clearly, the sales process inherits that uncertainty.

Designing for multi-tenancy: the organization-first identity model

The first consequential design decision is how a customer organization relates to the application. In a B2B portal, the organization is usually the primary boundary for data and administration. Individual users act within that boundary, sometimes as members of several projects or teams. Model the application as if it were a consumer service where every user stands alone, and tenant context tends to appear later as a patch.

There are several common storage patterns. None removes the need for careful authorization, but each puts the operational and isolation trade-offs in a different place.

PatternIsolation modelOperational trade-offWhen it may fit
Database per tenantSeparate database for each organizationStrong separation, but migrations, backups, and connections become harder to manage as tenants growCustomers with specific isolation or residency needs
Schema per tenantSeparate schema within a databaseSome separation, while still requiring tenant-aware maintenanceCases where a shared database is required but separate schemas are useful
Shared schema with tenant keysShared tables with tenant identifiersEasier to operate centrally; correctness depends on consistent enforcementA common default for SaaS portals with many customers

A shared schema is often a practical starting point, but the tenant_id column is only a piece of the design. It does not protect anything by itself. The application needs a trusted source of tenant context, and every data-access path needs to apply that context consistently. Database-per-tenant can make sense where a customer has a genuine isolation or residency requirement. It can also increase the cost of routine work, so the choice should follow a concrete requirement rather than a general desire to feel safer.

The identity model should reflect the same organization-first logic. A user signs in as an individual, but their access is granted within one or more organizations. The application must know which organization the user is acting for, what membership gives them access, and whether they are allowed to switch between organizations.

That context should come from a verified session or other trusted server-side state—not from a tenant name supplied in a URL or a client-controlled header. A URL can help route a user to the right place, but it is not proof that the user belongs there. Likewise, a token claim is useful only if the token is validated and the organization membership is still valid for the action being requested.

This distinction matters in no-code builds as much as in conventional application stacks. A portal assembled from a front end, workflow automations, and connected data sources still has to answer the same question: which organization does this request represent, and where is that boundary enforced? Secure data access in no-code portals cannot depend on hiding a page or filtering a list in the browser. Those are interface behaviors, not reliable access controls. The server-side workflow, API, or data source must apply the authorization rule before returning or changing records.

A useful test is to follow a single request from sign-in to storage. Where is the user authenticated? How is organization membership checked? How is the tenant context passed to the service that retrieves the record? What prevents a caller from changing an identifier and requesting another customer’s data? If those answers vary by endpoint, the portal does not have one tenant model; it has a collection of assumptions.

Authentication patterns: solving password fatigue with enterprise SSO

Authentication is often the first daily interaction customers have with a portal, so friction shows up quickly. A separate username and password, an unfamiliar reset flow, and a branded subdomain that users visit only occasionally can make the portal feel like another chore. When that happens, customers fall back to email and support channels—the opposite of what self-service is meant to accomplish.

Enterprise single sign-on addresses part of the problem by letting a customer’s identity provider handle the login. Common patterns include SAML and OpenID Connect (OIDC). The right choice depends on what the customer’s identity system supports and what the portal’s authentication service can integrate with. In either case, the important architectural point is not simply that a login succeeds. The portal must map that authenticated identity to the correct organization and apply the organization’s access rules.

Avoid relying on a rough email-domain match as the whole tenant assignment strategy. A domain can be shared across business units, used by contractors, or differ from the domain associated with a customer’s portal account. A deliberate organization-to-identity-provider configuration gives the customer’s IT team a clearer way to manage that connection. Where users can belong to multiple organizations, the interface should make the active context clear and the server should verify it when each action is authorized.

Single sign-on handles authentication, but it does not automatically keep a portal’s user list current. That is where provisioning matters. SCIM can let an organization’s identity system create, update, and deactivate accounts in connected applications. Without a defined deactivation path, a user who leaves a company may retain portal access until somebody remembers to remove it manually. The implementation should also decide what happens to a user’s records and responsibilities when their account is disabled; deleting an identity should not erase the history needed for auditability.

Not every customer needs enterprise identity integration. Smaller organizations, trial users, and individual contractors may be better served by a password manager-friendly login, a magic link, or passkeys, depending on the product and identity provider. The point is not to offer every sign-in method. It is to choose a set of methods that meets customer needs without creating separate, inconsistent authorization systems underneath.

Use an established identity service where it fits rather than building protocol handling from scratch. That keeps custom development focused on the portal’s organization model, permissions, and workflows instead of making the product team responsible for every edge case in authentication. It also makes the security boundary easier to explain: the identity provider verifies the user; the portal verifies what that user may do.

Enforcing data isolation: RBAC, ReBAC, and tenant-aware routing

Authentication answers who has signed in. Authorization answers what they can access. A user can be correctly authenticated and still be shown another organization’s invoice if the portal relies on an unchecked record ID or a filter that runs only in the interface.

Role-based access control (RBAC) is often the simplest place to start. Users receive roles such as administrator, member, viewer, or billing contact, and each role maps to a set of permissions. This is easy to explain and can work well when responsibilities are stable and apply broadly across an organization.

The limitations appear when access depends on relationships between users and specific objects. Perhaps a person can see one project but not another, or can review a document because they are assigned to a particular deal team. Relationship-based access control (ReBAC) represents permissions through those connections: a user belongs to an organization, is assigned to a project, and can access documents attached to that project. For a portal with substantial sharing between teams and resources, that model may describe the real rules more clearly than a growing list of role exceptions.

Access modelUseful whenWatch for
RBACPermissions map cleanly to a small set of organization-wide rolesRole lists can proliferate when access differs by project or resource
ReBACAccess follows membership, ownership, assignment, or sharing relationshipsRelationships need to be modeled and maintained consistently
Hybrid modelA few broad roles coexist with resource-specific relationshipsRules can become difficult to reason about if both models overlap without a clear priority

There is no prize for using the most elaborate model. Start with the access rules the business actually needs, then choose a model that keeps those rules understandable as the product grows. If the portal needs organization-wide billing permissions plus project-level membership, a limited combination may be appropriate. The danger is not a hybrid by definition; it is adding policies without a clear way to see, test, and audit their combined effect.

Whatever the model, tenant context must be verified along the full request path. A tenant-aware route can make the interface easier to navigate, but the route itself is not an authorization check. Similarly, checking access in a page component is not enough if a separate API endpoint, background job, export, or automation can retrieve the same records without applying the same rule.

The most durable enforcement point is close to the data. Depending on the stack, that may mean database row-level security, scoped views, a service layer that requires an authorized tenant context, or a query builder that adds tenant constraints by construction. The specific mechanism matters less than whether it is difficult to bypass and whether every path uses it.

This is especially important for custom portals built with low-code or no-code tools, where data access may be distributed across visual workflows, integrations, and generated APIs. A page-level filter can make the screen look correct while leaving the underlying endpoint exposed. Test the actual request and response, not just what the interface displays. Include exports and background processes in that review: they are easy to overlook because they do not look like ordinary page views.

A practical authorization test should cover both allowed and denied cases. Can a user see the project they belong to? Can they not see a neighboring project in the same organization if the relationship does not grant access? Can they not retrieve a record belonging to another tenant by changing an identifier? Do access changes take effect where expected? These questions turn “tenant isolation” from a design claim into behavior the team can verify.

Compliance and auditability: meeting enterprise procurement standards

Enterprise procurement often asks for evidence about how a vendor protects data and manages access. Many enterprise buyers expect or request SOC 2 evidence, though it is not a universal requirement: expectations vary by customer, industry, and procurement process. Other requirements depend on what the portal handles and where it operates. HIPAA considerations may apply when a product handles protected health information, and GDPR obligations may apply when personal data falls within its scope. The architecture should support the obligations that actually apply, rather than treating a list of standards as a substitute for understanding the product’s data.

Compliance is not achieved by adding a badge or answering a questionnaire with confident language. It depends on whether the system can show how access is controlled, how changes are recorded, and how data is handled through its lifecycle. Those capabilities are much easier to build when they are part of the design than when a procurement review has exposed their absence.

Audit logs should capture meaningful security and administrative events: authentication activity, membership changes, permission updates, and access to sensitive resources where appropriate. A useful log records enough context to investigate what happened—who acted, what action they took, which organization or resource was involved, and when it occurred. Logging every routine event without a retention and review plan can create noise rather than accountability. The goal is evidence an operator can actually use.

Per-tenant export and deletion paths matter for the same reason. Customers may need to retrieve their data, and some legal or contractual obligations may require deletion or other handling. If the only way to do this is a manual query written for each request, the process is difficult to repeat and easy to get wrong. A planned workflow should account for primary records, uploaded files, connected services, and relevant audit history; deletion and retention requirements can differ, so the process needs to preserve required records without keeping data indefinitely by accident.

Encryption and key management also need to be described accurately. Teams should know how data is protected in transit and at rest, how access to keys is controlled, and what rotation or recovery procedures exist. A security questionnaire is not the place to discover that the written description of the system is more confident than the implementation.

Finally, give customer administrators a way to review access. They should be able to see who belongs to the organization, what role or relationship grants access, and which users retain administrative privileges. That visibility makes access reviews more than a request for an account manager to assemble a spreadsheet by hand.

These practices do not guarantee that every procurement review will be short. They do make it possible to answer questions with evidence instead of improvisation. And they give the product team a firmer basis for deciding which customer-specific requirements belong in the platform and which are better handled by configuration.

Architecture is part of the customer promise

The choices behind a B2B portal are not abstract infrastructure preferences. They determine whether a customer can onboard users without help, trust that those users will see only what they should, and answer its own security team’s questions with confidence.

That does not require a separate database for every customer, or an elaborate permissions system on day one. It does require an organization-first identity model, an explicit source of tenant context, and data-access rules enforced beyond the visible interface. Choose RBAC when roles describe the real permissions; use relationships when access follows specific projects or resources. Support the identity methods customers need, and make provisioning, auditing, export, and deletion part of the design rather than emergency work.

A portal earns its place when it makes routine work easier without asking customers to lower their standards for security. Get that balance right, and self-service becomes more than a convenient screen: it becomes a dependable part of the B2B relationship.

FAQ

Is a separate database for every client necessary for security?
No, a database-per-tenant is only necessary if there are specific isolation or residency requirements. A shared schema is often a practical starting point, provided that tenant context is consistently enforced at the data-access layer.
Why is a tenant_id column in a shared database not enough for isolation?
A tenant_id column is only a piece of the design and does not protect data by itself. The application must have a trusted source of tenant context and apply that context to every data-access path to ensure consistent enforcement.
Should I use RBAC or ReBAC for my portal?
Use RBAC if permissions map cleanly to a small set of organization-wide roles. Use ReBAC if access depends on specific relationships, such as membership in a project or ownership of a resource.
How can I secure a portal built with no-code tools?
You must ensure that the server-side workflow, API, or data source applies authorization rules before returning records. Relying on page-level filters or hiding elements in the browser is not a reliable access control.
What is the role of SCIM in a client portal?
SCIM allows an organization’s identity system to automatically create, update, and deactivate accounts in the portal. This ensures that users who leave a company do not retain unauthorized access.

Also interesting