When disable_auth is true, a JWT ID token won't be generated and the
original "Authorization" HTTP header will be preserved. If the header is
used to carry the original token and is expected by the backend, this
field must be set to true to preserve the header.
The JWT audience is used when generating a JWT ID token for the backend.
This ID token will be added in the HTTP "authorization" header, and sent
to the backend.
[[["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\u003eThe \u003ccode\u003eBackendRule\u003c/code\u003e class provides configuration for individual API elements, managing settings like backend address, deadlines, and authentication.\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, ensuring comprehensive functionality.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBackendRule\u003c/code\u003e offers customizable properties like \u003ccode\u003eAddress\u003c/code\u003e, \u003ccode\u003eDeadline\u003c/code\u003e, \u003ccode\u003eDisableAuth\u003c/code\u003e, \u003ccode\u003eJwtAudience\u003c/code\u003e, \u003ccode\u003eProtocol\u003c/code\u003e, and \u003ccode\u003eSelector\u003c/code\u003e, for granular control over backend behavior.\u003c/p\u003e\n"],["\u003cp\u003eThe class supports defining different request protocols and backend addresses via \u003ccode\u003eOverridesByRequestProtocol\u003c/code\u003e, enabling flexible routing based on the incoming request.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBackendRule\u003c/code\u003e includes methods for cloning, equality checks, hash code generation, and serialization, as well as specific methods for field management, like \u003ccode\u003eClearAuthentication\u003c/code\u003e, and \u003ccode\u003eClearDisableAuth\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class BackendRule (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.BackendRule)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.BackendRule)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.BackendRule)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.BackendRule) \n\n public sealed class BackendRule : IMessage\u003cBackendRule\u003e, IEquatable\u003cBackendRule\u003e, IDeepCloneable\u003cBackendRule\u003e, IBufferMessage, IMessage\n\nA backend rule provides configuration for an individual API element. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BackendRule \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BackendRule](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.BackendRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BackendRule](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.BackendRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BackendRule](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.BackendRule), [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### BackendRule()\n\n public BackendRule()\n\n### BackendRule(BackendRule)\n\n public BackendRule(BackendRule other)\n\nFields\n------\n\n### AddressFieldNumber\n\n public const int AddressFieldNumber = 2\n\nField number for the \"address\" field.\n\n### DeadlineFieldNumber\n\n public const int DeadlineFieldNumber = 3\n\nField number for the \"deadline\" field.\n\n### DisableAuthFieldNumber\n\n public const int DisableAuthFieldNumber = 8\n\nField number for the \"disable_auth\" field.\n\n### JwtAudienceFieldNumber\n\n public const int JwtAudienceFieldNumber = 7\n\nField number for the \"jwt_audience\" field.\n\n### MinDeadlineFieldNumber\n\n public const int MinDeadlineFieldNumber = 4\n\nField number for the \"min_deadline\" field.\n\n### OperationDeadlineFieldNumber\n\n public const int OperationDeadlineFieldNumber = 5\n\nField number for the \"operation_deadline\" field.\n\n### OverridesByRequestProtocolFieldNumber\n\n public const int OverridesByRequestProtocolFieldNumber = 10\n\nField number for the \"overrides_by_request_protocol\" field.\n\n### PathTranslationFieldNumber\n\n public const int PathTranslationFieldNumber = 6\n\nField number for the \"path_translation\" field.\n\n### ProtocolFieldNumber\n\n public const int ProtocolFieldNumber = 9\n\nField number for the \"protocol\" field.\n\n### SelectorFieldNumber\n\n public const int SelectorFieldNumber = 1\n\nField number for the \"selector\" field.\n\nProperties\n----------\n\n### Address\n\n public string Address { get; set; }\n\nThe address of the API backend.\n\nThe scheme is used to determine the backend protocol and security.\nThe following schemes are accepted:\n\nSCHEME PROTOCOL SECURITY\nhttp:// HTTP None\nhttps:// HTTP TLS\ngrpc:// gRPC None\ngrpcs:// gRPC TLS\n\nIt is recommended to explicitly include a scheme. Leaving out the scheme\nmay cause constrasting behaviors across platforms.\n\nIf the port is unspecified, the default is:\n\n- 80 for schemes without TLS\n- 443 for schemes with TLS\n\nFor HTTP backends, use \\[protocol\\]\\[google.api.BackendRule.protocol\\]\nto specify the protocol version.\n\n### AuthenticationCase\n\n public BackendRule.AuthenticationOneofCase AuthenticationCase { get; }\n\n### Deadline\n\n public double Deadline { get; set; }\n\nThe number of seconds to wait for a response from a request. The default\nvaries based on the request protocol and deployment environment.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### DisableAuth\n\n public bool DisableAuth { get; set; }\n\nWhen disable_auth is true, a JWT ID token won't be generated and the\noriginal \"Authorization\" HTTP header will be preserved. If the header is\nused to carry the original token and is expected by the backend, this\nfield must be set to true to preserve the header.\n\n### HasDisableAuth\n\n public bool HasDisableAuth { get; }\n\nGets whether the \"disable_auth\" field is set\n\n### HasJwtAudience\n\n public bool HasJwtAudience { get; }\n\nGets whether the \"jwt_audience\" field is set\n\n### JwtAudience\n\n public string JwtAudience { get; set; }\n\nThe JWT audience is used when generating a JWT ID token for the backend.\nThis ID token will be added in the HTTP \"authorization\" header, and sent\nto the backend.\n\n### MinDeadline\n\n [Obsolete]\n public double MinDeadline { get; set; }\n\nDeprecated, do not use.\n\n### OperationDeadline\n\n public double OperationDeadline { get; set; }\n\nThe number of seconds to wait for the completion of a long running\noperation. The default is no deadline.\n\n### OverridesByRequestProtocol\n\n public MapField\u003cstring, BackendRule\u003e OverridesByRequestProtocol { get; }\n\nThe map between request protocol and the backend address.\n\n### Parser\n\n public static MessageParser\u003cBackendRule\u003e Parser { get; }\n\n### PathTranslation\n\n public BackendRule.Types.PathTranslation PathTranslation { get; set; }\n\n### Protocol\n\n public string Protocol { get; set; }\n\nThe protocol used for sending a request to the backend.\nThe supported values are \"http/1.1\" and \"h2\".\n\nThe default value is inferred from the scheme in the\n\\[address\\]\\[google.api.BackendRule.address\\] field:\n\nSCHEME PROTOCOL\nhttp:// http/1.1\nhttps:// http/1.1\ngrpc:// h2\ngrpcs:// h2\n\nFor secure HTTP backends (https://) that support HTTP/2, set this field\nto \"h2\" for improved performance.\n\nConfiguring this field to non-default values is only supported for secure\nHTTP backends. This field will be ignored for all other backends.\n\nSee\n\u003chttps://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids\u003e\nfor more details on the supported values.\n\n### Selector\n\n public string Selector { get; set; }\n\nSelects the methods to which this rule applies.\n\nRefer to \\[selector\\]\\[google.api.DocumentationRule.selector\\] for syntax\ndetails.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### ClearAuthentication()\n\n public void ClearAuthentication()\n\n### ClearDisableAuth()\n\n public void ClearDisableAuth()\n\nClears the value of the oneof if it's currently set to \"disable_auth\"\n\n### ClearJwtAudience()\n\n public void ClearJwtAudience()\n\nClears the value of the oneof if it's currently set to \"jwt_audience\"\n\n### Clone()\n\n public BackendRule Clone()\n\n### Equals(BackendRule)\n\n public bool Equals(BackendRule 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(BackendRule)\n\n public void MergeFrom(BackendRule 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)"]]