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
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
CreatedDate
The time when the token was created.
public DateTime CreatedDate { get; set; }
Property Value
Description
The description of the token. Made by the user.
public string Description { get; set; }
Property Value
DeviceId
The id of the device that the token was requested from.
public string DeviceId { get; set; }
Property Value
ExpiryDate
The time when the token will expire.
public DateTime? ExpiryDate { get; set; }
Property Value
Id
The id of the token. This is the autogenerated identity of the underlying data store.
public int Id { get; set; }
Property Value
Name
The name of the token
public string Name { get; set; }
Property Value
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
TokenHash
The hashed token value.
public string TokenHash { get; set; }
Property Value
TokenType
The type of the token (API key or OAuth client).
public TokenType TokenType { get; set; }
Property Value
UserId
The id of the User that the token belongs to.
public int UserId { get; set; }
Property Value
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()