Trino

Supported trino version 352 and higher

Connection String

The connection string format is as follows:

  1. trino://{username}:{password}@{hostname}:{port}/{catalog}

If you are running Trino with docker on local machine, please use the following connection URL

  1. trino://trino@host.docker.internal:8080

Authentications

1. Basic Authentication

You can provide username/password in the connection string or in the Secure Extra field at Advanced / Security

  • In Connection String

    1. trino://{username}:{password}@{hostname}:{port}/{catalog}
  • In Secure Extra field

    1. {
    2. "auth_method": "basic",
    3. "auth_params": {
    4. "username": "<username>",
    5. "password": "<password>"
    6. }
    7. }

NOTE: if both are provided, Secure Extra always takes higher priority.

2. Kerberos Authentication

In Secure Extra field, config as following example:

  1. {
  2. "auth_method": "kerberos",
  3. "auth_params": {
  4. "service_name": "superset",
  5. "config": "/path/to/krb5.config",
  6. ...
  7. }
  8. }

All fields in auth_params are passed directly to the KerberosAuthentication class.

3. JWT Authentication

Config auth_method and provide token in Secure Extra field

  1. {
  2. "auth_method": "jwt",
  3. "auth_params": {
  4. "token": "<your-jwt-token>"
  5. }
  6. }

4. Custom Authentication

To use custom authentication, first you need to add it into ALLOWED_EXTRA_AUTHENTICATIONS allow list in Superset config file:

  1. from your.module import AuthClass
  2. from another.extra import auth_method
  3. ALLOWED_EXTRA_AUTHENTICATIONS: Dict[str, Dict[str, Callable[..., Any]]] = {
  4. "trino": {
  5. "custom_auth": AuthClass,
  6. "another_auth_method": auth_method,
  7. },
  8. }

Then in Secure Extra field:

  1. {
  2. "auth_method": "custom_auth",
  3. "auth_params": {
  4. ...
  5. }
  6. }

You can also use custom authentication by providing reference to your trino.auth.Authentication class or factory function (which returns an Authentication instance) to auth_method.

All fields in auth_params are passed directly to your class/function.

Reference: