Table of Contents

Method Bearer

Namespace
Neo4j.Driver
Assembly
Neo4j.Driver.dll

Bearer(Func<ValueTask<AuthTokenAndExpiration>>)

An implementation of IAuthTokenManager that will call the provided async function whenever a token is needed. It will cache the token and will only call the function when a new token is needed or the existing cached token has expired.

public static IAuthTokenManager Bearer(Func<ValueTask<AuthTokenAndExpiration>> tokenProviderAsync)

Parameters

tokenProviderAsync Func<ValueTask<AuthTokenAndExpiration>>

A function that will be called when a new token is needed.

Returns

IAuthTokenManager

The IAuthTokenManager that will call the provided function when a new token is needed.