public sealed class AuthRequirement : IMessage<AuthRequirement>, IEquatable<AuthRequirement>, IDeepCloneable<AuthRequirement>, IBufferMessage, IMessage
User-defined authentication requirements, including support for
JSON Web Token
(JWT).
NOTE: This will be deprecated soon, once AuthProvider.audiences is
implemented and accepted in all the runtime components.
The list of JWT
audiences.
that are allowed to access. A JWT containing any of these audiences will
be accepted. When this setting is absent, only JWTs with audience
"https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]"
will be accepted. For example, if no audiences are in the setting,
LibraryService API will only accept JWTs with the following audience
"https://library-example.googleapis.com/google.example.library.v1.LibraryService".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003e\u003ccode\u003eAuthRequirement\u003c/code\u003e is a class that defines user-defined authentication requirements, including support for JSON Web Tokens (JWT).\u003c/p\u003e\n"],["\u003cp\u003eThis class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, indicating its role in message handling and object management.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of \u003ccode\u003eAuthRequirement\u003c/code\u003e include \u003ccode\u003eAudiences\u003c/code\u003e, which lists the allowed JWT audiences, and \u003ccode\u003eProviderId\u003c/code\u003e, which identifies the authentication provider.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods for calculating message size (\u003ccode\u003eCalculateSize\u003c/code\u003e), deep cloning (\u003ccode\u003eClone\u003c/code\u003e), equality checking (\u003ccode\u003eEquals\u003c/code\u003e), merging data (\u003ccode\u003eMergeFrom\u003c/code\u003e), and serialization/deserialization (\u003ccode\u003eWriteTo\u003c/code\u003e, \u003ccode\u003eMergeFrom\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe class contains fields such as \u003ccode\u003eAudiencesFieldNumber\u003c/code\u003e and \u003ccode\u003eProviderIdFieldNumber\u003c/code\u003e to indicate their respective field number.\u003c/p\u003e\n"]]],[],null,["# Class AuthRequirement (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.AuthRequirement)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.AuthRequirement)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.AuthRequirement)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.AuthRequirement) \n\n public sealed class AuthRequirement : IMessage\u003cAuthRequirement\u003e, IEquatable\u003cAuthRequirement\u003e, IDeepCloneable\u003cAuthRequirement\u003e, IBufferMessage, IMessage\n\nUser-defined authentication requirements, including support for\n[JSON Web Token\n(JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AuthRequirement \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AuthRequirement](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.AuthRequirement), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AuthRequirement](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.AuthRequirement), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AuthRequirement](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.AuthRequirement), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Api](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### AuthRequirement()\n\n public AuthRequirement()\n\n### AuthRequirement(AuthRequirement)\n\n public AuthRequirement(AuthRequirement other)\n\nFields\n------\n\n### AudiencesFieldNumber\n\n public const int AudiencesFieldNumber = 2\n\nField number for the \"audiences\" field.\n\n### ProviderIdFieldNumber\n\n public const int ProviderIdFieldNumber = 1\n\nField number for the \"provider_id\" field.\n\nProperties\n----------\n\n### Audiences\n\n public string Audiences { get; set; }\n\nNOTE: This will be deprecated soon, once AuthProvider.audiences is\nimplemented and accepted in all the runtime components.\n\nThe list of JWT\n[audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).\nthat are allowed to access. A JWT containing any of these audiences will\nbe accepted. When this setting is absent, only JWTs with audience\n\"https://\\[Service_name\\]\\[google.api.Service.name\\]/\\[API_name\\]\\[google.protobuf.Api.name\\]\"\nwill be accepted. For example, if no audiences are in the setting,\nLibraryService API will only accept JWTs with the following audience\n\"\u003chttps://library-example.googleapis.com/google.example.library.v1.LibraryService\u003e\".\n\nExample: \n\n audiences: bookstore_android.apps.googleusercontent.com,\n bookstore_web.apps.googleusercontent.com\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Parser\n\n public static MessageParser\u003cAuthRequirement\u003e Parser { get; }\n\n### ProviderId\n\n public string ProviderId { get; set; }\n\n\\[id\\]\\[google.api.AuthProvider.id\\] from authentication provider.\n\nExample: \n\n provider_id: bookstore_auth\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public AuthRequirement Clone()\n\n### Equals(AuthRequirement)\n\n public bool Equals(AuthRequirement other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(AuthRequirement)\n\n public void MergeFrom(AuthRequirement other)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]