Skip to content

Latest commit

 

History

History
286 lines (202 loc) · 57.8 KB

File metadata and controls

286 lines (202 loc) · 57.8 KB

SamlConnections

Warning

This SDK is DEPRECATED

Overview

Available Operations

  • list - Get a list of SAML Connections for an instance ⚠️ Deprecated
  • create - Create a SAML Connection ⚠️ Deprecated
  • get - Retrieve a SAML Connection by ID ⚠️ Deprecated
  • update - Update a SAML Connection ⚠️ Deprecated
  • delete - Delete a SAML Connection ⚠️ Deprecated

list

Returns the list of SAML Connections for an instance. Results can be paginated using the optional limit and offset query parameters. The SAML Connections are ordered by descending creation date and the most recent will be returned first. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.saml_connections.list(limit=20, offset=10, query="<value>", order_by="<value>", organization_id=[
        "<id 1>",
    ])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
limit Optional[int] Applies a limit to the number of results returned.
Can be used for paginating the results together with offset.
20
offset Optional[int] Skip the first offset results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with limit.
10
query Optional[str] Returns SAML connections that have a name that matches the given query, via case-insensitive partial match.
order_by Optional[str] Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username.
By prepending one of those values with + or -,
we can choose to sort in ascending (ASC) or descending (DESC) order.
organization_id List[str] Returns SAML connections that have an associated organization ID to the
given organizations.
For each organization ID, the + and - can be
prepended to the ID, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization IDs.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SAMLConnections

Errors

Error Type Status Code Content Type
models.ClerkErrors 402, 403, 422 application/json
models.SDKError 4XX, 5XX */*

create

Create a new SAML Connection. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

import clerk_backend_api
from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.saml_connections.create(request={
        "name": "My SAML Connection",
        "domain": "example.org",
        "domains": [
            "<value 1>",
            "<value 2>",
            "<value 3>",
        ],
        "provider": clerk_backend_api.CreateSAMLConnectionRequestBodyProvider.SAML_CUSTOM,
        "idp_entity_id": "http://idp.example.org/",
        "idp_sso_url": "http://idp.example.org/sso",
        "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...",
        "idp_metadata_url": "http://idp.example.org/metadata.xml",
        "idp_metadata": "<EntityDescriptor ...",
        "organization_id": "<id>",
        "attribute_mapping": {
            "user_id": "nameid",
            "email_address": "mail",
            "first_name": "givenName",
            "last_name": "surname",
        },
        "force_authn": False,
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request models.CreateSAMLConnectionRequestBody ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SchemasSAMLConnection

Errors

Error Type Status Code Content Type
models.ClerkErrors 402, 403, 404, 422 application/json
models.SDKError 4XX, 5XX */*

get

Fetches the SAML Connection whose ID matches the provided saml_connection_id in the path. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.saml_connections.get(saml_connection_id="saml_conn_123")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
saml_connection_id str ✔️ The ID of the SAML Connection saml_conn_123
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SchemasSAMLConnection

Errors

Error Type Status Code Content Type
models.ClerkErrors 402, 403, 404 application/json
models.SDKError 4XX, 5XX */*

update

Updates the SAML Connection whose ID matches the provided id in the path. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.saml_connections.update(saml_connection_id="saml_conn_123_update", name="Example SAML Connection", domains=[
        "<value 1>",
        "<value 2>",
        "<value 3>",
    ], idp_entity_id="entity_123", idp_sso_url="https://idp.example.com/sso", idp_certificate="MIIDBTCCAe2gAwIBAgIQ...", idp_metadata_url="https://idp.example.com/metadata", idp_metadata="<EntityDescriptor>...</EntityDescriptor>", organization_id="<id>", attribute_mapping={
        "user_id": "id123",
        "email_address": "user@example.com",
        "first_name": "Jane",
        "last_name": "Doe",
    }, active=True, sync_user_attributes=False, allow_subdomains=True, allow_idp_initiated=False, disable_additional_identifications=False, force_authn=True, consent_verified_domains_deletion=False)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
saml_connection_id str ✔️ The ID of the SAML Connection to update saml_conn_123_update
name OptionalNullable[str] The name of the new SAML Connection Example SAML Connection
domain OptionalNullable[str] : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The domain to use for the new SAML Connection
example.com
domains List[str] A list of the domains on use for the SAML connection
idp_entity_id OptionalNullable[str] The Entity ID as provided by the IdP entity_123
idp_sso_url OptionalNullable[str] The SSO URL as provided by the IdP https://idp.example.com/sso
idp_certificate OptionalNullable[str] The x509 certificated as provided by the IdP MIIDBTCCAe2gAwIBAgIQ...
idp_metadata_url OptionalNullable[str] The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them https://idp.example.com/metadata
idp_metadata OptionalNullable[str] The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties ...
organization_id OptionalNullable[str] The ID of the organization to which users of this SAML Connection will be added
attribute_mapping OptionalNullable[models.AttributeMapping] Define the attribute name mapping between Identity Provider and Clerk's user properties
active OptionalNullable[bool] Activate or de-activate the SAML Connection true
sync_user_attributes OptionalNullable[bool] Controls whether to update the user's attributes in each sign-in false
allow_subdomains OptionalNullable[bool] Allow users with an email address subdomain to use this connection in order to authenticate true
allow_idp_initiated OptionalNullable[bool] Enable or deactivate IdP-initiated flows false
disable_additional_identifications OptionalNullable[bool] Enable or deactivate additional identifications
force_authn Optional[bool] Enable or deactivate ForceAuthn
consent_verified_domains_deletion OptionalNullable[bool] When enabling the connection, controls behavior when verified domains used for enrollment modes like automatic invitation or automatic suggestion already exist for the same domain. If true, those verified domains are removed and the connection is enabled. If false or omitted, the request fails when any such verified domain exists.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SchemasSAMLConnection

Errors

Error Type Status Code Content Type
models.ClerkErrors 402, 403, 404, 422 application/json
models.SDKError 4XX, 5XX */*

delete

Deletes the SAML Connection whose ID matches the provided id in the path. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.saml_connections.delete(saml_connection_id="saml_conn_123_delete")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
saml_connection_id str ✔️ The ID of the SAML Connection to delete saml_conn_123_delete
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DeletedObject

Errors

Error Type Status Code Content Type
models.ClerkErrors 402, 403, 404 application/json
models.SDKError 4XX, 5XX */*