Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

StaticAccessTokenCredentialSource

Namespace OfficeIMO.GoogleWorkspace
Assembly OfficeIMO.GoogleWorkspace
Source revision c8da0152c13d 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 System.String requiredposition: 0
expiresAt System.DateTimeOffset? = null optionalposition: 1
scopes System.Collections.Generic.IReadOnlyList<System.String>? = null optionalposition: 2
public StaticAccessTokenCredentialSource(String accessToken, DateTimeOffset? expiresAt, IReadOnlyList<String>? scopes, String? account) #

Creates an unverified static token source with an informational account label.

Parameters

accessToken System.String requiredposition: 0
expiresAt System.DateTimeOffset? requiredposition: 1
scopes System.Collections.Generic.IReadOnlyList<System.String>? requiredposition: 2
account System.String? requiredposition: 3

Methods

public Task<GoogleWorkspaceAccessToken> AcquireAccessTokenAsync(IEnumerable<String> scopes, CancellationToken cancellationToken = default) #
Returns: Task<GoogleWorkspaceAccessToken>

Acquires an access token and its available scope evidence for the requested operation.

Parameters

scopes System.Collections.Generic.IEnumerable<System.String> requiredposition: 0
OAuth scopes required by the pending operation.
cancellationToken System.Threading.CancellationToken = default optionalposition: 1
Token used to cancel acquisition.

Returns

A task that produces the acquired token and its scope and identity evidence. Callers must verify that the evidence covers their required scopes.