Skip to main content

Authentication and Permissions

Authentication answers "Who is the request coming from?" and authorization answers "Can this identity perform this operation on the current object?" In NexusFlow, page menus, platform roles, organization roles, resource ownership, and temporary session permissions all work together to affect the final result, but The endpoint verification of the platform server is always the final basis .

Developers should not infer permissions based on whether a button is displayed on the front end, nor should they rely on resource IDs, public links, or a successful query as authorization credentials for subsequent write operations.

First Distinguish Three Types of Credentials​

CredentialsPurposeScopeIs It Interchangeable
Platform access tokens and refresh tokensCall the REST API to establish the current user identityPlatform resources that the current account is allowed to accessNon-fungible job connection ticket or MCP client token
Job WebSocket one-time ticketThe browser connects to a real-time messaging channel for a specified jobSpecified user, specified job, one connection within a short period of timeNot available for REST API or reused to another job
MCP page session and client tokenLet external AI clients operate the current page within the scope of user authorizationSpecified page, specified model or draft, selected permissions, and page loaded jobsNot replaceable for platform login tokens, nor for access to other page contexts

These credentials are sensitive information. Do not put any tokens into the URL except for one-time tickets that are explicitly passed via WebSocket query parameters as specified by the platform; the full connection URL containing the one-time ticket cannot be written to logs, repositories, bug reports, or screenshots.

Login with Username or Email​

The login interface receives "username/email" and password. The caller can submit the user name or the complete email address bound to the account; both methods ultimately correspond to the same platform user.

Return after successful login:

  • Access Token: Sent with ordinary API requests, used to prove current identity in a short period of time;
  • Refresh Token: only used to obtain new access tokens and should not be sent with ordinary business requests.

Normal API requests pass the access token using the request header:

Authorization: Bearer <access_token>

Do not put the access token into query parameters, and do not log the full request header in the client error log.

Account Status Checked When Logging In​

The platform will check when logging in:

  1. Whether the username or email and password match;
  2. Whether the account has been deactivated;
  3. Whether the account has expired;
  4. Whether the password has exceeded the allowed usage period.

Account deactivation, account expiration, or password expiration will prevent new logins. The client should display the actionable prompts returned by the server, but should not expose more account existence information to unauthenticated callers based on different errors.

Access Token Expiration and Refresh​

The validity period of access tokens and refresh tokens is determined by the platform configuration, and the integration code should not hard-code the specific duration. It is recommended to proceed in the following order:

  1. Use the access token to call the business interface.
  2. After receiving 401 Unauthorized, only one refresh request is initiated, and other failed requests at the same time are temporarily stored.
  3. Replace the access token after the refresh is successful; if a new refresh token is returned in the response, the old value must also be replaced.
  4. Replay the original request using the new access token.
  5. When the refresh fails, clear the local session and ask to log in again. Do not refresh in a loop or replay repeatedly.

Account deactivation, account validity period, and password validity period will be rechecked during refresh. Therefore, a refresh failure may not only indicate that the token has expired, but may also indicate that the account status has changed.

Platform tokens can carry platform roles, organization lists, and organization administrator ranges for trusted services to make permission judgments. After a role or organization membership change, claims in the old token may not reflect the latest status until the token is updated; the client should accept 401 or 403 and re-login or refresh the session after the administrator adjusts permissions, rather than long-term caching of role judgments.

See Authentication and Token Refresh for detailed interfaces.

Platform Roles and Organizational Roles​

Platform roles and organizational roles are two different sets of permission dimensions.

Role HierarchyAvailable RolesScope
platform roleOrdinary user, super administratorThe entire platform; super administrators can enter platform-level management and operation and maintenance scope
organizational roleOrdinary members, organization administratorsOnly effective for a certain organization; the same user can join multiple organizations and have different roles in different organizations

Organization administrators are still ordinary users of the platform and will not obtain platform-level super administrator rights for managing an organization. When judging the ability of an organization administrator, you must first determine Which organization does the target user or workspace belong to?, and then check whether the current user manages the organization.

For example, a user can be an administrator of organization A and an ordinary member of organization B. This user can use the organization administrator scope when managing the models and jobs of members of organization A, but when accessing the private resources of members of organization B, he is still treated as an ordinary member.

