Establishing a Connection
The objects available within our connector are accessible from the "cdata.connect" module. To use the module's objects directly:
- Import the module as follows:
import cdata.connect as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("AuthScheme=basic;URL=http://hostname:port/rest.rsc;User=my_user;Password=my_password;")
Establishing a Connection
Connecting to CData Connect Cloud
CData Connect Cloud supports two ways to authenticate: OAuth and ClientJWT.
OAuth Authentication
Use OAuth authentication when you want users to authenticate interactively via their CData Connect Cloud credentials. To configure OAuth authentication, set the following in the Admin Console:
- AuthScheme: OAuth.
- Click Test Connection or Sign In to open the OAuth sign-in page.
- Enter your CData Connect Cloud credentials and sign-in.
ClientJWT Authentication
Use ClientJWT authentication when your application needs to connect using a pre-signed JWT token. This method is commonly used in OEM deployments or automated workflows. To configure ClientJWT authentication, set the following connection properties in the Admin Console:
- AuthScheme: ClientJWT.
- ClientJWTCert: Path to the certificate file used to sign the JWT.
- ClientJWTCertType: Format of the certificate file (PEM or PFX).
- ClientJWTCertPassword: Password for the certificate file (if applicable).
- ClientJWTIssuer: The OEM's account ID.
- ClientJWTSubject: The customer's account ID.
- ClientJWTValidityTime (optional): Expiry duration of the JWT in seconds. Default is 3600.
Connecting to CData Connect Server
To connect to CData Connect Server, set the following connection properties in the Admin Console:
- AuthScheme: Basic.
- URL: The REST URL found on the Endpoints page of the Admin Console.
- User: A user that you configured in the Connect Server dashboard.
- Password: The AuthToken for the chosen user.