Skip to content

Latest commit

 

History

History
86 lines (56 loc) · 4.18 KB

README.md

File metadata and controls

86 lines (56 loc) · 4.18 KB

SignInTokens

(SignInTokens)

Overview

Available Operations

  • Create - Create sign-in token
  • Revoke - Revoke the given sign-in token

Create

Creates a new sign-in token and associates it with the given user. By default, sign-in tokens expire in 30 days. You can optionally supply a different duration in seconds using the expires_in_seconds property.

Example Usage

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

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

CreateSignInTokenRequestBody req = new CreateSignInTokenRequestBody() {
    UserId = "user_12345",
    ExpiresInSeconds = 2592000,
};

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

// handle response

Parameters

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

Response

CreateSignInTokenResponse

Errors

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

Revoke

Revokes a pending sign-in token

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.SignInTokens.RevokeAsync(signInTokenId: "tok_test_1234567890");

// handle response

Parameters

Parameter Type Required Description Example
SignInTokenId string ✔️ The ID of the sign-in token to be revoked tok_test_1234567890

Response

RevokeSignInTokenResponse

Errors

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