@ -188,6 +188,9 @@ The corresponding CLI command is [`consul acl token read`](/commands/acl/token/r
the namespace will be inherited from the request's ACL token or will default
to the `default` namespace. Added in Consul 1.7.0.
- `expanded` `(bool: false)` - If this field is set, the contents of all policies and
roles affecting the token will also be returned.
### Sample Request
```shell-session
@ -225,6 +228,92 @@ for reading other secrets which given even more permissions.
}
```
Sample response when setting the `expanded` parameter:
```json
{
"AccessorID": "fbd2447f-7479-4329-ad13-b021d74f86ba",
"SecretID": "869c6e91-4de9-4dab-b56e-87548435f9c6",
"Description": "test token",
"Policies": [
{
"ID": "beb04680-815b-4d7c-9e33-3d707c24672c",
"Name": "foo"
},
{
"ID": "18788457-584c-4812-80d3-23d403148a90",
"Name": "bar"
}
],
"Local": false,
"CreateTime": "2020-05-22T18:52:31Z",
"Hash": "YWJjZGVmZ2g=",
"ExpandedPolicies": [
{
"ID": "beb04680-815b-4d7c-9e33-3d707c24672c",
"Name": "foo",
"Description": "user policy on token",
"Rules": "service_prefix \"\" {\n policy = \"read\"\n}",
"Datacenters": null,
"Hash": null,
"CreateIndex": 0,
"ModifyIndex": 0
},
{
"ID": "18788457-584c-4812-80d3-23d403148a90",
"Name": "bar",
"Description": "other user policy on token",
"Rules": "operator = \"read\"",
"Datacenters": null,
"Hash": null,
"CreateIndex": 0,
"ModifyIndex": 0
},
{
"ID": "6204f4cd-4709-441c-ac1b-cb029e940263",
"Name": "admin policy",
"Description": "policy for admin role",
"Rules": "operator = \"write\"",
"Datacenters": null,
"Hash": null,
"CreateIndex": 0,
"ModifyIndex": 0
}
],
"ExpandedRoles": [
{
"ID": "3b0a78fe-b9c3-40de-b8ea-7d4d6674b366",
"Name": "admin",
"Description": "admin role",
"Policies": [
{
"ID": "6204f4cd-4709-441c-ac1b-cb029e940263",
"Name": "admin policy"
}
],
"ServiceIdentities": [
{
"ServiceName": "web",
"Datacenters": [
"southwest"
]
}
],
"Hash": null,
"CreateIndex": 0,
"ModifyIndex": 0
}
],
"NamespaceDefaultPolicies": null,
"NamespaceDefaultRoles": null,
"AgentACLDefaultPolicy": "allow",
"AgentACLDownPolicy": "deny",
"ResolvedByAgent": "server-1",
"CreateIndex": 42,
"ModifyIndex": 100
}
```
## Read Self Token
This endpoint returns the ACL token details that matches the secret ID