- Decentralization Manager
- Operations and reference
- Authentication and operator roles
Authentication and operator roles
In this guide, a node is one running Decentralization Manager together with its Canton participant. This page lists each credential that a node accepts or presents, and the check that applies to it.
Credentials at a glance
Section titled “Credentials at a glance”| Caller | Path | Credential | Check |
|---|---|---|---|
| Operator, in the browser or with an API client | Operator API | Access token from Keycloak or Auth0 | Signature, issuer, and client ID on every request |
| Operator with the admin role | Admin-gated paths | The same access token, with the admin role | Role check when DECPM_ADMIN_ROLE is set |
| The node, toward the Canton Ledger API | Ledger API calls for one Decentralized Party | Party credentials that the node stores for that party | Canton checks the rights of the Ledger API user |
| The node, toward the Canton Admin API | Topology, package, and key calls | None | Network access, plus optional TLS or mTLS |
| A wallet | Tenant API, /v0/tenant/* | Tenant API key | Match against DECPM_TENANT_API_KEYS |
| Another node | Noise port | Noise keys | See Connect peers |
Sign in to the web interface and the operator API
Section titled “Sign in to the web interface and the operator API”The web interface uses the Authorization Code flow with PKCE. It needs a public client in your identity provider. The operator API uses the same access tokens.
Configure Keycloak or Auth0. Set the variables for one provider only. If you set both providers, the login page uses Auth0.
The login page reads GET /auth-config before the user has a token. An API client sends its access token in an Authorization: Bearer <token> header.
Keycloak
Section titled “Keycloak”In the Keycloak admin console, open Clients → Create client and use these settings:
| Setting | Value |
|---|---|
| Client type | OpenID Connect |
| Client ID | Any value. Set the same value in DECPM_KEYCLOAK_CLIENT_ID |
| Client authentication | Off (public client) |
| Authentication flow | Standard flow on, everything else off |
| Root URL and Home URL | https://<your-ui-host> |
| Valid redirect URIs | https://<your-ui-host>/* |
| Valid post-logout redirect URIs | https://<your-ui-host>/* |
| Web origins | https://<your-ui-host>, or + to copy the redirect URIs |
| Advanced → Proof Key for Code Exchange Code Challenge Method | S256 |
Without Web origins, the browser blocks the token request with a CORS error. Login then fails.
Set DECPM_KEYCLOAK_URL, DECPM_KEYCLOAK_REALM, and DECPM_KEYCLOAK_CLIENT_ID.
Set DECPM_KEYCLOAK_INTERNAL_URL when the node cannot reach DECPM_KEYCLOAK_URL. The node then fetches the OIDC discovery document and the signing keys from the internal URL. The token issuer stays DECPM_KEYCLOAK_URL.
- Open Applications → APIs → Create API. Use the
RS256signing algorithm. The API Identifier is the audience. - Open Applications → Applications → Create Application, and pick Single Page Application.
- Set Allowed Callback URLs, Allowed Logout URLs, and Allowed Web Origins to
https://<your-ui-host>. - Set the token endpoint authentication method to None. Allow the Authorization Code and Refresh Token grant types.
- In the application’s APIs tab, authorize the application for the API from step 1.
- Set
DECPM_AUTH0_DOMAINto the tenant domain, without a scheme. - Set
DECPM_AUTH0_CLIENT_IDto the application’s client ID, andDECPM_AUTH0_AUDIENCEto the API identifier.
Without Allowed Web Origins, the browser blocks the token request with a CORS error.
How the node checks a token
Section titled “How the node checks a token”The node checks every request to the operator API:
- It reads the
issclaim and accepts only a trusted issuer. - It verifies the token signature against the issuer’s published keys. It keeps the keys for one hour.
- It rejects a token whose header names a different algorithm than the issuer’s key.
- It requires the
azpclaim to equal the client ID of the matched configuration. - It does not check the
audclaim.
A missing or invalid token gets HTTP 401.
The trusted issuers are the configured Keycloak or Auth0 provider, plus the provider of every stored party credential. For a party credential’s provider, the azp claim must equal that credential’s client ID.
The node allows same-origin browser requests only. Set DECPM_ALLOWED_ORIGIN when the web interface loads from a different origin than the API.
Paths without sign-in
Section titled “Paths without sign-in”| Path | Purpose |
|---|---|
/, /index.html, /assets/*, /favicon.ico, /favicon.svg | Web interface files |
/auth-config | Provider settings for the login page |
/healthz | Liveness probe |
/.well-known/* | Reserved probe paths |
/swagger-ui/*, /api-docs/* | Swagger UI. The node mounts it only in insecure mode |
/v0/tenant/* | Tenant API. Each handler checks the tenant API key instead |
First PUT /party-config on a new node | See First-run bootstrap |
Every other path on the HTTP port needs a valid token.
The metrics listener on DECPM_METRICS_PORT (default 9464) is a separate listener with no authentication. It binds to the same address as the HTTP port, DECPM_HOST. Keep that port on a private network. See Monitoring and logging.
The admin role
Section titled “The admin role”DECPM_ADMIN_ROLE names the role that admin-gated paths require. When the variable is unset, every signed-in caller passes the admin check. The node then logs a warning at startup.
Set DECPM_ADMIN_ROLE on every node that more than one person can sign in to.
A signed-in caller without the role gets HTTP 403. The role name must match exactly, including case.
Where the node reads roles
Section titled “Where the node reads roles”| Claim | Typical source |
|---|---|
realm_access.roles | Keycloak realm roles |
roles | A flat array of role names |
scope | Space-separated scopes |
The claim that DECPM_JWT_ROLE_CLAIM names | A namespaced custom claim that holds an array of strings |
permissions | Auth0 RBAC. The node reads this claim only from an Auth0 issuer |
For Keycloak, create a realm role with the exact name in DECPM_ADMIN_ROLE. Assign the role to the admin users.
Admin role with Auth0
Section titled “Admin role with Auth0”Auth0 does not put roles in access tokens by default. Create the role under User Management → Roles and assign it to the admin users. Then put the role in the token in one of these three ways.
Option 1: RBAC permissions (recommended). On the API, turn on RBAC and Add Permissions in the Access Token. Add a permission with the role name, and grant the permission to the role. Auth0 then sends a permissions array, and no other setting is necessary.
Option 2: RBAC scope. Use the same API settings, and set DECPM_AUTH0_SCOPE to the role name. The web interface then requests that scope in addition to openid profile email. Auth0 returns a permission in scope only when the client asks for it.
Option 3: namespaced custom claim. Add a Login flow Action under Actions → Library → Build Custom:
exports.onExecutePostLogin = async (event, api) => { const roles = event.authorization?.roles || []; api.accessToken.setCustomClaim("https://example.com/decman/roles", roles);};Then set DECPM_JWT_ROLE_CLAIM=https://example.com/decman/roles. Use a namespace that your organization controls. Auth0 drops a custom claim that is not URI-namespaced.
When an admin-gated call returns 403, decode the access token. Look for the role in permissions, scope, or your DECPM_JWT_ROLE_CLAIM claim. A token with only openid profile email carries no role.
Paths that need the admin role
Section titled “Paths that need the admin role”| Area | Paths |
|---|---|
| Configuration | PUT /party-config after the first party credential exists, POST /party-config/discover-member-party, POST /network-config, POST /auth/grant-rights |
| Packages | POST /dars/upload, which uploads DARs to this participant only |
| Workflow starts | POST /onboarding, POST /add-party, POST /kick, POST /change-threshold, POST /contracts, POST /dars/distribute, POST /dars/distribute-package |
| Workflow control | POST /onboarding/cancel, POST /add-party/cancel, POST /kick/cancel, POST /change-threshold/cancel, POST /contracts/cancel, POST /dars/cancel, POST /workflows/{instance_name}/cancel, POST /workflows/{instance_name}/retry, POST /workflows/{instance_name}/dismiss |
| Invitations | POST /invitations/accept, POST /invitations/decline, GET /invitations/{id}/dars/{index} |
| Governance | POST /governance/propose, POST /governance/confirm, POST /governance/execute, POST /governance/expire, POST /governance/cancel-proposal |
| Token standard | POST /token-standard-contracts |
GET /governance/confirmations answers every signed-in caller. It returns the proposal_payload and proposal_template_id fields only to a caller with the admin role.
Paths that any signed-in caller can use
Section titled “Paths that any signed-in caller can use”Every other operator API path needs a valid token, but not the admin role. These paths include every read path except GET /invitations/{id}/dars/{index}, for every party on the node. They also include three write paths:
| Path | Effect |
|---|---|
POST /auth/test | Gets a fresh Canton token for each stored party credential |
POST /governance/cancel | Revokes this node’s own confirmation of a governance action |
DELETE /acs-import-quarantine | Lifts an ACS-import quarantine. See Add a member to a Decentralized Party |
The web interface build flag VITE_ADMIN_ACCESS hides or disables some admin controls. This flag is not a security control. The node checks the admin role on every request.
Party credentials
Section titled “Party credentials”A node calls the Canton Ledger API for a Decentralized Party with the party credentials that it stores for that party. Each node stores its own credentials for each party that it hosts.
A party credential holds these values:
- The Decentralized Party ID.
- The member party ID. This party is local to the participant, and it acts as this node’s member of the Decentralized Party.
- The Ledger API user ID.
- Client credentials at Keycloak or Auth0.
| Provider | Request fields | Grant |
|---|---|---|
| Keycloak | keycloak_url, keycloak_realm, keycloak_client_id, keycloak_client_secret | Client credentials |
| Keycloak | keycloak_url, keycloak_realm, keycloak_client_id, keycloak_username, keycloak_password | Password grant. Only the API accepts it. The web interface offers client credentials only |
| Auth0 | auth0_domain, auth0_audience, auth0_client_id, auth0_client_secret | Machine-to-machine client credentials |
Use a confidential client for each party. Do not reuse the public sign-in client.
Store credentials in the web interface
Section titled “Store credentials in the web interface”- Open Parties and click the party.
- Under Authentication, click Login.
- Enter the provider fields.
- Click Discover Member Party. The node gets a token and reads the user’s primary party from Canton. To type the values yourself, click Enter manually.
- Check Member Party ID and User ID, then click Save.
- Click Test Auth.
- If rights are missing, click Grant Rights. See Canton rights.
To change the stored values, click Edit Credentials.
Store credentials with the API
Section titled “Store credentials with the API”curl --fail-with-body -X PUT "$DECPM_URL/party-config" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "dec_party_id": "governed-app::1220...", "member_party_id": "member-1::1220...", "user_id": "member-1-ledger-user", "keycloak_url": "https://keycloak.example.com", "keycloak_realm": "my-realm", "keycloak_client_id": "member-1-ledger-client", "keycloak_client_secret": "<client-secret>" }'For Auth0, send auth0_domain, auth0_audience, auth0_client_id, and auth0_client_secret instead of the keycloak_* fields.
The node applies these rules:
- For Keycloak, a secret field that you leave out keeps the stored value. An empty string clears it.
- A changed
keycloak_urlorauth0_domainneeds a fresh secret in the same request. The node never sends a stored secret to a new address. - The node answers HTTP
400to a request with an unknown field. This rule includes the oldpackagesfield. GET /party-config/{dec_party_id}returns the stored values with the secrets masked.
Canton rights
Section titled “Canton rights”The Ledger API user needs four rights:
| Right | Party |
|---|---|
actAs | Member party |
readAs | Member party |
actAs | Decentralized Party |
readAs | Decentralized Party |
Grant Rights grants exactly these four rights, and nothing wider. It asks for client credentials whose identity holds ParticipantAdmin on this participant. The node uses those credentials once and does not store them.
The API call is POST /auth/grant-rights with dec_party_id, admin_client_id, and admin_client_secret.
The node checks and grants the rights for the user in the token’s sub claim. It uses the stored user ID only when the token has no sub claim. GET /auth/status reports the token state and the rights for each party.
Encrypt stored secrets
Section titled “Encrypt stored secrets”The node stores party credentials in its SQLite database, decpm.db. Set DECPM_DB_ENCRYPTION_KEY to a random passphrase. The node then encrypts the client IDs, secrets, user names, and passwords with AES-256-GCM. The key is the SHA-256 hash of the passphrase.
Without DECPM_DB_ENCRYPTION_KEY, the database holds these secrets in plaintext. Keep the passphrase stable. A node with a different passphrase cannot read the stored secrets.
First-run bootstrap
Section titled “First-run bootstrap”A node with no stored party credential accepts the first PUT /party-config without a token. The node runs one such request at a time. It rejects a concurrent bootstrap request with HTTP 409.
After the first party credential exists, PUT /party-config needs a valid token. It also needs the admin role when the node sets DECPM_ADMIN_ROLE.
The first party credential also adds its identity provider to the trusted issuers. So the first caller chooses an identity provider that the node then trusts for sign-in.
A node with no top-level provider and no party credential rejects every token. On such a node, only the paths without sign-in and this bootstrap call work.
Tenant API keys
Section titled “Tenant API keys”The tenant API, /v0/tenant/*, creates external parties and adds hosts to external and local parties. Wallets and operator scripts call it. It does not use the sign-in token or the admin role. Each call sends a tenant API key in an Authorization: Bearer <key> header.
- Set
DECPM_TENANT_API_KEYSto one or more random keys, separated by commas. The node reads the keys at startup. - With no keys, the node answers every tenant call with HTTP
401. - The node compares keys in constant time.
- A key is not bound to a party. Any valid key can call every tenant path for every party on the node.
- Each node accepts only its own keys. A wallet keeps one key for each host.
Set keys only on a node that hosts external parties, or that adds hosts to a local party. Keep the keys in a secret store. Route the tenant API to the wallet over TLS.
To test a key, ask for a party that does not exist. The right key gets 404, and a wrong key gets 401:
curl -sS -o /dev/null -w '%{http_code}\n' \ -H "Authorization: Bearer $TENANT_KEY" \ "$DECPM_URL/v0/tenant/test::1220$(printf '0%.0s' {1..64})/state"To rotate a key, add the new key and restart the node. Move the wallet to the new key. Then remove the old key and restart the node again.
The procedures are in Decentralize an external party and Decentralize an existing party.
Insecure mode
Section titled “Insecure mode”--insecure, or DECPM_INSECURE=true, runs a node without an identity provider. Use it only for local development against a Canton participant with unsafe shared-secret authentication.
In insecure mode, the node does these things:
- It accepts any inbound token, or no token, and gives every caller the admin role.
- It answers
/auth-configwithauth_required: false, so the web interface shows no login. - It presents an HS256 token to Canton.
DECPM_CANTON_HMAC_SECRETsigns it (defaultunsafe). - It sets the token’s
audfromDECPM_CANTON_HMAC_AUDIENCE(defaulthttps://canton.network.global). It setssubfromDECPM_CANTON_HMAC_SUBJECT(defaultledger-api-user). - It accepts tenant API calls without a key.
- It serves the Swagger UI at
/swagger-ui/.
The node refuses to start in insecure mode unless the Canton network is devnet. DECPM_CANTON_NETWORK sets the network, and its default is devnet. The node logs a warning at startup whenever insecure mode is on.
dec-party-manager -d ./development/participant-1 serve --insecureHardening checklist
Section titled “Hardening checklist”- Leave insecure mode off on every shared node.
- Set
DECPM_ADMIN_ROLE, and assign the role only to operators. - Set
DECPM_DB_ENCRYPTION_KEY, and keep the passphrase in a secret store. - Store the first party credential before the HTTP port is reachable from untrusted networks.
- Keep the metrics port on a private network.
- Keep the Canton Admin API on a private network, with TLS or mTLS where it crosses hosts. The node calls the Admin API without a token.
- Set tenant API keys only where a wallet needs them.
- Protect each party client secret like an operator credential.
The Configuration reference lists every variable on this page.
Technical sources
Section titled “Technical sources”- Inbound auth middleware
- JWT validator
- Role and issuer helpers
- Party credential handlers
- Auth status and grant-rights handlers
- Server setup and insecure-mode guard
- CLI flags and environment variables
- Secret encryption
- Deployment guide
- README
Related pages
Section titled “Related pages”Next step
Section titled “Next step”Distribute the packages that your parties use: Package and contract operations.
Ask the docs
Answers come only from this documentation and can be wrong. Check the linked pages.
Ask a question about BitSafe, CBTC or the developer guides. For example: