# IGoogleWorkspaceTokenStore

Persistence boundary for OAuth refresh tokens and related authorization state. Implementations are responsible for encrypting sensitive values at rest.

Interface 

`OfficeIMO.GoogleWorkspace.Auth.GoogleApis`

**Namespace**

`OfficeIMO.GoogleWorkspace.Auth.GoogleApis`

**Assembly**

`OfficeIMO.GoogleWorkspace.Auth.GoogleApis`

**Source revision**

`105ae88c45f6` with working tree changes

**Source**

[GoogleWorkspaceTokenStore.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.GoogleWorkspace.Auth.GoogleApis/GoogleWorkspaceTokenStore.cs#L8)

**Modifiers**

abstract

Persistence boundary for OAuth refresh tokens and related authorization state. Implementations are responsible for encrypting sensitive values at rest.

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Authenticate to Google Workspace](/docs/google-workspace/authentication/) Guide
  
  Create a GoogleWorkspaceSession in .NET from a service account, a short-lived access token, or existing Google APIs credentials.

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Property [GoogleInstalledApplicationAuthorizationOptions.TokenStore](/api/google-workspace-auth/officeimo-googleworkspace-auth-googleapis-googleinstalledapplicationauthorizationoptions/#property-tokenstore)

### Accepted by parameters 1

- Constructor [GoogleApisDataStoreAdapter.GoogleApisDataStoreAdapter](/api/google-workspace-auth/officeimo-googleworkspace-auth-googleapis-googleapisdatastoreadapter/#constructor-ctor-officeimo-googleworkspace-auth-googleapis-igoogleworkspacetokenstore) parameter `store`

Filter members 

Show inherited

## Methods

`public abstract Task ClearAsync()` [#](#method-clearasync)

Deletes all authorization state owned by this store.

Returns

`Task`

`public abstract Task DeleteAsync<T>(string key)` [#](#method-deleteasync-string)

Deletes authorization state of the requested type under a key.

Type Parameters

**T**

Parameters

**key string required**

Returns

`Task`

`public abstract Task<T?> GetAsync<T>(string key)` [#](#method-getasync-string)

Reads authorization state, returning null when the key is absent.

Type Parameters

**T**

Parameters

**key string required**

Returns

`Task<T?>`

`public abstract Task StoreAsync<T>(string key, T? value)` [#](#method-storeasync-string)

Stores or replaces authorization state under a key.

Type Parameters

**T**

Parameters

**key string required**

**value T? required**

Returns

`Task`

<!-- PowerForge markdown artifact sha256:F973A6A7AA4781F765608A005977E30079DF84910F0891429F76C1571E791A18 -->
