Skip to content
Scalekit Docs
Talk to an EngineerDashboard

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.

clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asynclist_connections

Method to list connections

paramorganization_idstr

Client organization id to get connections

paramincludeOptional[str]

Optional. Return active connections or all, E.g. - ‘all’

returnsListConnectionsResponse

List Connections Response

response = scalekit_client.connection.list_connections(
'org_123456',
include='all'
)
for conn in response[0].connections:
print(f"Connection: {conn.id}")
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asynclist_connections_by_domain

Method to get connection object by domain

paramdomainstr

Client domain id to get connections

paramincludeOptional[str]

Optional. Return active connections or all, E.g. - ‘all’

returnsListConnectionsResponse

List Connections Response

response = scalekit_client.connection.list_connections_by_domain(
'acme.com',
include='all'
)
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asyncget_connection

Method to get connection object

paramorganization_idstr

Client organization id to get connection

paramconn_idstr

Client connection id to get connection

returnsGetConnectionResponse

Connection Response

response = scalekit_client.connection.get_connection(
'org_123456',
'conn_123456'
)
connection = response[0].connection
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asynccreate_connection

Method to create a new connection

paramorganization_idstr

Organization id to create connection for

paramconnectionCreateConnection

CreateConnection object with expected values for conn.

returnsCreateConnectionResponse

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
)
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asyncenable_connection

Method to enable connection

paramorganization_idstr

Client organization id to enable connection

paramconn_idstr

Client connection id to enable connection

returnsToggleConnectionResponse

Enable Connection Response

scalekit_client.connection.enable_connection('org_123456', 'conn_123456')
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asyncdisable_connection

Method to disable connection

paramorganization_idstr

Client organization id to disable connection

paramconn_idstr

Client connection id to disable connection

returnsToggleConnectionResponse

Disable Connection Response

scalekit_client.connection.disable_connection('org_123456', 'conn_123456')
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asyncdelete_connection

Method to delete a connection based in given organization and connection id

paramorganization_idstr

Organization id to delete connection for

paramconnection_idstr

Connection id of connection to be deleted

returnsNone

Empty on success.

scalekit_client.connection.delete_connection('org_123456', 'conn_123456')
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asynclist_app_connections

Method to list environment-level app connections

parampage_sizeOptional[int]

Results per page.

parampage_tokenOptional[str]

Optional. Token for pagination

paramproviderOptional[str]

Optional. Filter by provider (e.g. ‘HUBSPOT’)

returnsListAppConnectionsResponse

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 provider
response = scalekit_client.connection.list_app_connections(provider='HUBSPOT', page_size=10)
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asyncget_environment_connection

Method to get an environment-level connection by its id

paramconnection_idstr

Connection id to retrieve

returnsGetConnectionResponse

Get Connection Response

response = scalekit_client.connection.get_environment_connection('conn_123456')
conn = response[0].connection
print(f"Provider: {conn.provider_key}, Type: {conn.type}")
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asynccreate_environment_connection

Method to create a new environment-level connection

paramconnectionCreateConnection

CreateConnection object with expected values for conn.

paramflagsOptional[Flags]

Optional. Optional Flags (is_login, is_app)

returnsCreateConnectionResponse

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].connection
print(f"Created: {conn.id}, Key: {conn.key_id}")
# Create a Google Domain-Wide Delegation connection
response = 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)
)
clientConnectionhttps://github.com/scalekit-inc/scalekit-sdk-python/blob/main/scalekit/connection.py
#asyncupdate_environment_connection

Method to update an environment-level connection

paramconnection_idstr

Connection id to update

paramconnectionUpdateConnection

UpdateConnection object with fields to update

returnsUpdateConnectionResponse

Update Connection Response

from scalekit.v1.connections.connections_pb2 import (
UpdateConnection, ConnectionType, OAuthConnectionConfig, GoogleDWDConfig
)
# Update OAuth connection credentials
response = 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 connection
response = 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