Unified Permission Determination Sequence​

The server endpoint should evaluate requests in the following order:

  1. Whether the Endpoint Allows Anonymous Access: Business resources usually require login; exceptions include authentication endpoints such as login and token refresh.
  2. Does the Credential Type Match?: REST API, job WebSocket, MCP page session and node agent use their own authentication methods.
  3. Are the Credentials Valid?: Check the signature, validity period, revocation status, and binding relationship with the target session or resource.
  4. Does the Platform Role Have Global Permissions?: Super administrators can skip normal resource scopes only if the endpoint explicitly allows it.
  5. Does the Resource Scope Match?: Check the organization, workspace, model ownership or public scope, job creator and other conditions in turn.
  6. Is the Operation Type Allowed?: Reading, modifying, deleting, running, controlling and operating and maintaining are different permissions. Successful reading does not mean writing is possible.
  7. Whether the Request Context Matches: Real-time tickets need to match jobs, and MCP requests need to match pages, permission items, and loaded jobs.
  8. Is the Business Data Valid?: After authorization, the request structure, resource status and operation preconditions must still be verified.

This sequence is also suitable for troubleshooting: first distinguish the identity problem of 401 and the authorization problem of 403, then check the specific resources and operations, and do not log in again or change the administrator account as soon as you see a failure.

Common Permission Matrix​

The following table gives the default scope of currently commonly used resources. "Organization administrators" all refer to organizations in the organization to which the target resource creator belongs and are managed by the current user; in other organizations, they are still judged as ordinary users.

Resource or OperationOrdinary UserOrganization AdministratorsSuper AdministratorNeed Attention
View and edit profileonly myselfyourself; some user management interfaces can cover members of the managed organizationall usersModifiable fields are still subject to endpoint restrictions
Use workspaceDirectly authorized, the organization to which they belong is authorized, or the space is open to all logged in usersSame as ordinary users; they may also have management capabilities when the space belongs to the organization they manage.all spacesUse permissions are not equal to write permissions for all subresources
View your own modelOKOKOKThe model still needs to exist and not be deleted
See full disclosure modelOKOKOKThe list of standard models is also filtered by accessible workspace
View public models within your organizationAvailable when sharing at least one organization with the model creatorYes; and you can query all models of the members of the managed organizationOKOrganization sharing does not propagate across organizations
View private modelsCreator onlyCreator, or model creator in the organization you manageOKPublic scope only affects read scope
Modify or delete a modelCreator onlyCreator, or model creator in the organization you manageOKEven if ordinary members of the same organization can view it, they cannot modify it.
View or control jobsOnly jobs you createYour own jobs, as well as jobs created by members of the organization you manageAll jobsBeing able to view a shared model does not mean that you can view the jobs of the model owner.
Create MCP page sessionYou can only bind workspaces and models that you have access toSame as left, page permissions are still subject to the selected MCP permissionsSame as left, page permissions are still subject to the selected MCP permissionsPlatform role does not bypass page session scope
System-level service, node and update package operationsnot allowedUsually not allowedallowIndividual workspace-specific update package endpoints can be authorized to the administrator of the space's owning organization.

Query parameters do not escalate privileges. Even if an ordinary user submits an administrator query type, the server should return data within its normal range instead of trusting the role claimed by the client. See User and Organization APIs for the specific scope of user-organization interfaces.

Workspace Authorization​

Workspace has at least three levels of permissions, which cannot be confused.

First Level: Whether the Space Can Be Used​

The platform determines whether a logged-in user can enter the space in the following order:

  1. Super administrators can access all spaces;
  2. When the space is configured to be accessible to all users, any logged-in user can use it;
  3. The user ID can be used when it is in the direct authorization list of the space;
  4. It can be used when the organization to which the user belongs has an intersection with the organization that the space allows;
  5. Access is denied when none of the above conditions are met.

"Space ownership organization" is used to determine management responsibility, and "permitted organization" is used to determine the scope of use. The two are not the same field. Just because the space belongs to Organization A, it does not mean that users outside Organization A must not be able to use it; whether it is available still depends on the authorization list.

