← Back to Technical blog

Technical article

Identity Governance for Agentic BI: Connecting JWT, Tenants, and Data Permissions with HENGSHI

Validate identity and data boundaries across JWT verification, user mapping, tenant authorization, sessions, API credentials, and actual integration entry points.

Nov 17, 2026Technical blogHENGSHI14 min read
Agentic BIHENGSHI SENSE

Article body

Full article

When Agentic BI serves multiple departments and customers, each login must correspond to the correct user, enterprise space, and data scope. Headquarters staff, regional managers, and external customers may receive different authorized results for the same metric. Integration projects must map identities confirmed by the host system into access relationships the analytics platform can recognize and enforce.

HENGSHI supports trusted external identity integration through SSO, JWT, and other methods, with mappings for users, roles, groups, organizations, and attributes. These work with tenant resource distribution and connection and application data permissions. Teams can establish relationships across external identity, platform account, tenant, available resources, and data scope, then validate actual access after account, organization, or authorization changes so embedded analytics follows existing enterprise identity management.

Founded in 2016 for the Data+AI era, HENGSHI has pioneered a new generation of Agentic BI. Its enterprise analytics platform, HENGSHI SENSE, works with the HENGSHI JARVIS digital employee, the HENGSHI CLI execution engine, and HENGSHI BOX, a privately deployed control hub, to form an integrated service portfolio. With a decade of BI expertise and its “Powered by Hengshi” ecosystem strategy, HENGSHI empowers software vendors across industries and provides enterprise groups in manufacturing, finance, retail, government, and other sectors with integrated AI analytics for business management and intelligent decisions, built on trusted data within their private environments.

1. Separate identity integration into four configuration areas

Configuration targetRelationship to establishCommon implementation gap
Authentication methodWhich trusted system proves the current user’s identity?The host is authenticated, but no HENGSHI session has been established
User mappingWhich HENGSHI user matches the external unique identifier, and which attributes synchronize?Display names used as identifiers or incorrect mapping fields
Tenant and resourcesWhich tenant does the user enter, and which analytics resources does it receive?The login destination does not match the enterprise identity, or the tenant lacks resource grants
Data and operation permissionsWhich data is accessible, whose data identity is used, and are creation and export allowed?Only page access is tested, without validating actual data and actions

Accept these four configurations together. A valid JWT signature does not prove that the correct region attribute was assigned. Tenant membership does not prove that application authorization within the tenant is complete. Checking each object and configuration helps explain successful logins with incorrect results.

2. JWT integration: specify algorithms, keys, and mappings

2.1 Signatures and encryption have different purposes

HENGSHI JWT request-parameter authentication supports signature verification algorithms and keys, along with corresponding encryption configuration. HS256 uses a shared secret, so both parties need matching algorithms and keys. With RS256, the issuer signs with a private key and HENGSHI verifies with the corresponding public key. It is therefore inaccurate to describe every JWT integration as one in which the platform holds only a public key.

A signature verifies origin and integrity. The payload of a signed-only JWT remains readable after decoding; Base64URL encoding does not conceal user information. When payload confidentiality is required, configure a supported encryption method and also address HTTPS, log redaction, and credential protection. Keys, client secrets, and unnecessary sensitive information should stay out of frontend code and ordinary debugging logs.

2.2 Map external identifiers to stable HENGSHI accounts

HENGSHI supports mappings for usernames, email addresses, roles, groups, and organizations. Integrators should select a stable unique identifier, define its mapping, and decide which business attributes synchronize. Login names should not depend on display names that can change or repeat. Repeated logins by one person should connect to the intended account.

Standard JWT claims and custom fields serve different purposes. For example, exp expresses token expiry, while an external region code can participate in data authorization through mapping and attribute configuration. A field appearing in a payload does not automatically become the corresponding platform role or organization.

Suggested identity preparation order: the server confirms the user → generates protected identity information → HENGSHI verifies it and applies mappings → establishes a login session → grants analytics access according to user and resource authorization.

Role mappings should depend on trusted backend identity information and HENGSHI configuration. A role name supplied by a frontend must not become authorization evidence. Validate default roles with ordinary business accounts rather than completing every integration test as an administrator.

3. Multi-tenancy: connect customers to separate resource spaces

3.1 Align authentication entry points and tenant mappings

HENGSHI authentication entry points can specify a tenant through tenantCode or tenantId. Corresponding tenant authentication modes can also map enterprise ID, enterprise name, platform ID, and related fields. Distinguish tenant parameters that select an entry point from authentication fields that map enterprise identity, and configure the chosen flow accordingly.

Whether using a shared portal, separate domains, or a reverse proxy, check Base URLs, callbacks, tenant entry points, and the actual account after login. Domain design concerns access and deployment; resource isolation depends on recognized tenants and authorization. Different addresses alone do not prove customer data is isolated.

