Different redirect url than http://localhost:7890/redshift/
Driver version
redshift-connector 2.0.917
Redshift version
Not related.
Client Operating System
Ubuntu 22.04.2 LTS running code-server on Kubeflow Notebook in AWS EKS.
Python version
Python 3.10.6
Table schema
Not related.
Problem description
-
Expected behaviour: Login with following script should work:
import redshift_connector conn: redshift_connector.Connection = redshift_connector.connect( iam=True, database=redacted, host=redacted, cluster_identifier=redacted, credentials_provider='BrowserSamlCredentialsProvider', login_url=corporate_sso_login_url, region=region, preferred_role=redacted )This results with a successful login with the IdP but the redirect to the
http://localhost:7890/redshift/is not suitable for me because theredshift_connectoris running on a remote server with code-server. -
Actual behaviour: It should be possible to define different redirect url.
-
Error message/stack trace:
-
Any other details that can be helpful: I'm thinking of some solution using proxy but then the redirect url would have to point to the proxy server.
Also, code-server has the functionality to create a proxy for open ports. For example, running the script above creates an endpoint like
https://kubeflow.example.com/notebook/nb_ns/nb_name/proxy/7890/.Any other ideas on how this scenario can be handled are very much welcomed.
Python Driver trace logs
Not related.
Hey @kromanow94,
Thanks for reaching out regarding this. For reference, here is where we implement BrowserSamlCredentialsProvider. The problematic piece of code is the run_server() method, which hardcodes HOST to localhost. One work around to implement a class which extends BrowserSamlCredentialsProvider and modify the run_server() method to use a different value for HOST, and if needed PORT. Unfortunately this is a bit messy given how run_server() is implemented. for example
class myPlugin(BrowserSamlCredentialsProvider):
def run_server(self, listen_port, idp_response_timeout) -> str:
HOST = "your_host"
PORT = "your_port"
# rest of method
redshift_connector.connect(
...,
credentials_provider="your.path.to.myPlugin",
...,
Hey @Brooke-white ,
Thanks for explaining. I'll give it a try. Thanks!
@Brooke-white wouldn't you agree that maybe this should be possible to pass as additional argument (host,port) as part of the redshift_connector?