Second Level: Whether to Enter the Management Scope​

Management lists, space metadata and space authorization configurations are usually judged according to the following scope:

  • Super administrator can manage all spaces;
  • Organization administrators can only manage spaces belonging to the organization within their management scope;
  • Ordinary members do not have space management rights.

The Third Layer: Whether Specific Sub-Resources Can Be Written​

Entering the management page does not mean that every write interface will be automatically released. Space metadata, organization authorization, global parameters, component definitions, and workspace update packages are checked by their respective endpoints for permissions; some endpoints are judged by the space ownership organization, and some endpoints are judged by the platform role or organization administrator role.

Therefore, developers must refer to the server-side verification of the corresponding endpoint. They cannot equate "page visible", "appears in the management list", "has space usage rights" or "is an administrator of any organization" with each other, nor should they assume uniform ownership of organizational isolation for all sub-resources. See Workspace and Component Definition APIs for specific interfaces.

Model Visibility and Administrator Query Scope​

The model disclosure scope is divided into private, public within the organization and fully public:

Public ScopeNormal Reading RangeAdministrator Additional Scope
privatemodel creatorOrganization administrators can access the models of members of the organizations they manage; super administrators can access all models
Disclosure within the organizationThe creator, and users who share at least one organization with the creatorSame as above
full disclosureLogged in userSame as above

Standard model list queries also combine query type, workspace accessibility, and filter criteria. Super administrators can use the platform-wide query scope; organization administrators can use the query scope of the members of the organization they manage, including the members' private models. The server should ignore administrator query requests without corresponding roles and fall back to the normal user scope.

Model visibility does not grant write access. When regular users open someone else's model from the Model Marketplace or an organization's shared list, they should treat it as a read-only resource; they should create their own copy if they need to edit it. For the model and snapshot interface, see Model and Snapshot APIs.

Job Access and Model Access Are Independent of Each Other​

There is no "Organization-wide" or "Full-public" level for jobs. Job access is mainly based on the job creator:

  • Creators can read details, results, logs, and snapshots, and perform normal job control;
  • Organization administrators can access jobs created by members of the organizations they manage;
  • Super administrators can access all jobs;
  • Even if other users can read the job source model, they cannot read jobs created by the model owner.

When creating a job, the platform will record the current caller as the job creator. Subsequent job details, results, logs, running snapshots, forced termination, and live connections all need to recheck the job access scope instead of only trusting the job ID saved by the client.

See Job, Control, and Result APIs for the job and result interface.

WebSocket One-Time Ticket​

When the browser subscribes to the real-time results of a job, it is recommended to use the following process:

  1. Requests a WebSocket ticket for a specified job using a platform access token;
  2. The server first confirms that the job exists, that the current user can access it, and checks whether the result channel is still available;
  3. The server issues short-term one-time tickets bound to the current user and job;
  4. The browser establishes the WebSocket with the job UUID and ticket;
  5. Real-time channel consumption ticket, check the job binding and object permissions again before accepting the connection.

Once the ticket is successfully consumed, it cannot be reused, nor can the ticket for job A be used for job B. After a connection failure, you should re-apply for tickets through the authenticated HTTP interface and do not save or replay old tickets.

Non-browser clients that use WebSocket request header authentication should follow the method explicitly supported by Real-Time Job Data Over WebSocket. Do not put long-lived access tokens into WebSocket URLs to bypass browser restrictions; URLs may enter proxy access logs, browser history, and monitoring systems.

For the difference between job UUID and kernel run ID, see Resource Identifiers.

MCP Current Page Authorization​

MCP page authorization is not a global authorization for platform accounts. When a user turns on AI control on the current Simulation Workbench page, the platform first verifies that the user can access the current workspace and model, and then creates a session bound to the current page context.

Users can choose from the following permissions:

MCP PermissionsMain Operations Allowed
readCheck the current page, component directory, model drafts, loaded jobs and results
EditModify the current draft, action history, locate objects, and adjust the current results view
runValidate the current draft and create a simulation job
controlControl the jobs that the current page has loaded and send instructions to the components in it

These four permissions constitute the upper limit of the session. Client tokens can only use the permissions actually granted by the user in the page, and platform roles do not automatically extend the MCP session scope.

