使用身分提供者外掛程式 - Amazon Redshift

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用身分提供者外掛程式

如需如何使用身分提供者外掛程式的一般資訊,請參閱提供IAM認證的選項。如需管理IAM身分識別的詳細資訊,包括IAM角色的最佳做法,請參閱Amazon Redshift 中的身分和存取管理

使用身ADFS分識別提供者外掛程式

以下是使用作用中目錄聯合服務 (ADFS) 身分識別提供者外掛程式來驗證連線到 Amazon Redshift 資料庫的使用者的範例。

>>> con = redshift_connector.connect( iam=True, database='dev', host='my-testing-cluster.abc.us-east-2.redshift.amazonaws.com', cluster_identifier='my-testing-cluster', credentials_provider='AdfsCredentialsProvider', user='brooke@myadfshostname.com', password='Hunter2', idp_host='myadfshostname.com' )

使用 Azure 身分提供者外掛程式進行身分驗證

以下是使用 Azure 身分提供者外掛程式進行身分驗證的範例。您可以為 Azure 企業應用程式建立 client_idclient_secret 的值,如下所示。

>>> con = redshift_connector.connect( iam=True, database='dev', host='my-testing-cluster.abc.us-east-2.redshift.amazonaws.com', cluster_identifier='my-testing-cluster', credentials_provider='AzureCredentialsProvider', user='brooke@myazure.org', password='Hunter2', idp_tenant='my_idp_tenant', client_id='my_client_id', client_secret='my_client_secret', preferred_role='arn:aws:iam:123:role/DataScientist' )

使用驗證 AWS IAM身分識別中心身分提供者

以下是使用驗證的範例 AWS IAM身分識別中心身分提供者外掛

with redshift_connector.connect( credentials_provider='BrowserIdcAuthPlugin', host='my-testing-cluster.abc.us-east-2.redshift.amazonaws.com', database='dev', idc_region='us-east-1', issuer_url='https://identitycenter.amazonaws.com/ssoins-790723ebe09c86f9', idp_response_timeout=60, listen_port=8100, idc_client_display_name='Test Display Name', # port value of 5439 is specified by default )

使用 Azure Browser 身分提供者外掛程式進行身分驗證

以下是使用 Azure Browser 身分提供者外掛程式來針對連線至 Amazon Redshift 資料庫的使用者進行驗證的範例。

由使用者提供登入憑據的瀏覽器會進行多重要素驗證。

>>>con = redshift_connector.connect( iam=True, database='dev', host='my-testing-cluster.abc.us-east-2.redshift.amazonaws.com', cluster_identifier='my-testing-cluster', credentials_provider='BrowserAzureCredentialsProvider', idp_tenant='my_idp_tenant', client_id='my_client_id', )

使用 Okta 身分提供者外掛程式進行身分驗證

以下是使用 Okta 身分提供者外掛程式進行身分驗證的範例。您可以透過 Okta 應用程式取得 idp_hostapp_idapp_name 的值。

>>> con = redshift_connector.connect( iam=True, database='dev', host='my-testing-cluster.abc.us-east-2.redshift.amazonaws.com', cluster_identifier='my-testing-cluster', credentials_provider='OktaCredentialsProvider', user='brooke@myazure.org', password='hunter2', idp_host='my_idp_host', app_id='my_first_appetizer', app_name='dinner_party' )

使用通用 JumpCloud SAML瀏覽器身份提供程序插件進行身份

以下是一個通用 JumpCloud 的SAML瀏覽器身份提供者插件進行身份驗證使用的一個例子。

密碼是必要參數。但是,您不必輸入此參數,因為瀏覽器會進行多重要素驗證。

>>> con = redshift_connector.connect( iam=True, database='dev', host='my-testing-cluster.abc.us-east-2.redshift.amazonaws.com', cluster_identifier='my-testing-cluster', credentials_provider='BrowserSamlCredentialsProvider', user='brooke@myjumpcloud.org', password='', login_url='https://sso.jumpcloud.com/saml2/plustwo_melody' )