Passing ClientId as parameter while creating principal doesn't work
- Dominant language
- Java
- Stars
- 2.1k
- Forks
- 522
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 137
Description
### Describe the bug
Hey Team,
I was trying to verify some of Polaris management API's. I found out that even though the documentation says we can pass clientId as param while creating the principal, it doesn't seems to be working fine
### To Reproduce
1. Start the server and bootstrap with root credentials
2. create the token
3. Hit the http://localhost:8181/api/management/v1/principals API for generating the principal with body as below
{
"name": "principal-1",
"clientId": "arman"
}
### Actual Behavior
**It generates the principal as**
{
"principal": {
"name": "principal-3",
"clientId": "9cc-blah-blah",
"properties": {},
"createTimestamp": 1750756252079,
"lastUpdateTimestamp": 1750756252079,
"entityVersion": 1
},
"credentials": {
"clientId": "9cc-bla-bha",
"clientSecret": "blah-blah"
}
}
### Expected Behavior
It should ideally preserve the clientId we are passing from the body and only generate the clientSecret
### Additional context
Also, Why are we not allowing users to set their own clientId and clientSecret while creating the principal?
I am looking for a solution like register principal with older credentials preserved? Can we do that like we do for the root credentials?
### System information
_No response_
Contributor guide
Research direction
Start by reproducing the POST request to the management API's /api/management/v1/principals endpoint with the supplied clientId and compare it with the documented behavior. Trace the principal and credentials returned by that request; done should mean the supplied clientId is preserved and only the clientSecret is generated, or the supported credential behavior is clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100