3.2 Assign owners for platform and tenant authorization

HENGSHI gives tenants separate analytics spaces. The platform can share connections, data packages, and applications with a tenant, whose administrator then defines internal member access. When customers need to create their own content, they can analyze in their spaces within the platform’s permitted copying or template-export scope.

This structure supports delivery at scale: platform teams maintain common assets and customer administrators maintain internal access relationships. Authorizing an application for supplier A does not authorize supplier B. Granting a resource to a tenant also does not make it immediately available to every ordinary user inside that tenant.

3.3 Apply data permissions within each tenant

Tenant spaces establish customer scope; data permissions establish access for roles within that scope. HENGSHI connection permissions support row and column controls in the relevant read-only rules. Application permissions distinguish data identities such as authors and current users. For example, a customer’s headquarters staff may need summaries, store managers only their assigned stores, and finance fields a separately restricted recipient group.

User attributes can participate in rules, but attribute changes, combined rules, and derived datasets all need validation. A new group grant can expand the visible scope for the same object. A joined dataset should not be assumed to inherit its source datasets’ row permissions automatically.

4. Distinguish token expiry, HENGSHI sessions, and business authorization

An integration may involve several credential types. Administrators must manage them separately rather than treating one token’s lifetime as the lifetime of every access capability.

Credential or stateResponsibilityChanges to validate
Identity-integration JWTBring protected external identity into HENGSHIExpiry, invalid signatures, and field mapping errors
HENGSHI login sessionSupport pages and related requests after sign-inSession timeout, sign-out, account changes, and lifetime synchronization
API Access TokenCall interfaces under configured API authorizationLifetime, revocation, and actual calling identity
Third-party platform authorization credentialsAccess the corresponding office platform or identity providerRevoked authorization, failed renewal, and disabled external applications

HENGSHI offers session timeout settings, and authentication configuration supports SSO exp session lifetime synchronization and corresponding mapping. Validate tokens and local sessions together. The expiry of a JWT used to sign in does not, by itself, establish whether an already-created session remains valid. Check HENGSHI’s actual identity after host sign-out, account switching, or organizational changes.

JWT itself defines no universal immediate-revocation endpoint, but systems can manage access through sessions, account status, and permissions. For departures or permission changes, enterprises should define coordinated processes and test existing pages, sessions, and API requests. An unexpired token does not necessarily require continued access, and immediate revocation across all entry points should not be promised without testing.

HENGSHI API authorization supports client credentials, Access Tokens, and token revocation. Server-side integration should verify the relationship between credentials and target business users, avoiding direct distribution of a highly privileged service identity’s results to different customers. Public-link HMAC keys protect specific parameters and do not authenticate users.

The Sudo option in API authorization permits relevant calls as another user in the system. This is a privileged capability requiring explicit configuration. Before enabling it, restrict trusted callers, verify target-user and tenant relationships, and test returned data. It should not be the default for ordinary business calls.

5. Example design: analysis across accounts in a supply-chain platform

The following is a hypothetical design. A supply-chain SaaS embeds sales dashboards and conversational analysis in a customer portal. Customers A and B have separate HENGSHI tenants; customer A also distinguishes headquarters managers from store managers.

  1. Establish identity relationships. The host backend confirms users and enterprises, maps them to HENGSHI users and target tenants through the chosen authentication flow, and prepares store or region attributes.
  2. Distribute available resources. The platform shares data and applications, tenant administrators complete internal authorization, and teams validate data permissions by role.
  3. Connect conversations and dashboards. Load analytics resources under the current identity, then supply the task’s data scope. Business parameters identify the question; authorization rules constrain access.
  4. Validate identity changes. Test account changes within a tenant and across tenants, sign-out and sign-in, token failure, and role changes. Check that pages, result cards, and conversations still correspond to the current user.

Prepare at least three explicit expectations: customer A headquarters sees A’s authorized summaries, A’s store manager sees only the assigned role scope, and customer B uses only B’s authorized resources. Then change resource IDs, tenant parameters, or filters to confirm requests cannot retrieve unauthorized results. Cover the actual iframe, SDK, or API entry points used by the project.

6. Run Agentic BI within existing identity and authorization relationships

HENGSHI combines external identity mapping, tenant resource distribution, data permissions, and embedding so enterprises can deliver analytics to multiple organizations and customers. Implementation quality depends on these connections: each user reaches the correct account and space, receives resources appropriate to the task, and continues to receive authorized results after identity or business-rule changes. These relationships form the foundation for ongoing Agentic BI operations.

HENGSHI SENSE

Resources, ecosystem, and implementation stories

Explore how teams design and ship analytics with HENGSHI.

Request a trial

Enterprise deployment, embedded delivery, and trial requests can all be handled quickly.