Skip to main content

Third Party App Integrations

Some functions require integration with a third party app to operate. To use them you must register the app integration and its auth provider if any. Any credentials for auth providers are encrypted with an RSA public key.

Detailed SDK Usage

Prerequisites:

  • Install Istari SDK and initialize Istari Client per instructions here
  • You must have Admin permissions to create App Integrations and Auth Integrations.
  • To use Auth Integrations you must set up RSA encryption keys.
  • RSA Key Pair: You need a 2048-bit RSA key pair with a public exponent of 65537.
  • Private Key Placement: The private key must be securely installed on the agent. See [Setting up RSA Encryption Keys](/integrations/App Integrations/auth-integrations#setting-up-rsa-encryption-keys) for more details.

Example: Creating an App Integration

To create an App Integration provide a name for your integration and indicate the type of integration from the list of supported integration types.

new_app_integration = NewAppIntegration(
description="ACME Inc. Google Drive",
integration_type=IntegrationType.GOOGLE_DRIVE,
)

app_integration = client.create_app_integration(new_app_integration)

API Reference:

Example: Adding an Auth Integration

Most Auth Integrations require registration information to enable access. For example, OAuth 2.0 requires client applications to present registered OAuth credentials prior to receiving authorization.

  1. Create an Auth Registration Info file:

Create a JSON file that contains the auth registration information. The structure of this file depends on your auth provider type. Please see the section on Registration Information for more details.

  1. Create an Auth Integration:

Specify the auth integration type from the list of supported types. You can also include a registration information when creating your Auth Integration.

path_to_json_file = "registration_file.json"

auth_integration = client.create_auth_integration(
auth_integration_type=AuthIntegrationType.GOOGLE_ACCOUNTS,
auth_type=FunctionAuthType.OAuth2
app_integration_id=app_integration.id,
auth_registration_path=path_to_json_file
))

API Reference:

Example: Update an Auth Integration with a Registration Information

If you have created an Auth Integration without a registration information you can add one after the fact.

auth_integration = client.update_auth_integration(
auth_integration_id="6cb78ba5-6f00-4bec-b359-5f483cb93234"
auth_integration_type=AuthIntegrationType.GOOGLE_ACCOUNTS,
auth_type=FunctionAuthType.OAUTH2
auth_registration_path=path_to_new_json_file
)

API Reference:

Example: Publishing an RSA Public Key

To publish your public key, use the Istari SDK. The following example demonstrates how to create a public key using the Istari Client.

file_name = "public_key.pem"
file_path = "absolute/path/to/public_key.pem"
tenant_public_key = client.create_tenant_public_key(file_name, file_path)

API Reference:

Example: Using the Public Key

Once your public key is added the SDK will automatically use it to encrypt secrets.

encrypted_secert_reference = client.add_function_auth_secret(FunctionAuthType.OAuth2, "path/to/secret")

API Reference: