简体   繁体   English

在没有外部浏览器的情况下使用 sso 查询雪花

[英]query snowflake with sso without external browser

We are setting up snowflake with SSO and will not use userid and password.我们正在使用 SSO 设置雪花,不会使用用户名和密码。 which is just working fine.这工作正常。

We have used ping Federate for SSO.我们使用 ping Federate 进行 SSO。 But we need to query(insert, update etc) into snowflake using python which in future will be used in ETL pipeline.但是我们需要使用 python 查询(插入、更新等)到雪花中,将来将在 ETL 管道中使用。

Now it seems we can programmatically use sso authenticator but again it will be prompt for Idp password.现在看来我们可以以编程方式使用 sso 身份验证器,但它会再次提示输入 Idp 密码。 which is not feasible in automated pipeline.这在自动化管道中是不可行的。

import snowflake.connector
# Connecting to Snowflake using SAML 2.0-compliant IdP federated authentication
conn = snowflake.connector.connect(
  user='D******v',
  account='abcdf',
  authenticator='externalbrowser',
  warehouse='abcdf',
  database='abcdf',
  schema='abcdf'
)
cur = conn.cursor()
sql = "select * from table_name limit 10"
cur.execute(sql)
print(cur.fetchall())
cur.close()
conn.close()

I am trying to figure out programmatic way of setting up sso without passowrd prompt.我试图找出在没有密码提示的情况下设置 sso 的编程方式。 I tried to get the info but could not find any tutorial.我试图获取信息,但找不到任何教程。

Any link or suggestion will help任何链接或建议都会有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM