Is it possible to use `externalbrowser` authenticator inside docker container for connection authentication with Snowflake?
Asked Answered
I

3

7

I am trying to use the snowflake connector inside docker container. I want to use the externalbrowser authenticator so that I can make connection using Okta credentials but the connector is failing with below mentioned error.

DatabaseError: (snowflake.connector.errors.DatabaseError) 250008 (08001): None: Failed to connect to DB: xx.snowflakecomputing.com:443, Unable to open a browser in this environment. (Background on this error at: http://sqlalche.me/e/13/4xp6)

Immerge answered 29/4, 2021 at 22:35 Comment(0)
A
1

As an aside, I'd recommend removing your account name from the question (shown in the error).

You are correct that the "externalbrowser" option is a browser-based SSO. It might be possible to get this running a docker container with some extended software and configuration, but I wouldn't recommend it as it doesn't seem worth the effort.

Instead, there's alternative SSO authentication methods you can look at such as Native SSO Okta, key-pair authentication, or external OAuth. These won't require the browser.

Anabelanabella answered 29/4, 2021 at 22:56 Comment(0)
H
1

I spent hours trying to find a solution for that as I use SSO + MFA and there was no way to do that with 'Native SSO Okta' for example. And today GPT4 just found a simple solution for me. I run the docker container like that docker run -it <docker-image> run -m <my_model>

It tries to open the web browser, can't do it so gives me a URL to copy paste into my browser on the host to proceed with the authentication and then asks me to copy paste the URL I am redirected to into the terminal and it works.

Henning answered 15/3, 2023 at 22:7 Comment(0)
G
0

I curled the url returned from SSO in the VS Code terminal on the devcontainer and I logged on to Snowflake in VS Code Jupyter Notebook. curl <url>

Gumption answered 7/7, 2023 at 9:27 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Millrun

© 2022 - 2024 — McMap. All rights reserved.