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
| Credentials | Purpose | Scope | Is It Interchangeable |
|---|---|---|---|
| Platform access tokens and refresh tokens | Call the REST API to establish the current user identity | Platform resources that the current account is allowed to access | Non-fungible job connection ticket or MCP client token |
| Job WebSocket one-time ticket | The browser connects to a real-time messaging channel for a specified job | Specified user, specified job, one connection within a short period of time | Not available for REST API or reused to another job |
| MCP page session and client token | Let external AI clients operate the current page within the scope of user authorization | Specified page, specified model or draft, selected permissions, and page loaded jobs | Not 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:
- Whether the username or email and password match;
- Whether the account has been deactivated;
- Whether the account has expired;
- 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:
- Use the access token to call the business interface.
- After receiving
401 Unauthorized, only one refresh request is initiated, and other failed requests at the same time are temporarily stored. - 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.
- Replay the original request using the new access token.
- 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 Hierarchy | Available Roles | Scope |
|---|---|---|
| platform role | Ordinary user, super administrator | The entire platform; super administrators can enter platform-level management and operation and maintenance scope |
| organizational role | Ordinary members, organization administrators | Only 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:
- Whether the Endpoint Allows Anonymous Access: Business resources usually require login; exceptions include authentication endpoints such as login and token refresh.
- Does the Credential Type Match?: REST API, job WebSocket, MCP page session and node agent use their own authentication methods.
- Are the Credentials Valid?: Check the signature, validity period, revocation status, and binding relationship with the target session or resource.
- Does the Platform Role Have Global Permissions?: Super administrators can skip normal resource scopes only if the endpoint explicitly allows it.
- Does the Resource Scope Match?: Check the organization, workspace, model ownership or public scope, job creator and other conditions in turn.
- 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.
- Whether the Request Context Matches: Real-time tickets need to match jobs, and MCP requests need to match pages, permission items, and loaded jobs.
- 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 Operation | Ordinary User | Organization Administrators | Super Administrator | Need Attention |
|---|---|---|---|---|
| View and edit profile | only myself | yourself; some user management interfaces can cover members of the managed organization | all users | Modifiable fields are still subject to endpoint restrictions |
| Use workspace | Directly authorized, the organization to which they belong is authorized, or the space is open to all logged in users | Same as ordinary users; they may also have management capabilities when the space belongs to the organization they manage. | all spaces | Use permissions are not equal to write permissions for all subresources |
| View your own model | OK | OK | OK | The model still needs to exist and not be deleted |
| See full disclosure model | OK | OK | OK | The list of standard models is also filtered by accessible workspace |
| View public models within your organization | Available when sharing at least one organization with the model creator | Yes; and you can query all models of the members of the managed organization | OK | Organization sharing does not propagate across organizations |
| View private models | Creator only | Creator, or model creator in the organization you manage | OK | Public scope only affects read scope |
| Modify or delete a model | Creator only | Creator, or model creator in the organization you manage | OK | Even if ordinary members of the same organization can view it, they cannot modify it. |
| View or control jobs | Only jobs you create | Your own jobs, as well as jobs created by members of the organization you manage | All jobs | Being able to view a shared model does not mean that you can view the jobs of the model owner. |
| Create MCP page session | You can only bind workspaces and models that you have access to | Same as left, page permissions are still subject to the selected MCP permissions | Same as left, page permissions are still subject to the selected MCP permissions | Platform role does not bypass page session scope |
| System-level service, node and update package operations | not allowed | Usually not allowed | allow | Individual 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:
- Super administrators can access all spaces;
- When the space is configured to be accessible to all users, any logged-in user can use it;
- The user ID can be used when it is in the direct authorization list of the space;
- It can be used when the organization to which the user belongs has an intersection with the organization that the space allows;
- 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 Scope | Normal Reading Range | Administrator Additional Scope |
|---|---|---|
| private | model creator | Organization administrators can access the models of members of the organizations they manage; super administrators can access all models |
| Disclosure within the organization | The creator, and users who share at least one organization with the creator | Same as above |
| full disclosure | Logged in user | Same 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:
- Requests a WebSocket ticket for a specified job using a platform access token;
- The server first confirms that the job exists, that the current user can access it, and checks whether the result channel is still available;
- The server issues short-term one-time tickets bound to the current user and job;
- The browser establishes the WebSocket with the job UUID and ticket;
- 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 Permissions | Main Operations Allowed |
|---|---|
| read | Check the current page, component directory, model drafts, loaded jobs and results |
| Edit | Modify the current draft, action history, locate objects, and adjust the current results view |
| run | Validate the current draft and create a simulation job |
| control | Control 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
Authorizationrequest 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
| Response | Common Meanings | Client Processing |
|---|---|---|
401 Unauthorized | Missing credentials, invalid or expired access token | Try a refresh; if failed, log in again |
403 Forbidden | Identity is valid but not allowed by role, organization, object, or operation scope | Do not refresh in a loop; check target objects and permission requests |
404 Not Found | The object does not exist, or the endpoint does not expose the object to the current identity | Check the ID and query scope and do not use this to probe other user resources |
409 Conflict | The operation is not allowed by the current session, pairing, or resource status | Release 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.