Establishing a Connection
The objects available within our connector are accessible from the "cdata.saphana" module. To use the module's objects directly:
- Import the module as follows:
import cdata.saphana as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("User=system;Password=mypassword;Server=localhost;Database=systemdb;")
Connecting to SAP HANA Cloud
Set the following to connect to data:- Server: Set this property to the name or network address of the SAP HANA database instance.
- Port: Set this to 443.
- UseSSL: Set this to True.
Connecting to SAP HANA On-Prem
Set the following to connect to data:
- Server: Set this property to the name or network address of the SAP HANA database instance.
- Port: The port of the server hosting the SAP HANA database.
Authenticating to SAP HANA
Once you have provided the connection details, set the following database credentials to authenticate to SAP HANA:
- User: The username provided for authentication with the SAP HANA database.
- Password: The password provided for authentication with the SAP HANA database.
Okta
Set the AuthScheme to Okta. The following connection properties are used to connect to Okta:
- User: Set this to the Okta user.
- Password: Set this to Okta password for the user.
- SSOProperties (optional): Set this to the OTP code that was sent to your device. This property should be used only when MFA is required for OKTA sign on.
The following SSOProperties are needed to authenticate to Okta:
- SSOLoginUrl: Set this to the OKTA's login URL.
- MFAType (optional): Set this to the multi-factor type. This property should be used only when MFA is required for OKTA sign on. This property accepts one of the following values:
- OKTAVerify
- SMS
- APIToken (optional): Set this to the API Token that the customer created from the Okta org. It should be used when authenticating a user via a trusted application or proxy that overrides OKTA client request context.
The following is an example connection string:
AuthScheme=OKTA;User=username;Password=password;Server=myserver;SSO Properties='SSOLoginUrl=https://cdata-okta.okta.com';