# DelegateGoogleWorkspaceCredentialSource

Credential source that delegates token acquisition to application-provided code.

Class 

`OfficeIMO.GoogleWorkspace`

**Namespace**

`OfficeIMO.GoogleWorkspace`

**Assembly**

`OfficeIMO.GoogleWorkspace`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[GoogleWorkspaceCredentialSources.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceCredentialSources.cs#L51)

**Implements**

`IGoogleWorkspaceCredentialSource`

**Modifiers**

sealed

Credential source that delegates token acquisition to application-provided code.

## Inheritance

- object
- DelegateGoogleWorkspaceCredentialSource

Filter members 

Show inherited

## Constructors

`public DelegateGoogleWorkspaceCredentialSource(Func<IReadOnlyList<string>, CancellationToken, Task<GoogleWorkspaceAccessToken>> acquireAccessToken)` [#](#constructor-ctor-func-system-collections-generic-ireadonlylist-system-string-system-threading-cancellationtoken-system-threading-tasks-task-officeimo-googleworkspace-googleworkspaceaccesstoken)

[GoogleWorkspaceCredentialSources.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceCredentialSources.cs#L51)

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>> required**

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)` [#](#method-acquireaccesstokenasync-collections-generic-ienumerable-system-string-threading-cancellationtoken)

[GoogleWorkspaceCredentialSources.cs:60](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceCredentialSources.cs#L60)

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.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:34638F3DBFF62286E6F99DEACB9C9C7B1D08DCAA074A7403C73B19E4BB4158C2 -->
