I am using Trino to communicate with OpenSky, which is a flight record (ADSB) historical database. I am a contributor to the OpenSky network and have approved credentials.
The OpenSky Quick Guide shows how to use Trino with a CLI:
trino --user=USER --password --server=https://trino.opensky-network.org --external-authentication --catalog "minio" --schema "osky"
When I execute this, It successfully connects and I can run queries in the terminal. However, if I remove the -external authentication
flag, it causes an invalid credential error.
Since Trino client will be running on the backend of a node.js server, I instead need to use a programmatic client trino-client.
const trino: Trino = Trino.create({
server: "https://trino.opensky-network.org",
catalog: 'minio',
schema: 'osky',
auth: new BasicAuth(process.env.OPENSKY_USERNAME as string, process.env.OPENSKY_PASSWORD as string),
});
However, this causes the same invalid credentials error. This has led to me the conclusion that it is because the Trino programmatic client is using BasicAuth rather than external authentication. The external authentication automatically opens a web browser for sign-in for the CLI.
Is there any way I can use a programmatic Trino client with external authentication? If it does exist, is it possible in the trio-client
node.js client, or should I switch to a different one? I can work either way as long as it is programmatic.