Table of Contents

Class Token

Namespace
Dynamicweb.Security.Tokens
Assembly
Dynamicweb.Core.dll

Class representing a token.

public class Token
Inheritance
Token
Inherited Members

Properties

ClientId

The OAuth client ID, stored in cleartext as it is used as a lookup key. Only populated for OAuthClient tokens.

public string ClientId { get; set; }

Property Value

string

ClientSecretHash

SHA512 hash of the OAuth client secret. The plaintext secret is never stored and is only returned at creation time. Only populated for OAuthClient tokens.

public string ClientSecretHash { get; set; }

Property Value

string

CreatedDate

The time when the token was created.

public DateTime CreatedDate { get; set; }

Property Value

DateTime

Description

The description of the token. Made by the user.

public string Description { get; set; }

Property Value

string

DeviceId

The id of the device that the token was requested from.

public string DeviceId { get; set; }

Property Value

string

ExpiryDate

The time when the token will expire.

public DateTime? ExpiryDate { get; set; }

Property Value

DateTime?

Id

The id of the token. This is the autogenerated identity of the underlying data store.

public int Id { get; set; }

Property Value

int

Name

The name of the token

public string Name { get; set; }

Property Value

string

PlaintextClientSecret

The plaintext client secret, populated only immediately after creation. This value is never persisted — it is null on all subsequent reads.

public string? PlaintextClientSecret { get; set; }

Property Value

string

TokenHash

The hashed token value.

public string TokenHash { get; set; }

Property Value

string

TokenType

The type of the token (API key or OAuth client).

public TokenType TokenType { get; set; }

Property Value

TokenType

UserId

The id of the User that the token belongs to.

public int UserId { get; set; }

Property Value

int

Methods

GetMaskedToken()

Gets a masked version of the token for display purposes. For example, if the token is "abcdef1234567890", it will return "abcde...890".

public string GetMaskedToken()

Returns

string
To top