Skip to content

Global Auth token variable causes Trino datasources to share authentication state #326

Description

@Flgado

The OAuth access token is stored as a global package-level variable, which means all datasource instances share the same token. This causes authentication issues when multiple Trino datasources are configured with different OAuth client_id / client_secret pairs or different authentication methods.

As a result:

  1. User A configures a Trino datasource with `client1 / secret1 → obtains tokenA
  2. User B configures another Trino datasource with client2 / secret2unexpectedly reuses tokenA instead of generating its own
  3. When any token expires, datasource A may begin using datasource B’s token, or vice-versa (after refresh the token)

The root cause is this global variable:
https://github.com/trinodb/grafana-trino/blob/7b190bc0f359ceb3d432790a6dfed110aa324ce8/pkg/trino/client/client.go#L15C1-L18C2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions