Skip to content

PolarisPrincipal missing user-defined attributes supplied during principal creation #4291

@sneethiraj

Description

@sneethiraj

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

  1. Create a principal using the API:
    POST /api/management/v1/principals

Include user-defined attributes, for example:
region=northamerica
department=finance

  1. Use the returned client-id and client-secret to obtain an OAuth token:
    POST /api/catalog/v1/oauth/tokens

  2. Use the generated OAuth token to invoke an authenticated API (for example):
    GET /api/management/v1/catalogs

  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions