Skip to content

Latest commit

 

History

History
228 lines (158 loc) · 12.2 KB

File metadata and controls

228 lines (158 loc) · 12.2 KB

SamlConnections

(SamlConnections)

Overview

Available Operations

  • List - Get a list of SAML Connections for an instance
  • Create - Create a SAML Connection
  • Get - Retrieve a SAML Connection by ID
  • Update - Update a SAML Connection
  • Delete - Delete a SAML Connection

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.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
using Clerk.BackendAPI.Models.Operations;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

ListSAMLConnectionsRequest req = new ListSAMLConnectionsRequest() {};

var res = await sdk.SamlConnections.ListAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ListSAMLConnectionsRequest ✔️ The request object to use for the request.

Response

ListSAMLConnectionsResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 402, 403, 422 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Create

Create a new SAML Connection.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
using Clerk.BackendAPI.Models.Operations;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

CreateSAMLConnectionRequestBody req = new CreateSAMLConnectionRequestBody() {
    Name = "My SAML Connection",
    Domain = "example.org",
    Provider = Provider.SamlCustom,
    IdpEntityId = "http://idp.example.org/",
    IdpSsoUrl = "http://idp.example.org/sso",
    IdpCertificate = "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...",
    IdpMetadataUrl = "http://idp.example.org/metadata.xml",
    IdpMetadata = "<EntityDescriptor ...",
    AttributeMapping = new AttributeMapping() {
        UserId = "nameid",
        EmailAddress = "mail",
        FirstName = "givenName",
        LastName = "surname",
    },
};

var res = await sdk.SamlConnections.CreateAsync(req);

// handle response

Parameters

Parameter Type Required Description
request CreateSAMLConnectionRequestBody ✔️ The request object to use for the request.

Response

CreateSAMLConnectionResponse

Errors

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

Get

Fetches the SAML Connection whose ID matches the provided saml_connection_id in the path.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.SamlConnections.GetAsync(samlConnectionId: "saml_conn_123");

// handle response

Parameters

Parameter Type Required Description Example
SamlConnectionId string ✔️ The ID of the SAML Connection saml_conn_123

Response

GetSAMLConnectionResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 402, 403, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Update

Updates the SAML Connection whose ID matches the provided id in the path.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
using Clerk.BackendAPI.Models.Operations;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.SamlConnections.UpdateAsync(
    samlConnectionId: "saml_conn_123_update",
    requestBody: new UpdateSAMLConnectionRequestBody() {
        Name = "Example SAML Connection",
        Domain = "example.com",
        IdpEntityId = "entity_123",
        IdpSsoUrl = "https://idp.example.com/sso",
        IdpCertificate = "MIIDBTCCAe2gAwIBAgIQ...",
        IdpMetadataUrl = "https://idp.example.com/metadata",
        IdpMetadata = "<EntityDescriptor>...</EntityDescriptor>",
        AttributeMapping = new UpdateSAMLConnectionAttributeMapping() {
            UserId = "id123",
            EmailAddress = "[email protected]",
            FirstName = "Jane",
            LastName = "Doe",
        },
        Active = true,
        SyncUserAttributes = false,
        AllowSubdomains = true,
        AllowIdpInitiated = false,
    }
);

// handle response

Parameters

Parameter Type Required Description Example
SamlConnectionId string ✔️ The ID of the SAML Connection to update saml_conn_123_update
RequestBody UpdateSAMLConnectionRequestBody ✔️ N/A

Response

UpdateSAMLConnectionResponse

Errors

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

Delete

Deletes the SAML Connection whose ID matches the provided id in the path.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.SamlConnections.DeleteAsync(samlConnectionId: "saml_conn_123_delete");

// handle response

Parameters

Parameter Type Required Description Example
SamlConnectionId string ✔️ The ID of the SAML Connection to delete saml_conn_123_delete

Response

DeleteSAMLConnectionResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 402, 403, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*