Skip to main content

Trino Stream Authentication

Trino Stream supports multiple authentication methods to securely execute queries against Trino. All query endpoints require authentication.


Authentication Methods

MethodHeaderUse Case
HTTP BasicAuthorization: Basic <base64>Interactive users, scripts
JWT Tokenidtoken: <jwt>Promethium UI, SSO users
Client CredentialsAuthorization: Bearer <token>Service-to-service, automation

HTTP Basic Authentication

Standard HTTP Basic Authentication using username and password.

🔐 Example: curl

curl -u "username:password" -X POST https://<tenant>-trino-stream.<env>.promethium.ai/query \
-H "Content-Type: application/json" \
-d '{"sql": "SELECT 1"}'

JWT Token (idtoken Header)

Use a JWT token obtained from Promethium's authentication service. The token is passed in the idtoken header.

See Authentication API for details on obtaining an idtoken.

🔐 Example: curl

curl -X POST https://<tenant>-trino-stream.<env>.promethium.ai/query \
-H "Content-Type: application/json" \
-H "idtoken: eyJhbGciOiJSUzI1NiIs..." \
-d '{"sql": "SELECT current_user"}'

Client Credentials (Bearer Token)

OAuth2 Client Credentials flow for service-to-service authentication.

Step 1: Obtain Access Token

curl -X POST https://api.{env}.promethium.ai/auth/{tenant}/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=your_client_id" \
-d "client_secret=your_client_secret"

✅ Success (200 OK)

{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 3600
}

Step 2: Use Bearer Token

curl -X POST https://<tenant>-trino-stream.<env>.promethium.ai/query \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
-d '{"sql": "SELECT current_user"}'

Health Check Endpoints

These endpoints do not require authentication:

EndpointMethodDescription
/GETRoot health check
/healthGETKubernetes readiness/liveness probe

🔐 Example: curl

curl https://<tenant>-trino-stream.<env>.promethium.ai/health

✅ Success (200 OK)

{
"status": "healthy",
"service": "trino-stream"
}