2.17.0 (latest) 2.15.0 2.10.0 2.2.0

    public sealed class AuthProvider : IMessage<AuthProvider>, IEquatable<AuthProvider>, IDeepCloneable<AuthProvider>, IBufferMessage, IMessage

Configuration for an authentication provider, including support for
[JSON Web Token
(JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).

## Inheritance

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

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[AuthProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.AuthProvider.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AuthProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.AuthProvider.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[AuthProvider](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.AuthProvider.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## Inherited Members

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

## Namespace

[Google.Api](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.md.txt)

## Assembly

Google.Api.CommonProtos.dll

## Constructors

### AuthProvider()

    public AuthProvider()

### AuthProvider(AuthProvider)

    public AuthProvider(AuthProvider other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `AuthProvider` |

## Fields

### AudiencesFieldNumber

    public const int AudiencesFieldNumber = 4

Field number for the "audiences" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### AuthorizationUrlFieldNumber

    public const int AuthorizationUrlFieldNumber = 5

Field number for the "authorization_url" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### IdFieldNumber

    public const int IdFieldNumber = 1

Field number for the "id" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### IssuerFieldNumber

    public const int IssuerFieldNumber = 2

Field number for the "issuer" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### JwksUriFieldNumber

    public const int JwksUriFieldNumber = 3

Field number for the "jwks_uri" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### JwtLocationsFieldNumber

    public const int JwtLocationsFieldNumber = 6

Field number for the "jwt_locations" field.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

## Properties

### Audiences

    public string Audiences { get; set; }

The list of JWT
[audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
that are allowed to access. A JWT containing any of these audiences will
be accepted. When this setting is absent, JWTs with audiences:

- "https://\[service.name\]/\[google.protobuf.Api.name\]"
- "https://\[service.name\]/" will be accepted. For example, if no audiences are in the setting, LibraryService API will accept JWTs with the following audiences: - <https://library-example.googleapis.com/google.example.library.v1.LibraryService>
- <https://library-example.googleapis.com/>

Example:

    audiences: bookstore_android.apps.googleusercontent.com,
               bookstore_web.apps.googleusercontent.com

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### AuthorizationUrl

    public string AuthorizationUrl { get; set; }

Redirect URL if JWT token is required but not present or is expired.
Implement authorizationUrl of securityDefinitions in OpenAPI spec.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### Descriptor

    public static MessageDescriptor Descriptor { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `MessageDescriptor` |   |

### Id

    public string Id { get; set; }

The unique identifier of the auth provider. It will be referred to by
`AuthRequirement.provider_id`.

Example: "bookstore_auth".

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### Issuer

    public string Issuer { get; set; }

Identifies the principal that issued the JWT. See
<https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1>
Usually a URL or an email address.

Example: <https://securetoken.google.com>
Example: 1234567-compute@developer.gserviceaccount.com

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### JwksUri

    public string JwksUri { get; set; }

URL of the provider's public key set to validate signature of the JWT. See
[OpenID
Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
Optional if the key set document:

- can be retrieved from [OpenID
  Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) of the issuer.
- can be inferred from the email domain of the issuer (e.g. a Google service account).

Example: <https://www.googleapis.com/oauth2/v1/certs>

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### JwtLocations

    public RepeatedField<JwtLocation> JwtLocations { get; }

Defines the locations to extract the JWT. For now it is only used by the
Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations](https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations)

JWT locations can be one of HTTP headers, URL query parameters or
cookies. The rule is that the first match wins.

If not specified, default to use following 3 locations:
1) Authorization: Bearer
2) x-goog-iap-jwt-assertion
3) access_token query parameter

Default locations can be specified as followings:
jwt_locations:

- header: Authorization value_prefix: "Bearer "
- header: x-goog-iap-jwt-assertion
- query: access_token

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `RepeatedFieldJwtLocation` |   |

### Parser

    public static MessageParser<AuthProvider> Parser { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `MessageParserAuthProvider` |   |

## Methods

### CalculateSize()

    public int CalculateSize()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### Clone()

    public AuthProvider Clone()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AuthProvider` |   |

### Equals(AuthProvider)

    public bool Equals(AuthProvider other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `AuthProvider` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### Equals(object)

    public override bool Equals(object other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `object` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

**Overrides** [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))

### GetHashCode()

    public override int GetHashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

**Overrides** [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

### MergeFrom(AuthProvider)

    public void MergeFrom(AuthProvider other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `AuthProvider` |

### MergeFrom(CodedInputStream)

    public void MergeFrom(CodedInputStream input)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `input` | `CodedInputStream` |

### ToString()

    public override string ToString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

**Overrides** [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

### WriteTo(CodedOutputStream)

    public void WriteTo(CodedOutputStream output)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `output` | `CodedOutputStream` |