(SamlConnections)
- 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
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.
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
ListSAMLConnectionsResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
402, 403, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Create a new SAML Connection.
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
CreateSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
402, 403, 404, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Fetches the SAML Connection whose ID matches the provided saml_connection_id
in the path.
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
Parameter |
Type |
Required |
Description |
Example |
SamlConnectionId |
string |
✔️ |
The ID of the SAML Connection |
saml_conn_123 |
GetSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
402, 403, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Updates the SAML Connection whose ID matches the provided id
in the path.
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
Parameter |
Type |
Required |
Description |
Example |
SamlConnectionId |
string |
✔️ |
The ID of the SAML Connection to update |
saml_conn_123_update |
RequestBody |
UpdateSAMLConnectionRequestBody |
✔️ |
N/A |
|
UpdateSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
402, 403, 404, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Deletes the SAML Connection whose ID matches the provided id
in the path.
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
Parameter |
Type |
Required |
Description |
Example |
SamlConnectionId |
string |
✔️ |
The ID of the SAML Connection to delete |
saml_conn_123_delete |
DeleteSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
402, 403, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |