Create SQL Alchemy connection string using Okta IdP
See original GitHub issueDriver version
redshift_connector 2.0.889
Redshift version
PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.31651
Client Operating System
mac OS Monterery
Python version
3.9.7
Problem description
import redshift_connector
# An Okta auth page will pop up when initiating this connector
conn = redshift_connector.connect(
host='<cluster_identifier>.ap-southeast-2.redshift.amazonaws.com',
port=5439,
region='ap-southeast-2',
database='<db_name>',
credentials_provider='BrowserSamlCredentialsProvider',
login_url='<saml_url>',
cluster_identifier='<cluster_identifer',
preferred_role='arn:aws:iam::<iam-id>:role/<role-name>',
user='', # left empty string
password='', # left empty string
iam=True,
ssl=True
)
cursor: redshift_connector.Cursor = conn.cursor()
Currently, I can connect to Redshift using the above credentials but when trying to utilise the SQL Alchemy connection string - it causes an identification error (using sqlalchemy-redshift
). Is there a way to generate an appropriate URL for sqlalchemy
to parse for IdP authentication?
I’ve noticed that Redshift was recently updated to work with sqlalchemy-redshift
but have had no luck generating an appropriate URL login.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
How to connect using SQLAlchemy with Okta IdP?
Hi @idoki I would add this to the git repository as an open issue. However, I have seen others use snowsql to make...
Read more >Support Identity Provider (IdP) Authentication #115 - GitHub
My organization doesn't allow user passwords on snowflake accounts. The snowsql external browser authentication works fine but in the above ...
Read more >How to connect python to Snowflake using SSO (sqlalchemy)?
I am trying to redesign the connection string but can't seem to get it right. This was my initial connection string before SSO:...
Read more >How To Connect To A Snowflake Database With Python
However, “for convenience, you can use the snowflake. sqlalchemy. URL method to construct the connection string and connect to the database”:
Read more >Use the Amazon Redshift SQLAlchemy dialect to interact with ...
In this step, we show you how to connect to your Amazon Redshift cluster using two different methods: Okta SSO federation, and direct...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yay! I’m happy to hear this, @nam-tonthat-afterpay. Best wishes on your project 😃
Hi @Brooke-white, did a fresh install this morning and tried. Looks like everything is working perfectly. Closing the thread. The debug logging helped me iron out any issues. Thank you again for your help and patience on this!