Table of Contents

Interface IAuthenticationToken

Namespace
Excalibur.A3.Authentication
Assembly
Excalibur.A3.Abstractions.dll

Represents an authentication token containing identity and claims information.

public interface IAuthenticationToken

Properties

AuthenticationState

Gets the current authentication state of the token. Indicates whether the user is anonymous, authenticated, or fully identified.

AuthenticationState AuthenticationState { get; }

Property Value

AuthenticationState

The current authentication state of the token.

Claims

Gets the claims for this authentication token.

IEnumerable<Claim>? Claims { get; }

Property Value

IEnumerable<Claim>

The collection of claims, or null if no claims are available.

FirstName

Gets the first name of the authenticated user. Returns null if the user's identity is not available or not set.

string? FirstName { get; }

Property Value

string

The first name of the user, or null if not available.

FullName

Gets the full name of the authenticated user, constructed from FirstName and LastName. Returns an empty string if neither property is set.

string FullName { get; }

Property Value

string

The full name of the authenticated user, or an empty string if neither property is set.

Jwt

Gets or sets the raw JWT (JSON Web Token) string associated with the authentication token. This property can be null if the token has not been issued or is not applicable.

string? Jwt { get; set; }

Property Value

string

The raw JWT string, or null if not applicable.

LastName

Gets the last name of the authenticated user. Returns null if the user's identity is not available or not set.

string? LastName { get; }

Property Value

string

The last name of the user, or null if not available.

Login

Gets the login identifier (e.g., email address or username) of the authenticated user. Returns null if the user's login information is not available.

string? Login { get; }

Property Value

string

The login identifier, or null if not available.

UserId

Gets the unique user identifier (e.g., GUID or system-specific identifier) associated with the authentication token. Returns null if the user ID is not available or applicable.

string? UserId { get; }

Property Value

string

The unique user identifier, or null if not available.

Methods

IsAnonymous()

Determines whether the provided authentication token represents an anonymous user.

bool IsAnonymous()

Returns

bool

true if the token represents an anonymous user; otherwise, false .

IsAuthenticated()

Determines whether the provided authentication token represents an authenticated user.

bool IsAuthenticated()

Returns

bool

true if the token represents an authenticated user; otherwise, false .