# Class GoogleAuthInterceptors (2.66.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.66.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Auth.GoogleAuthInterceptors)
- [2.63.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Auth.GoogleAuthInterceptors)
- [2.48.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Auth.GoogleAuthInterceptors)

    public static class GoogleAuthInterceptors

Factory methods to create authorization interceptors for Google credentials.
[GoogleGrpcCredentials](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Auth.GoogleGrpcCredentials)

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> GoogleAuthInterceptors

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Grpc.Auth](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Auth)

## Assembly

Grpc.Auth.dll

## Methods

### FromAccessToken(string)

    public static AsyncAuthInterceptor FromAccessToken(string accessToken)

Creates an [AsyncAuthInterceptor](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor) that will use given access token as authorization.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `accessToken` | `https://learn.microsoft.com/dotnet/api/system.string` OAuth2 access token. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor` | The interceptor. |

### FromCredential(ITokenAccess)

    public static AsyncAuthInterceptor FromCredential(ITokenAccess credential)

Creates an [AsyncAuthInterceptor](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor) that will obtain access token from any credential type that implements
`ITokenAccess`. (e.g. `GoogleCredential`).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `credential` | `https://github.com/googleapis/google-api-dotnet-client/blob/5b340dd01c2e6e971f7132c72015d4030eeb2257/Src/Support/Google.Apis.Auth/OAuth2/ITokenAccess.cs` The credential to use to obtain access tokens. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor` | The interceptor. |

### FromCredential(ITokenAccessWithHeaders)

    public static AsyncAuthInterceptor FromCredential(ITokenAccessWithHeaders credential)

Creates an [AsyncAuthInterceptor](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor) that will obtain access token and associated information
from any credential type that implements [ITokenAccessWithHeaders](https://github.com/googleapis/google-api-dotnet-client/blob/5b340dd01c2e6e971f7132c72015d4030eeb2257/Src/Support/Google.Apis.Auth/OAuth2/ITokenAccessWithHeaders.cs)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `credential` | `https://github.com/googleapis/google-api-dotnet-client/blob/5b340dd01c2e6e971f7132c72015d4030eeb2257/Src/Support/Google.Apis.Auth/OAuth2/ITokenAccessWithHeaders.cs` The credential to use to obtain access tokens. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor` | The interceptor. |