Table of Contents

Interface IHeadlessTokenManager

Namespace
CMS.Headless
Assembly
CMS.Headless.dll

Provides management methods for handling HeadlessTokenInfo.

public interface IHeadlessTokenManager
Extension Methods

Methods

AssignToken(HeadlessTokenInfo, CancellationToken)

Creates, assigns and returns api key to the headless token.

Task<string> AssignToken(HeadlessTokenInfo info, CancellationToken cancellationToken = default)

Parameters

info HeadlessTokenInfo

Headless token info to be updated.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<string>

Token value.

Create(CreateHeadlessTokenParameters)

Creates a new HeadlessTokenInfo.

int Create(CreateHeadlessTokenParameters itemParameters)

Parameters

itemParameters CreateHeadlessTokenParameters

Returns

int

ID of the newly created info.

Delete(int, CancellationToken)

Deletes a Headless token.

Task Delete(int tokenId, CancellationToken cancellationToken = default)

Parameters

tokenId int

Id of the token to be deleted.

cancellationToken CancellationToken

Cancellation token.

Returns

Task

Get(int, CancellationToken)

Gets the HeadlessTokenInfo by ID.

Task<HeadlessTokenInfo> Get(int tokenId, CancellationToken cancellationToken = default)

Parameters

tokenId int

Id of the token to be retrieved.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<HeadlessTokenInfo>

InitializeInfoObject(HeadlessTokenInfo, CreateHeadlessTokenParameters)

Initializes the HeadlessTokenInfo object.

bool InitializeInfoObject(HeadlessTokenInfo info, CreateHeadlessTokenParameters tokenParameters)

Parameters

info HeadlessTokenInfo

Partial HeadlessTokenInfo.

tokenParameters CreateHeadlessTokenParameters

Token parameter.

Returns

bool

True on success.

Update(HeadlessTokenInfo, CancellationToken)

Updates the HeadlessTokenInfo.

Task Update(HeadlessTokenInfo updatedInfo, CancellationToken cancellationToken = default)

Parameters

updatedInfo HeadlessTokenInfo

Headless token info to be updated.

cancellationToken CancellationToken

Cancellation token.

Returns

Task