SSO connections
Configure enterprise SSO connections
Use scalekit_client.connection to configure enterprise SSO (SAML/OIDC) for an organization.
Enable SSO after the organization exists: create a connection, complete IdP setup, and test sign-in for that org.
list_connections
Section titled “list_connections”#asynclist_connections
Method to list connections
Client organization id to get connections
Optional. Return active connections or all, E.g. - ‘all’
List Connections Response
response = scalekit_client.connection.list_connections( 'org_123456', include='all')
for conn in response[0].connections: print(f"Connection: {conn.id}")list_connections_by_domain
Section titled “list_connections_by_domain”#asynclist_connections_by_domain
Method to get connection object by domain
Client domain id to get connections
Optional. Return active connections or all, E.g. - ‘all’
List Connections Response
response = scalekit_client.connection.list_connections_by_domain( 'acme.com', include='all')get_connection
Section titled “get_connection”#asyncget_connection
Method to get connection object
Client organization id to get connection
Client connection id to get connection
Connection Response
response = scalekit_client.connection.get_connection( 'org_123456', 'conn_123456')connection = response[0].connectioncreate_connection
Section titled “create_connection”#asynccreate_connection
Method to create a new connection
Organization id to create connection for
CreateConnection object with expected values for conn.
Create Connection Response
from scalekit.v1.connections.connections_pb2 import CreateConnection
connection = CreateConnection()connection.type = "SAML"
response = scalekit_client.connection.create_connection( 'org_123456', connection)enable_connection
Section titled “enable_connection”#asyncenable_connection
Method to enable connection
Client organization id to enable connection
Client connection id to enable connection
Enable Connection Response
scalekit_client.connection.enable_connection('org_123456', 'conn_123456')disable_connection
Section titled “disable_connection”#asyncdisable_connection
Method to disable connection
Client organization id to disable connection
Client connection id to disable connection
Disable Connection Response
scalekit_client.connection.disable_connection('org_123456', 'conn_123456')delete_connection
Section titled “delete_connection”#asyncdelete_connection
Method to delete a connection based in given organization and connection id
Organization id to delete connection for
Connection id of connection to be deleted
Empty on success.
scalekit_client.connection.delete_connection('org_123456', 'conn_123456')list_app_connections
Section titled “list_app_connections”#asynclist_app_connections
Method to list environment-level app connections
Results per page.
Optional. Token for pagination
Optional. Filter by provider (e.g. ‘HUBSPOT’)
List App Connections Response
response = scalekit_client.connection.list_app_connections()
for conn in response[0].connections: print(f"Connection: {conn.id}, Provider: {conn.provider_key}")
# Filter by providerresponse = scalekit_client.connection.list_app_connections(provider='HUBSPOT', page_size=10)get_environment_connection
Section titled “get_environment_connection”#asyncget_environment_connection
Method to get an environment-level connection by its id
Connection id to retrieve
Get Connection Response
response = scalekit_client.connection.get_environment_connection('conn_123456')conn = response[0].connectionprint(f"Provider: {conn.provider_key}, Type: {conn.type}")create_environment_connection
Section titled “create_environment_connection”#asynccreate_environment_connection
Method to create a new environment-level connection
CreateConnection object with expected values for conn.
Optional. Optional Flags (is_login, is_app)
Create Connection Response
from scalekit.v1.connections.connections_pb2 import ( CreateConnection, ConnectionType, Flags)
# Create an OAuth app connection (e.g., HubSpot)response = scalekit_client.connection.create_environment_connection( connection=CreateConnection( provider_key='HUBSPOT', type=ConnectionType.OAUTH ), flags=Flags(is_app=True))conn = response[0].connectionprint(f"Created: {conn.id}, Key: {conn.key_id}")
# Create a Google Domain-Wide Delegation connectionresponse = scalekit_client.connection.create_environment_connection( connection=CreateConnection( provider_key='GOOGLEDWD', type=ConnectionType.GOOGLE_DWD, key_id='my-gdwd-connection' ), flags=Flags(is_app=True))update_environment_connection
Section titled “update_environment_connection”#asyncupdate_environment_connection
Method to update an environment-level connection
Connection id to update
UpdateConnection object with fields to update
Update Connection Response
from scalekit.v1.connections.connections_pb2 import ( UpdateConnection, ConnectionType, OAuthConnectionConfig, GoogleDWDConfig)
# Update OAuth connection credentialsresponse = scalekit_client.connection.update_environment_connection( connection_id='conn_123456', connection=UpdateConnection( provider_key='HUBSPOT', key_id='hubspot-key', type=ConnectionType.OAUTH, oauth_config=OAuthConnectionConfig( client_id={'value': 'my-client-id'}, client_secret={'value': 'my-client-secret'} ) ))
# Update Google DWD connectionresponse = scalekit_client.connection.update_environment_connection( connection_id='conn_123456', connection=UpdateConnection( provider_key='GOOGLEDWD', key_id='my-gdwd-connection', type=ConnectionType.GOOGLE_DWD, google_dwd_config=GoogleDWDConfig( service_account_json={'value': '{"type":"service_account",...}'}, scopes=['https://www.googleapis.com/auth/admin.directory.user.readonly'], token_uri={'value': 'https://oauth2.googleapis.com/token'} ) ))conn = response[0].connection