Skip to content
Discussion options

You must be logged in to vote

You can have a look at the default impl:

https://github.com/apache/polaris/blob/main/runtime/service/src/main/java/org/apache/polaris/service/auth/external/mapping/DefaultPrincipalRolesMapper.java

Given your use case, I think something like below could be a starting point for your impl:

@ApplicationScoped
@Identifier("custom")
class CustomPrincipalRolesMapper implements PrincipalRolesMapper {

  @Override
  public Set<String> mapPrincipalRoles(SecurityIdentity identity) {
    var jwt = (JsonWebToken) identity.getPrincipal();
    String subject = jwt.getSubject();
    Set<String> roles = callRemoteRolesEndpoint(subject);
    return roles.stream()
        .map(r -> "POLARIS_ROLE:" + r)
    …

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
2 replies
@jonsnowseven
Comment options

@dimas-b
Comment options

dimas-b Jan 14, 2026
Collaborator

Comment options

You must be logged in to vote
7 replies
@jonsnowseven
Comment options

@adutra
Comment options

adutra Jan 13, 2026
Collaborator

Answer selected by jonsnowseven
@adutra
Comment options

adutra Jan 13, 2026
Collaborator

@jonsnowseven
Comment options

@adutra
Comment options

adutra Jan 13, 2026
Collaborator

@jonsnowseven
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants