Map user names#

Use user mapping to transform usernames from your authentication provider into Starburst control plane usernames. Choose one of the following methods:

  • Pattern mapping: A single regular expression.

  • File mapping: A JSON file containing multiple rules.

User mapping applies to authentication only. LDAP synchronization has its own identifier mapping for the users and groups that it synchronizes. See Synchronize users and groups with LDAP.

Pattern mapping#

Use pattern mapping to transform all usernames with a single regular expression.

For example, if your authentication provider uses usernames in the form alice@example.com, use a regex that captures the name before the @ sign:

http-server.authentication.oauth2.user-mapping.pattern=(.*)(@.*)

Control plane uses the first capture group as the mapped username. If the regex does not match the username, control plane denies authentication.

Pattern mapping properties#

Authentication type

Property

Password

http-server.authentication.password.user-mapping.pattern

OAuth2

http-server.authentication.oauth2.user-mapping.pattern

Insecure

http-server.authentication.insecure.user-mapping.pattern

File mapping#

Use file mapping to define multiple transformation rules or to exclude specific users.

Create a JSON file with your mapping rules:

{
  "rules": [
    {
      "pattern": "test@example\\.com",
      "allow": false
    },
    {
      "pattern": "(.+)@example\\.com"
    },
    {
      "pattern": "(?<user>.+)@(?<region>.+)\\.example\\.com",
      "user": "${user}_${region}"
    }
  ]
}

Control plane processes rules from top to bottom and uses the first matching rule. If no rules match, control plane denies authentication.

Each rule supports the following fields:

  • pattern (required): Regex to match against the username

  • user (optional): Replacement string. Default: $1

  • allow (optional): Whether to allow authentication for this match

  • case (optional): keep (default), lower, or upper

Add the mapping file path to your config.properties file:

http-server.authentication.oauth2.user-mapping.file=etc/user-mapping.json

File mapping properties#

Authentication type

Property

Password

http-server.authentication.password.user-mapping.file

OAuth2

http-server.authentication.oauth2.user-mapping.file

Insecure

http-server.authentication.insecure.user-mapping.file