使用sqlalchemy的雪花sso连接不起作用

时间:2020-11-02 09:14:32

标签: snowflake-cloud-data-platform

我正在尝试在python脚本中配置sso连接。 这是我的代码:

import sqlalchemy
def get_snowflake_engine(warehouse="ETL", environment=None):
    username = ‘userx@domainx.com'
    account = ‘accountx
    database = ‘dbx’
    authenticator = 'externalbrowser'
    return sqlalchemy.create_engine(
        f"snowflake://{username}:@{account}/{database}?authenticator={authenticator}&warehouse={warehouse}"
    )

engine = get_snowflake_engine(environment='production')
connection = engine.connect()
try:
    result = connection.execute('SELECT NOW()').fetchall()
    print(result)
finally:
    connection.close()
    engine.dispose()

我希望我的浏览器弹出授权表单(我们将google用于sso) 我在终端上遇到了麻烦,但是在浏览器上什么也没发生:

Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...

过一会儿我会例外

有什么建议吗? 使用MacOS,Pycharm

我在DataGrip上配置了一个使用authenticator ='externalbrowser'的连接,它可以按预期工作。

TIA

0 个答案:

没有答案
相关问题