Bootstrap FreeKB - Kong Community Edition (KongCE) - update Consumer with an ACL group using REST API
Kong Community Edition (KongCE) - update Consumer with an ACL group using REST API


The curl POST command can be used to configure a consumer with an ACL whitelist group. If you have not yet created the ACL whitelist group, refer to Kong - create acl plugin using curl.


On the Kong server

If Kong is running on docker, refer to Kong - Docker container command line for the steps on how to issue commands in the Kong Docker container. Assuming you are using the default kong.conf file, the Kong Admin API will listen on port 8001.

If issuing this command on the Kong server, this command will configure a consumer with an acl group.

curl -X POST "http://localhost:8001/consumers/consumer_name_or_id/acls" --data "group=group_name"

 


From a remote server

If issuing this command from a remote server, this command will configure a consumer with an acl group.

curl -X POST "http://hostname:8000/admin-api/consumers/consumer_name_or_id/acls" --data "group=group_name"

 


Validation

If the consumer was successfully updated, something like this should be displayed.

{
 "created_at":1585020896,
 "consumer":{"id":"6b3f8801-a8a2-4e48-ab54-53bdb285c334"},
 "id":"583138ff-17b7-4c28-93b6-7f6407dcc10a",
 "group":"example-group",
 "tags":null
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter eb7d32 in the box below so that we can be sure you are a human.