Class StringTokenProvider
A simple token provider that always provides a static access token.
Implements
Inherited Members
Namespace: k8s.Authentication
Assembly: KubernetesClient.dll
Syntax
public sealed class StringTokenProvider : ITokenProvider
Constructors
View SourceStringTokenProvider(string, string)
Initializes a new instance of the StringTokenProvider class. Create a token provider for the given token type that returns the given access token.
Declaration
public StringTokenProvider(string accessToken, string tokenType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | accessToken | The access token to return. |
| string | tokenType | The token type of the given access token. |
Properties
View SourceTokenType
Gets the token type of this access token.
Declaration
public string TokenType { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceGetAuthenticationHeaderAsync(CancellationToken)
Returns the static access token.
Declaration
public Task<AuthenticationHeaderValue> GetAuthenticationHeaderAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The cancellation token for this action. This will not be used since the returned token is static. |
Returns
| Type | Description |
|---|---|
| Task<AuthenticationHeaderValue> | The access token. |