Interface PrincipalMapper
public interface PrincipalMapper
Maps the
SecurityIdentity, as provided by the OIDC authentication mechanism, to a Polaris
principal.
There are two ways to map the principal: by ID and by name. The ID is a long value that uniquely identifies the principal in Polaris, while the name is a string that represents the principal's unique name in Polaris.
At least one of these mappings must be provided, otherwise the authentication will fail. If both mappings are available, the ID mapping takes precedence.
-
Method Summary
Modifier and TypeMethodDescriptionmapPrincipalId(io.quarkus.security.identity.SecurityIdentity identity) Maps theSecurityIdentityto a Polaris principal.mapPrincipalName(io.quarkus.security.identity.SecurityIdentity identity) Maps theSecurityIdentityto a Polaris principal name.
-
Method Details
-
mapPrincipalId
Maps theSecurityIdentityto a Polaris principal.- Parameters:
identity- theSecurityIdentityof the user- Returns:
- the Polaris principal, or an empty optional if no mapping is available
-
mapPrincipalName
Maps theSecurityIdentityto a Polaris principal name.- Parameters:
identity- theSecurityIdentityof the user- Returns:
- the Polaris principal name, or an empty optional if no mapping is available
-