Agent sign-in and tokens for developers

Browser sign-in, sign-in with a code and personal tokens, from the agent developer's side. Agent access is off by default.

This guide is for developers whose agent, app or script acts for a Crossblade workspace member. Agent access is off by default and has not been turned on for hosted Crossblade workspaces.

Status

Off by default

Agent access is off by default. It has not been turned on for hosted Crossblade workspaces, no named agent or app is supported yet, and it has only been tried on local test setups. Crossblade has no web address of its own yet, so this guide writes https://<your Crossblade address>. The SDKs and the local MCP server are shared as source packages; they are not on npm or PyPI yet.

Discovery

Crossblade publishes standard OAuth metadata, so an agent can find every endpoint from it:

  • /.well-known/oauth-authorization-server/api/auth: the authorization server.
  • /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-protected-resource/v1: the two resources an agent can ask for.

Each metadata document says in crossblade_delegated_access whether agent access is turned on.

Resources and scopes

  • Ask for exactly one resource: https://<your Crossblade address>/mcp for the hosted MCP endpoint, or https://<your Crossblade address>/v1 for REST and the SDKs. A token for one does not work on the other.
  • The scope must include ledger:read. It may also include openid and offline_access, each once, and nothing else.
  • Request offline_access together with ledger:read to receive a refresh token. Without it no refresh token is issued, so the agent must authorize again when its access token expires.
  • Crossblade registers clients in advance. There is no dynamic client registration. Every client is a public PKCE client: it has no client secret, and its token endpoint authentication method is none.

Browser sign-in

  1. Send the person to the authorization endpoint from the metadata with your registered redirect URI, a PKCE S256 code challenge, the resource and the scope.
  2. Crossblade shows its review page. The person signs in, chooses the companies and permissions, and approves. Nothing is selected for them.
  3. Exchange the returned code at the token endpoint with the code verifier and the same resource.

The person has 5 minutes to finish the review. If they deny the request or it expires, start a new one.

Sign-in with a code

  1. Post client_id, scope and resource, form encoded and nothing else, to the device authorization endpoint in the metadata.
  2. Show the person the user_code and the verification_uri. Never build a link that contains the code: Crossblade does not return one, and its page never reads a code from a link.
  3. Poll the token endpoint with the device code grant type, device_code, client_id and resource, no faster than interval (5 seconds). The code expires after 10 minutes.

The person's side of this flow is in Agent sign-in with a code.

Personal tokens

  • The person creates a personal token on the Connected agents page and copies it once. It lasts from 1 hour to 90 days, or at most 30 days if the person does not choose, and it can never do more than their own accounting access.
  • Send it as Authorization: Bearer on /v1 or /mcp. It is never refreshed: when it expires or is revoked, ask the person for a new one.

When access ends

  • Revocation, expiry, a change to the person's accounting access or leaving the workspace ends access on the next call. The answer is a 401 with a WWW-Authenticate challenge, or a 403. Do not retry with the same token.
  • Where agent access is turned on, an invalid or expired token gets a 401 whose challenge includes error="invalid_token". Refresh the token, or authorize again.
  • Keep tokens in a secret store. Never put them in a URL, a log, a chat or shared configuration.

Still stuck?

Contact [email protected]. Send:

  • The X-Request-Id response header, or the requestId in the error.
  • The route or tool you called, and roughly when.
  • The error code and message.

Never send an access token, personal token, API key or setup link. Nobody needs them to help you.