Class
StaticAccessTokenCredentialSource
OfficeIMO.GoogleWorkspace
Credential source that always returns the same already-acquired access token.
Inheritance
- object
- StaticAccessTokenCredentialSource
Constructors
StaticAccessTokenCredentialSource 2 overloads
public StaticAccessTokenCredentialSource(string accessToken, DateTimeOffset? expiresAt = null, IReadOnlyList<string>? scopes = null) #Creates an unverified static token source. This exact overload is retained for binary compatibility.
Parameters
- accessToken string
- expiresAt System.DateTimeOffset? = null
- scopes System.Collections.Generic.IReadOnlyList<string>? = null
public StaticAccessTokenCredentialSource(string accessToken, DateTimeOffset? expiresAt, IReadOnlyList<string>? scopes, string? account) #Creates an unverified static token source with an informational account label.
Parameters
- accessToken string
- expiresAt System.DateTimeOffset?
- scopes System.Collections.Generic.IReadOnlyList<string>?
- account string?
Methods
public Task<GoogleWorkspaceAccessToken> AcquireAccessTokenAsync(IEnumerable<string> scopes, CancellationToken cancellationToken = default) #Acquires an access token and its available scope evidence for the requested operation.
Parameters
- scopes System.Collections.Generic.IEnumerable<string>
- OAuth scopes required by the pending operation.
- cancellationToken System.Threading.CancellationToken = default
- Token used to cancel acquisition.
Returns
Task<GoogleWorkspaceAccessToken> A task that produces the acquired token and its scope and identity evidence. Callers must verify that the evidence covers their required scopes.