Class StaticTokenProvider
Wraps a pre-fetched JWT string. Intended for testing and controlled automation only — not for tokens obtained interactively or from untrusted sources. IsAvailable always returns true; no token validation is performed.
public sealed class StaticTokenProvider : IOidcTokenProvider
- Inheritance
-
StaticTokenProvider
- Implements
- Inherited Members
Constructors
StaticTokenProvider(string)
Creates a provider that returns token on every call.
public StaticTokenProvider(string token)
Parameters
tokenstring
Properties
IsAvailable
Whether this provider can supply a token in the current environment.
public bool IsAvailable { get; }
Property Value
Methods
GetTokenAsync(string, CancellationToken)
Returns an OIDC token for the specified audience.
public Task<string> GetTokenAsync(string audience, CancellationToken cancellationToken)
Parameters
audiencestringOIDC audience (e.g. "sigstore").
cancellationTokenCancellationTokenCancellation token.