Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

StaticAccessTokenCredentialSource

OfficeIMO.GoogleWorkspace

Namespace
OfficeIMO.GoogleWorkspace
Assembly
OfficeIMO.GoogleWorkspace
Source revision
be6c300e4ab1 with working tree changes
Modifiers
sealed

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 required
expiresAt System.DateTimeOffset? = null optional
scopes System.Collections.Generic.IReadOnlyList<string>? = null optional
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 required
expiresAt System.DateTimeOffset? required
scopes System.Collections.Generic.IReadOnlyList<string>? required
account string? required

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> required
OAuth scopes required by the pending operation.
cancellationToken System.Threading.CancellationToken = default optional
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.