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
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/mcpand/.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>/mcpfor the hosted MCP endpoint, orhttps://<your Crossblade address>/v1for REST and the SDKs. A token for one does not work on the other. - The scope must include
ledger:read. It may also includeopenidandoffline_access, each once, and nothing else. - Request
offline_accesstogether withledger:readto 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
- Send the person to the authorization endpoint from the metadata with your registered redirect URI, a PKCE
S256code challenge, the resource and the scope. - Crossblade shows its review page. The person signs in, chooses the companies and permissions, and approves. Nothing is selected for them.
- 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
- Post
client_id,scopeandresource, form encoded and nothing else, to the device authorization endpoint in the metadata. - Show the person the
user_codeand theverification_uri. Never build a link that contains the code: Crossblade does not return one, and its page never reads a code from a link. - Poll the token endpoint with the device code grant type,
device_code,client_idandresource, no faster thaninterval(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: Beareron/v1or/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
401with aWWW-Authenticatechallenge, or a403. Do not retry with the same token. - Where agent access is turned on, an invalid or expired token gets a
401whose challenge includeserror="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-Idresponse header, or therequestIdin the error. - The route or tool you called, and roughly when.
- The error
codeand message.
Never send an access token, personal token, API key or setup link. Nobody needs them to help you.