starburstdata / dbt-trino

The Trino (https://trino.io/) adapter plugin for dbt (https://getdbt.com)
Apache License 2.0
212 stars 54 forks source link

oauth authentication not working in dbt Core #275

Closed dataders closed 1 year ago

dataders commented 1 year ago

Expected behavior

Following the below guidance from https://github.com/dbt-labs/docs.getdbt.com/pull/3055#discussion_r1150457445

To use OAuth in dbt-trino you can simply add method: oauth to the profiles.yml. During first authentication, it automatically opens a browser with OAuth provider to authenticate.

I did so, and I don't get a browser pop-up. I'm not sure how to debug..

when I run dbt run or dbt debug nothing happens for minutes then fails with the below error:

HTTPSConnectionPool(
  host='bunbundersders.trino.galaxy-dev.io', port=433):
    Max retries exceeded with url: /v1/statement (
     Caused by ConnectTimeoutError(
       <urllib3.connection.HTTPSConnection object at 0x107b4eb00>,
         'Connection to bunbundersders.trino.galaxy-dev.io timed out. (connect timeout=30.0)'))

profiles.yml

sandbox-galaxy:
  target: oauth
  outputs:
    oauth:
      type: trino
      method: oauth
      host: bunbundersders.trino.galaxy-dev.io
      catalog: dbt_target
      schema: dataders
      port: 433

Actual behavior

a

Steps To Reproduce

a

Log output/Screenshots

a

Operating System

macos

dbt version

1.4.1

Trino Server version

Galaxy?

Python version

3.10.8

Are you willing to submit PR?

hovaesco commented 1 year ago

Works for me. Did you have properly configured SSO in Starburst Galaxy? You can find it under Access Control --> Single sign-on

mdesmet commented 1 year ago

oauth only works on the client side, it uses webbrowser to launch the browser. If you want it to work in a web application the redirection url needs to be passed to the logged on user.