Class
DelegateGoogleWorkspaceCredentialSource
OfficeIMO.GoogleWorkspace
Credential source that delegates token acquisition to application-provided code.
Inheritance
- object
- DelegateGoogleWorkspaceCredentialSource
Constructors
public DelegateGoogleWorkspaceCredentialSource(Func<IReadOnlyList<string>, CancellationToken, Task<GoogleWorkspaceAccessToken>> acquireAccessToken) #Creates a credential source backed by the supplied asynchronous token-acquisition delegate.
Parameters
- acquireAccessToken System.Func<System.Collections.Generic.IReadOnlyList<string>, System.Threading.CancellationToken, System.Threading.Tasks.Task<OfficeIMO.GoogleWorkspace.GoogleWorkspaceAccessToken>>
- Delegate that receives the requested scopes materialized in enumeration order and the cancellation token.
Exceptions
ArgumentNullException– acquireAccessToken is null.
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.