MCP page sessions are also subject to the following limitations:

  • Session binding workspace, model or unsaved draft, page instance and current route, client parameters cannot override these contexts;
  • Job operations are limited to jobs that have been loaded on the current page, and cross-border access is not allowed even if other job IDs are known;
  • Only one active client is allowed on the same page; old client credentials become invalid when re-pairing or disconnecting;
  • The pairing code can only be used once, and the MCP access token and refresh token obtained by redemption only belong to the page session;
  • Authorization needs to be re-established after the page is closed, the model or Workbench is switched, the authorization is actively closed, the heartbeat is interrupted, or the session expires;
  • MCP can modify the current draft, but cannot open or save another model through the server portal; users still need to review and save modifications that need to be retained in the page;
  • Each tool call is checked for required permissions and desensitized operational audit information is logged.

Platform login tokens, MCP pairing information, and MCP client tokens are not interchangeable. External AI clients do not need, and should not, ask for a user's username or password. See Connect an External AI Assistant Through MCP for user operating instructions.

System Operation and Maintenance High-Privilege Interface​

System-level service status, nodes, environment configuration, service actions, platform update packages and global operation and maintenance records belong to the high-privilege control plane, and only super administrators are allowed by default. They are authorized separately from ordinary model and job interfaces, and cannot be enabled by default just because the user is an organization administrator.

The exception is the workspace-specific update package interface: the endpoint can be authorized to the administrator of the organization after explicitly verifying that the space belongs to the organization. This exception only applies to the specified workspace and specified endpoint, and will not be elevated to global system operation and maintenance permissions.

Node agents use separate machine identities and shared trust configurations and can only call interfaces exposed for the agent. Machine credentials cannot be used as user tokens, nor are user tokens a substitute for node identities.

When integrating system operations interfaces, use separate, auditable identities for automated processes and limit permissions to required endpoints. Do not share personal super administrator accounts and do not write administrator access tokens into scripts, images, update packages, or continuous integration logs. See Platform Operations APIs for specific endpoints.

Integration Principle​

The Server Determines​

  • Front-end menus and buttons are only used for interactive prompts and cannot be used as security controls;
  • Each HTTP or WebSocket endpoint is independently authenticated and performs object-level permission verification when needed;
  • Resource IDs are only used to locate objects, not access credentials;
  • Read permissions, write permissions, job control permissions and operation and maintenance permissions should be checked separately.

Always Use Least Privileges​

  • Ordinary automation uses a dedicated ordinary account and does not use the super administrator account;
  • The MCP client only applies for the permissions required to complete the current job;
  • Organization administrator capabilities must be limited to the organization they manage;
  • Workspace authorization only includes users or organizations that actually need it;
  • Node agents and operations automation use their own machine identities and do not reuse user credentials.

Securely Pass and Save Credentials​

  • The access token is placed in the Authorization request header, not in the ordinary URL;
  • Refresh tokens are only submitted to supported token endpoints;
  • Logs, exceptions, telemetry, and audit records should obscure tokens, passwords, keys, pairing information, and sensitive request headers;
  • Do not save real credentials in source code, configuration templates, model files, or screenshots;
  • Out-of-browser integrations use a protected credential store appropriate to the environment in which they are run, and do not read or copy browser local storage;
  • Use placeholders and minimal-privilege test accounts when debugging, and revoke temporary credentials when finished.

Correctly Handle Rejection Responses​

ResponseCommon MeaningsClient Processing
401 UnauthorizedMissing credentials, invalid or expired access tokenTry a refresh; if failed, log in again
403 ForbiddenIdentity is valid but not allowed by role, organization, object, or operation scopeDo not refresh in a loop; check target objects and permission requests
404 Not FoundThe object does not exist, or the endpoint does not expose the object to the current identityCheck the ID and query scope and do not use this to probe other user resources
409 ConflictThe operation is not allowed by the current session, pairing, or resource statusRelease old sessions or wait for status changes based on return prompts

Successful authentication does not necessarily mean that business operations will be successful. The client must retain the specific error information returned by the server and handle identity failures, insufficient permissions and data verification failures separately.