> ## Documentation Index
> Fetch the complete documentation index at: https://klef.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TokenSource

> Tokens read from a function.

```csharp
public sealed class TokenSource : ITokenStore
```

**Implements:** `ITokenStore`

## Constructors

```csharp
public TokenSource(Func<CancellationToken, ValueTask<string>> read)
```

Tokens read from a function.

### Parameters

**read** `Func\<CancellationToken, ValueTask\<string\>\>` *required*

## Methods

### AccessTokenAsync()

```csharp
public ValueTask<string> AccessTokenAsync(CancellationToken cancellationToken)
```

Gets the current access token.

#### Parameters

**cancellationToken** `CancellationToken` *required*

#### Returns

`ValueTask<string>`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.