Skip to content

Authentication

Edge Connector Security

The Edge Connector must authenticate with the nara platform before it can receive and execute tool calls. Authentication establishes the connector’s identity, links it to your organization, and authorizes it to access the platform server. This page covers the available authentication modes, token lifecycle, and security best practices.

The Edge Connector supports three authentication methods, each suited to different deployment scenarios.

Browser OAuth is the interactive authentication method designed for desktop mode. It opens your default browser, redirects you to the nara login page, and returns a JWT token after successful authorization.

Terminal window
edge-connector auth --browser

How it works:

  1. The CLI contacts the platform and receives an authorization code and a browser URL.

  2. The CLI opens the browser URL. You log in with your account and approve the Edge Connector’s access to your organization.

  3. After approval, the CLI automatically retrieves the session token.

  4. The token is validated (expiry, organization membership) and saved to the configured token path.

  5. The default bundle for your organization is synced automatically.

This mode is the default when you run the Edge Connector runtime on a desktop machine. If no token is found at startup, the runtime automatically initiates the browser OAuth flow.

Every token is validated before it is saved or used. The validation checks:

CheckDescription
FormatThe token must be a valid access token
ExpiryThe token must still be valid and not expired
OrganizationThe token must belong to an organization your account can use with this connector

If any check fails, the CLI reports a specific error message and exits without saving.

Tokens are stored as JSON files on the local file system. The storage location is determined by the following precedence:

  1. The AUTH_TOKEN_PATH environment variable, if set.

  2. The authTokenPath field in config.json.

  3. The default path: ./auth-token.json (relative to the installation directory).

The token file is created with restrictive permissions (0600 — owner read/write only) and the containing directory is set to 0700 (owner only). This ensures the token is not readable by other users on the system.

JWT tokens have an expiration time set by the nara platform. When a token expires:

  • Desktop mode: The runtime detects the expired token during validation and automatically initiates a new browser OAuth flow. If the system tray is active, it shows a “pending” status while re-authentication is in progress.
  • Server mode with deployment credentials: Not applicable — deployment credentials do not expire in the same way as JWT tokens. The credentials remain valid as long as the deployment exists.
  • Token file mode: You must manually replace the token file with a fresh token. The runtime will fail to connect if the token has expired.

The runtime validates the token at startup and logs a warning if the token is near expiry.

The desktop authentication flow is a two-step process that allows a headless CLI to authenticate via a browser on the same machine.

CLI Platform Browser
| | |
|-- POST /start -------->| |
|<-- code + url ---------| |
| | |
|-- open browser --------|------------------------->|
| |<-- user logs in ---------|
| |<-- user approves --------|
| | |
|-- GET /session/token ->| |
|<-- JWT token ----------| |
| | |
|-- save token | |

Authentication-related environment variables override config file values:

VariableDescription
AUTH_TOKEN_PATHOverride the path where the token file is stored
DEPLOYMENT_IDDeployment identifier for cloud/server mode
DEPLOYMENT_SECRETDeployment secret for cloud/server mode
DEPLOYMENT_CREDENTIALS_PATHPath to a file containing deployment credentials