Factory/extension methods to create instances ofChannelCredentialsandCallCredentialsclasses
based on credential objects originating from Google auth library.
public static Task<ChannelCredentials> GetApplicationDefaultAsync()
Retrieves an instance of Google's Application Default Credentials usingGoogleCredential.GetApplicationDefaultAsync()and converts them
into a gRPCChannelCredentialsthat use the default SSL credentials.
[[["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-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eGoogleGrpcCredentials\u003c/code\u003e provides factory and extension methods for creating \u003ccode\u003eChannelCredentials\u003c/code\u003e and \u003ccode\u003eCallCredentials\u003c/code\u003e from Google auth library credential objects.\u003c/p\u003e\n"],["\u003cp\u003eYou can create \u003ccode\u003eCallCredentials\u003c/code\u003e using the \u003ccode\u003eFromAccessToken\u003c/code\u003e method, which authenticates with a gRPC service using a provided OAuth2 access token.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGetApplicationDefaultAsync\u003c/code\u003e method retrieves Google's Application Default Credentials and converts them into \u003ccode\u003eChannelCredentials\u003c/code\u003e with default SSL settings.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eToCallCredentials\u003c/code\u003e and \u003ccode\u003eToChannelCredentials\u003c/code\u003e methods allow converting an \u003ccode\u003eITokenAccess\u003c/code\u003e object, such as \u003ccode\u003eGoogleCredential\u003c/code\u003e, into gRPC \u003ccode\u003eCallCredentials\u003c/code\u003e or \u003ccode\u003eChannelCredentials\u003c/code\u003e, respectively.\u003c/p\u003e\n"]]],[],null,["# Class GoogleGrpcCredentials (2.66.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.66.0 (latest)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Auth.GoogleGrpcCredentials)\n- [2.63.0](/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Auth.GoogleGrpcCredentials)\n- [2.48.0](/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Auth.GoogleGrpcCredentials) \n\n public static class GoogleGrpcCredentials\n\nFactory/extension methods to create instances of [ChannelCredentials](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials) and [CallCredentials](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallCredentials) classes\nbased on credential objects originating from Google auth library. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e GoogleGrpcCredentials \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Grpc.Auth](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Auth)\n\nAssembly\n--------\n\nGrpc.Auth.dll\n\nMethods\n-------\n\n### FromAccessToken(string)\n\n public static CallCredentials FromAccessToken(string accessToken)\n\nCreates an instance of [CallCredentials](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallCredentials) that will use given access token to authenticate\nwith a gRPC service.\n\n### GetApplicationDefaultAsync()\n\n public static Task\u003cChannelCredentials\u003e GetApplicationDefaultAsync()\n\nRetrieves an instance of Google's Application Default Credentials using\n`GoogleCredential.GetApplicationDefaultAsync()` and converts them\ninto a gRPC [ChannelCredentials](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials) that use the default SSL credentials.\n\n### ToCallCredentials(ITokenAccess)\n\n public static CallCredentials ToCallCredentials(this ITokenAccess credential)\n\nConverts a `ITokenAccess` (e.g. `GoogleCredential`) object\ninto a gRPC [CallCredentials](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallCredentials) object.\n\n### ToChannelCredentials(ITokenAccess)\n\n public static ChannelCredentials ToChannelCredentials(this ITokenAccess googleCredential)\n\nConverts a `ITokenAccess` (e.g. `GoogleCredential`) object\ninto a gRPC [ChannelCredentials](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials) object.\nDefault SSL credentials are used."]]