Spotrix
GitHubBlogs
  • Welcome to Spotrix!
  • Installing
    • Installing
    • Upgrading
  • Configuration
    • Basic configuration
    • Custom configuration
    • Caching
    • Connection to databases
      • Guinsoo 💎
      • Apache Pinot
      • Apache Presto
      • Trino
      • Apache Druid
      • ClickHouse
      • MindsDB
      • DuckDB
  • Creating Charts
    • Creating your charts
    • Creating your dashboard
    • Explore your data
  • Ecosystem
    • Data Ecosystem
    • Semantic Layer
  • Solutions
    • Financial Services
    • Next-Gen BI
  • Appendix
    • Contribute
    • Security
    • FAQs
Powered by GitBook
On this page
  • Connection URL
  • Authentications
  • Basic Authentication
  • Kerberos Authentication
  • Certificate Authentication
  • JWT Authentication
  • Custom Authentication

Was this helpful?

  1. Configuration
  2. Connection to databases

Trino

Supported Trino version 352 and higher.

Connection URL

The Connection URL format is as follows:

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

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

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

Authentications

Basic Authentication

You can provide username/password in the connection URL or in the Secure Extra filed at Advanced Securith:

  • In Connection URL

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

{
    "auth_method": "basic",
    "auth_params": {
        "username": "<username>",
        "password": "<password>"
    }
}

Kerberos Authentication

In Secure Extra field, config as following example:

{
    "auth_method": "kerberos",
    "auth_params": {
        "service_name": "superset",
        "config": "/path/to/krb5.config",
        ...
    }
}

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

Certificate Authentication

In Secure Extra field, config as following example:

{
    "auth_method": "certificate",
    "auth_params": {
        "cert": "/path/to/cert.pem",
        "key": "/path/to/key.pem"
    }
}

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

JWT Authentication

Config auth_method and provide a token in Secure Extra field:

{
    "auth_method": "jwt",
    "auth_params": {
        "token": "<your-jwt-token>"
    }
}

Custom Authentication

To use custom authentication, firstly you need to add it into ALLOW_EXTRA_AUTHENTICATONS allow list in Spotrix config file:

from {your_module} import AuthClass
from another.extra import auth_method

ALLOWED_EXTRA_AUTHENTICATIONS: Dict[str, Dict[str, Callable[..., Any]]] = {
    "trino": {
        "custom_auth": AuthClass,
        "another_auth_method": auth_method,
    },
}

Then in Secure Extra filed:

{
    "auth_method": "custom_auth",
    "auth_params": {
        ...
    }
}

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

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

PreviousApache PrestoNextApache Druid

Last updated 2 years ago

Was this helpful?