hi folks! I'm trying to create an api only user by...
# fleet
s
hi folks! I'm trying to create an api only user by running this command
fleetctl user create --name "API User" --email <mailto:api@example.com|api@example.com> --password temp!pass --api-only
. all seems well except when I list users by calling
api/v1/fleet/users
the api user is coming up as api_only: false. I tried using the patch endpoint to modify the user but no luck there either. concerned my api token is going to expire for the api user otherwise I'd just use my own token. any ideas what the problem could be?
r
Hi Sasha! Let me try to reproduce this, one sec.
I just ran:
rachelperkins@RachelFleet fleet % fleetctl user create --name "API User" --email <mailto:api@example.com|api@example.com> --password temp@pass123 --api-only
and my GET response from
/api/latest/fleet/users
includes:
Copy code
{
  "created_at": "2023-09-27T16:14:04Z",
  "updated_at": "2023-09-27T16:14:04Z",
  "id": 11,
  "name": "API User",
  "email": "<mailto:api@example.com|api@example.com>",
  "force_password_reset": false,
  "gravatar_url": "",
  "sso_enabled": false,
  "global_role": "observer",
  "api_only": true,
  "teams": []
}
Are you using the latest fleetctl? I'm going to update the docs to include a new password that meets the password requirements and aren't a special character in the the command.
s
I am using an outdated version of fleet. Could that be the issue? I'll try again with a temp pass of only numbers/characters instead and see if that works!
updating global role or force password reset flags IS working though
okay I was able to generate an api only user by posting to the
/api/v1/fleet/users/admin
endpoint! not sure why that worked by happy it did 😄