Describe the bug
When an API request is authenticated using a user principal, the internally constructed PolarisPrincipal object contains only internal attributes (such as client_id) and does not include the user-defined attributes that were supplied during principal creation.
To Reproduce
- Create a principal using the API:
POST /api/management/v1/principals
Include user-defined attributes, for example:
region=northamerica
department=finance
-
Use the returned client-id and client-secret to obtain an OAuth token:
POST /api/catalog/v1/oauth/tokens
-
Use the generated OAuth token to invoke an authenticated API (for example):
GET /api/management/v1/catalogs
-
Inspect the server-side PolarisPrincipal object created during request processing.
Actual Behavior
The PolarisPrincipal object contains only internal attributes (for example, client_id) and does not include user-defined attributes that were supplied during principal creation.
Expected Behavior
The PolarisPrincipal object should include both:
- Internal attributes (such as client_id), and
- User-defined attributes supplied during principal creation.
Additional context
Based on initial debugging, it appears that when PolarisPrincipal is created from PrincipalEntity, the implementation uses:
principalEntity.getInternalPropertiesAsMap()
This retains internal attributes but excludes user-defined properties.
Using:
principalEntity.getPropertiesAsMap() along with principalEntity.getInternalPropertiesAsMap() will preserve both internal and user-defined attributes.
System information
No response
Describe the bug
When an API request is authenticated using a user principal, the internally constructed PolarisPrincipal object contains only internal attributes (such as client_id) and does not include the user-defined attributes that were supplied during principal creation.
To Reproduce
POST /api/management/v1/principals
Include user-defined attributes, for example:
region=northamerica
department=finance
Use the returned client-id and client-secret to obtain an OAuth token:
POST /api/catalog/v1/oauth/tokens
Use the generated OAuth token to invoke an authenticated API (for example):
GET /api/management/v1/catalogs
Inspect the server-side PolarisPrincipal object created during request processing.
Actual Behavior
The PolarisPrincipal object contains only internal attributes (for example, client_id) and does not include user-defined attributes that were supplied during principal creation.
Expected Behavior
The PolarisPrincipal object should include both:
Additional context
Based on initial debugging, it appears that when PolarisPrincipal is created from PrincipalEntity, the implementation uses:
principalEntity.getInternalPropertiesAsMap()
This retains internal attributes but excludes user-defined properties.
Using:
principalEntity.getPropertiesAsMap() along with principalEntity.getInternalPropertiesAsMap() will preserve both internal and user-defined attributes.
System information
No response