Connecting to snowflake via SSO

We’re trying to convert all of our Snowflake accounts to use SSO, and so we’re figuring out how to set that up for dbt.

I did the obvious thing of replacing the password configuration in profile.yml with

   ...
   authenticator: externalbrowser
   ...

When I try to run dbt with this configuration, it does bring up a browser window, but as soon as I have authenticated there, it immediately brings up another. I can keep authenticating, but the same thing keeps happening…

I’m using the lastest version of dbt-snowflake available via pip, which gives me dbt-core=1.75 and the snowflake plugin=1.72. I’m running this under git bash on Windows, but I saw essentially the same behavior running in a linux docker image, so I’m guessing it is not an OS issue.

The only issues I’ve seen referenced are pretty old (Intermittent problem with DB connection while using Snowflake and SSO · Issue #2742 · dbt-labs/dbt-core · GitHub) or don’t seem quite relevant, since authentication did succeed (Snowflake Community).

Any suggestions for what I might be looking at/for?

(Note the first time I tried this, I had threads set to four, and it brought up four browser windows, which is its own problem…)

Hi, I am having the same issue here with

dbt-snowflake = “== 1.8.0”
dbt-core = “== 1.8.0”

I launch a dbt run and it keeps opening browser windows to authenticate until the dbt run finishes.
I’ve only seen this answer for me it does not work: dbt-core opens multiple browser window for SSO Authentication, is there a way to prevent it ?

Any ideas on how to solve it?

Thank you!

Hi Denised,
Do you find any solution for this issue?

No I didn’t. We reverted to not using SSO for our dbt work.
Just recently we attempted to add MFA and ran into essentially the same difficulty: we’d get one MFA prompt for each query that dbt ran.

Looking through the info I can find, it seems like SSO or MFA caching may not be implemented on Linux, which means that it won’t work on our docker devcontainer. Can anyone confirm whether or not either SSO or MFA is expected to work with dbt-snowflake on Linux?

Hey, I got MFA to work! The missing piece was that I needed to set the “authenticator” attribute to “username_password_mfa” in profiles.yml. This worked for dbt in a Linux devcontainer.