# GoogleWorkspaceAccessToken

Represents an acquired Google OAuth access token.

Class 

`OfficeIMO.GoogleWorkspace`

**Namespace**

`OfficeIMO.GoogleWorkspace`

**Assembly**

`OfficeIMO.GoogleWorkspace`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[GoogleWorkspaceTypes.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L58)

**Modifiers**

sealed

Represents an acquired Google OAuth access token.

## Inheritance

- object
- GoogleWorkspaceAccessToken

## 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 7 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 6

- Method [DelegateGoogleWorkspaceCredentialSource.AcquireAccessTokenAsync](/api/google-workspace/officeimo-googleworkspace-delegategoogleworkspacecredentialsource/#method-acquireaccesstokenasync-collections-generic-ienumerable-system-string-threading-cancellationtoken)
- Method [GoogleServiceAccountCredentialSource.AcquireAccessTokenAsync](/api/google-workspace/officeimo-googleworkspace-googleserviceaccountcredentialsource/#method-acquireaccesstokenasync-collections-generic-ienumerable-system-string-threading-cancellationtoken)
- Method [GoogleWorkspaceAccessToken.FromVerifiedCredential](/api/google-workspace/officeimo-googleworkspace-googleworkspaceaccesstoken/#method-fromverifiedcredential-string-datetimeoffset-officeimo-googleworkspace-googleworkspacecredentialbinding)
- Method [GoogleWorkspaceSession.AcquireAccessTokenAsync](/api/google-workspace/officeimo-googleworkspace-googleworkspacesession/#method-acquireaccesstokenasync-collections-generic-ienumerable-system-string-threading-cancellationtoken)
- Method [IGoogleWorkspaceCredentialSource.AcquireAccessTokenAsync](/api/google-workspace/officeimo-googleworkspace-igoogleworkspacecredentialsource/#method-acquireaccesstokenasync-collections-generic-ienumerable-system-string-threading-cancellationtoken)
- Method [StaticAccessTokenCredentialSource.AcquireAccessTokenAsync](/api/google-workspace/officeimo-googleworkspace-staticaccesstokencredentialsource/#method-acquireaccesstokenasync-collections-generic-ienumerable-system-string-threading-cancellationtoken)

### Accepted by parameters 1

- Constructor [DelegateGoogleWorkspaceCredentialSource.DelegateGoogleWorkspaceCredentialSource](/api/google-workspace/officeimo-googleworkspace-delegategoogleworkspacecredentialsource/#constructor-ctor-func-system-collections-generic-ireadonlylist-system-string-system-threading-cancellationtoken-system-threading-tasks-task-officeimo-googleworkspace-googleworkspaceaccesstoken) parameter `acquireAccessToken`

Filter members 

Show inherited

## Constructors

GoogleWorkspaceAccessToken 2 overloads

`public GoogleWorkspaceAccessToken(string accessToken, DateTimeOffset expiresAt, IReadOnlyList<string>? scopes = null)` [#](#constructor-ctor-string-datetimeoffset-collections-generic-ireadonlylist-system-string)

[GoogleWorkspaceTypes.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L58)

Creates a token without verified account or grant evidence.

Parameters

**accessToken string required**

**expiresAt System.DateTimeOffset required**

**scopes System.Collections.Generic.IReadOnlyList<string>? = null optional**

`public GoogleWorkspaceAccessToken(string accessToken, DateTimeOffset expiresAt, IReadOnlyList<string>? scopes, string? account)` [#](#constructor-ctor-string-datetimeoffset-collections-generic-ireadonlylist-system-string-string)

[GoogleWorkspaceTypes.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L69)

Creates a token with an informational account label. The label is not credential evidence and does not make the token eligible for guarded mutations.

Parameters

**accessToken string required**

**expiresAt System.DateTimeOffset required**

**scopes System.Collections.Generic.IReadOnlyList<string>? required**

**account string? required**

## Methods

`public static GoogleWorkspaceAccessToken FromVerifiedCredential(string accessToken, DateTimeOffset expiresAt, GoogleWorkspaceCredentialBinding credentialBinding)` [#](#method-fromverifiedcredential-string-datetimeoffset-officeimo-googleworkspace-googleworkspacecredentialbinding)

[GoogleWorkspaceTypes.cs:94](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L94)

Creates a token bound to provider-verified account and scope evidence.

Parameters

**accessToken string required**

**expiresAt System.DateTimeOffset required**

**credentialBinding OfficeIMO.GoogleWorkspace.GoogleWorkspaceCredentialBinding required**

Returns

`GoogleWorkspaceAccessToken`

`public bool IsExpired(DateTimeOffset now)` [#](#method-isexpired-datetimeoffset)

[GoogleWorkspaceTypes.cs:112](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L112)

Determines whether the token has expired at the supplied instant.

Parameters

**now System.DateTimeOffset required**

Instant to compare with [GoogleWorkspaceAccessToken.ExpiresAt](/api/google-workspace/officeimo-googleworkspace-googleworkspaceaccesstoken/).

Returns

`bool` true when now is at or after the expiry instant.

## 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?`

## Properties

`public string AccessToken { get; }` [#](#property-accesstoken)

[GoogleWorkspaceTypes.cs:100](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L100)

Gets the OAuth bearer token.

`public DateTimeOffset ExpiresAt { get; }` [#](#property-expiresat)

[GoogleWorkspaceTypes.cs:102](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L102)

Gets the instant after which the token must not be used.

`public IReadOnlyList<string> Scopes { get; }` [#](#property-scopes)

[GoogleWorkspaceTypes.cs:104](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L104)

Gets the normalized OAuth scopes bound to the token by its source.

`public string? Account { get; }` [#](#property-account)

[GoogleWorkspaceTypes.cs:106](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L106)

Gets the credential-source account label, when supplied. Use [GoogleWorkspaceAccessToken.CredentialBinding](/api/google-workspace/officeimo-googleworkspace-googleworkspaceaccesstoken/) for verified evidence.

`public GoogleWorkspaceCredentialBinding? CredentialBinding { get; }` [#](#property-credentialbinding)

[GoogleWorkspaceTypes.cs:108](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace/GoogleWorkspaceTypes.cs#L108)

Gets provider-verified account and scope evidence, when supplied by the credential source.

<!-- PowerForge markdown artifact sha256:734A11909EC4798838088A966B52532831046B7BA7B5839013E9BB3E024C63EA -->
