(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.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
ListSAMLConnectionsResponse res = sdk.samlConnections().list()
.limit(10L)
.offset(0L)
.call();
if (res.samlConnections().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
limit |
Optional<Long> |
➖ |
Applies a limit to the number of results returned. Can be used for paginating the results together with offset . |
offset |
Optional<Long> |
➖ |
Skip the first offset results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with limit . |
ListSAMLConnectionsResponse
Error Type |
Status Code |
Content Type |
models/errors/ClerkErrors |
402, 403, 422 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Create a new SAML Connection.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.CreateSAMLConnectionRequestBody;
import com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse;
import com.clerk.backend_api.models.operations.Provider;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
CreateSAMLConnectionRequestBody req = CreateSAMLConnectionRequestBody.builder()
.name("<value>")
.domain("low-packaging.info")
.provider(Provider.SAML_CUSTOM)
.build();
CreateSAMLConnectionResponse res = sdk.samlConnections().create()
.request(req)
.call();
if (res.schemasSAMLConnection().isPresent()) {
// handle response
}
}
}
CreateSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
models/errors/ClerkErrors |
402, 403, 422 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Fetches the SAML Connection whose ID matches the provided saml_connection_id
in the path.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.GetSAMLConnectionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetSAMLConnectionResponse res = sdk.samlConnections().get()
.samlConnectionId("<id>")
.call();
if (res.schemasSAMLConnection().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
samlConnectionId |
String |
✔️ |
The ID of the SAML Connection |
GetSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
models/errors/ClerkErrors |
402, 403, 404 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Updates the SAML Connection whose ID matches the provided id
in the path.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBody;
import com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
UpdateSAMLConnectionResponse res = sdk.samlConnections().update()
.samlConnectionId("<id>")
.requestBody(UpdateSAMLConnectionRequestBody.builder()
.build())
.call();
if (res.schemasSAMLConnection().isPresent()) {
// handle response
}
}
}
UpdateSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
models/errors/ClerkErrors |
402, 403, 404, 422 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Deletes the SAML Connection whose ID matches the provided id
in the path.
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ClerkErrors, Exception {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
DeleteSAMLConnectionResponse res = sdk.samlConnections().delete()
.samlConnectionId("<id>")
.call();
if (res.deletedObject().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
samlConnectionId |
String |
✔️ |
The ID of the SAML Connection to delete |
DeleteSAMLConnectionResponse
Error Type |
Status Code |
Content Type |
models/errors/ClerkErrors |
402, 403, 404 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |