Skip to content

Latest commit

 

History

History
193 lines (126 loc) · 8.39 KB

README.md

File metadata and controls

193 lines (126 loc) · 8.39 KB

JwtTemplates

(JwtTemplates)

Overview

Available Operations

  • List - List all templates
  • Create - Create a JWT template
  • Get - Retrieve a template
  • Update - Update a JWT template
  • Delete - Delete a Template

List

List all templates

Example Usage

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

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

var res = await sdk.JwtTemplates.ListAsync();

// handle response

Response

ListJWTTemplatesResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Create

Create a new JWT template

Example Usage

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

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

CreateJWTTemplateRequestBody req = new CreateJWTTemplateRequestBody() {
    Name = "Example Template",
    Claims = new Models.Operations.Claims() {},
    Lifetime = 3600D,
    AllowedClockSkew = 5D,
    CustomSigningKey = false,
    SigningAlgorithm = "RS256",
    SigningKey = "PRIVATE_KEY_PLACEHOLDER",
};

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

// handle response

Parameters

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

Response

CreateJWTTemplateResponse

Errors

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

Get

Retrieve the details of a given JWT template

Example Usage

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

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

var res = await sdk.JwtTemplates.GetAsync(templateId: "template_123");

// handle response

Parameters

Parameter Type Required Description Example
TemplateId string ✔️ JWT Template ID template_123

Response

GetJWTTemplateResponse

Errors

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

Update

Updates an existing JWT template

Example Usage

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

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

var res = await sdk.JwtTemplates.UpdateAsync(
    templateId: "<id>",
    requestBody: new UpdateJWTTemplateRequestBody() {}
);

// handle response

Parameters

Parameter Type Required Description
TemplateId string ✔️ The ID of the JWT template to update
RequestBody UpdateJWTTemplateRequestBody ✔️ N/A

Response

UpdateJWTTemplateResponse

Errors

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

Delete

Delete a Template

Example Usage

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

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

var res = await sdk.JwtTemplates.DeleteAsync(templateId: "<id>");

// handle response

Parameters

Parameter Type Required Description
TemplateId string ✔️ JWT Template ID

Response

DeleteJWTTemplateResponse

Errors

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