<PackageReference Include="Azure.Core" Version="1.47.2" />

AccessToken

public struct AccessToken
Represents an Azure service bearer access token with expiry information.
public DateTimeOffset ExpiresOn { get; }

Gets the time when the provided token expires.

public DateTimeOffset? RefreshOn { get; }

Gets the time when the token should be refreshed.

public string Token { get; }

Get the access token value.

public string TokenType { get; }

Identifies the type of access token.

public AccessToken(string accessToken, DateTimeOffset expiresOn)

Creates a new instance of AccessToken using the provided accessToken and expiresOn.

public AccessToken(string accessToken, DateTimeOffset expiresOn, DateTimeOffset? refreshOn)

Creates a new instance of AccessToken using the provided accessToken and expiresOn.

public AccessToken(string accessToken, DateTimeOffset expiresOn, DateTimeOffset? refreshOn, string tokenType)

Creates a new instance of AccessToken using the provided accessToken and expiresOn.