-
Notifications
You must be signed in to change notification settings - Fork 332
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When trying to rotate a principal's credentials via the root user, an HTTP error with code 403 is returned:
{"error":{"message":"Principal 'root' with activated PrincipalRoles '[]' and activated grants via '[service_admin]' is not authorized for op ROTATE_CREDENTIALS","type":"ForbiddenException","code":403}}
To Reproduce
- Deploy locally via
docker compose up --build - Note down the root principal credentials and store them in a shell variable, e.g.
CLIENT_ID=f69f1990657205d9 CLIENT_SECRET=e89026b4e87d60b7bd6ea75adb16e6f8
- Get an access token for the root principal
TOKEN="$(curl --request POST "http://localhost:8181/api/catalog/v1/oauth/tokens?grant_type=client_credentials&scope=PRINCIPAL_ROLE%3AALL&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}" \ --header 'content-type: application/x-www-form-urlencoded' \ | jq -r .access_token)"
- Create a new principal
curl --request POST http://localhost:8181/api/management/v1/principals \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ -d '{"name": "test"}')"
- Try to rotate the credentials of the new principal using the same token as it was created with
curl --request POST http://localhost:8181/api/management/v1/principals/test/rotate \ --header "Authorization: Bearer $TOKEN"
Actual Behavior
The service returns a 403 response
{"error":{"message":"Principal 'root' with activated PrincipalRoles '[]' and activated grants via '[service_admin]' is not authorized for op ROTATE_CREDENTIALS","type":"ForbiddenException","code":403}}
Expected Behavior
The principal credentials should successfully be rotated
Additional context
No response
System information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working