Service account multi-token management
- Last Updated: February 11, 2026
- 3 minute read
- OpenEdge
- Version 13.0
- Documentation
Profiles support multiple named service account tokens tracked in
profile.json.sa_tokens. This enables distinct
client_id and scope sets, for example CI automation versus
read-only dashboards while sharing a single signing keypair.
Command reference
Use the following commands to manage service account tokens:
| Command | Purpose |
|---|---|
sa-token <profile_name> |
Creates or replaces a named token entry. |
sa-tokens <profile_name> |
Lists all tokens including names, client IDs, scopes, and
primary marker. Add --json for machine
output. |
remint-all <profile_name> |
Rotates the key pair and remint every token. |
Flags for the sa-token command
The following table lists the most commonly used flags, along with their purpose and
detailed usage notes. For the full list of flags, run this help command:
|
| Flag | Purpose | Notes |
|---|---|---|
--name NAME |
Unique logical token name | The default string is reserved for primary
generated at profile creation. |
--scopes scope1 scope2 ... |
Space-separated scopes | Replaces existing scopes for that token |
--client-id ID |
Custom client identifier | Defaults to derived profile-based ID if omitted |
--days N |
Validity period in days | Default is 365 |
--issuer ISS |
Override issuer | Defaults to profile issuer if set |
--primary |
Mark token as primary | Only one primary allowed; updates client header |
List tokens
The following example command lists all tokens:
|
The command produces the following output:
The following example outputs the JSON representation of the
|
sa_tokens array from the profile. The jq
filter then extracts the first token object.
|
Here is an example of the
sa_tokens section inside the
profile.json file:
|
Primary token semantics
Only the primary token is embedded into client/mcp.json as the service
account header. The --sa-token <name> flag lets you override the
default primary token and select any named token configured in
profile.json.sa_tokens. This behavior supports least privilege
access and role-based workflows.
The following examples show how to override the default token and specify a named token:
- This example runs the MCP client for the profile named
myprofand uses the service account token namedci-botfor authentication. This approach is useful when you want to switch from the default token to a token with different scopes or permissions../mcpgen client myprof --sa-token ci-bot -
This example runs the MCP client for the profile named
myprof, uses the service account token namedci-botfor authentication, and also invokes a specific tool calledgetOrderswith empty arguments ({}). This approach allows you to run a targeted API operation under the authorization of theci-bottoken, ensuring the correct access level for that tool../mcpgen client myprof --sa-token ci-bot --tool getOrders --args '{}'
Note: To mark a different token as primary, re-issue it with
--primary. The previous primary flag is cleared
automatically.Example procedure to rotate service account tokens
Follow these steps to perform token rotation:
- To add a new limited-scope token, run the following command to create a
token named
dashboardwith theproducts.readscope, a custom client ID, and a validity of 90 days:./mcpgen sa-token myprof --name dashboard --scopes products.read --client-id dashboard --days 90 - To promote the new token to primary, make the
dashboardtoken the primary token for the profile:./mcpgen sa-token myprof --name dashboard --primary - To rotate all keys and tokens after quarterly review, use the
remint-allcommand to generate a new key pair and re-mint all tokens:./mcpgen remint-all myprof - To verify the updated tokens, list all tokens in JSON format to confirm the
changes:
./mcpgen sa-tokens myprof --json
Revoke or delete a token
Currently, there is no direct command for token removal. To remove a token:
- Delete its JWT file.
- From the generated/<profile_name>/profile.json
file, remove the
sa_tokensobject. - Optionally, run
remint-allif you also want a key rotation.
Security considerations
Ensure these recommendations to maintain token integrity and prevent compromise:
- All tokens share the same signing key. A compromise of the private key
invalidates security for every token. Use
remint-allpromptly. - Distinct scopes per token support least privilege and simplified audit trails in external systems.