Overview of Grpc.Auth
masterGrpc.Auth is a gRPC authentication library for C#/.NET. It is built upon the Google.Apis.Auth library to provide authentication capabilities within gRPC services.repository·master·Indexed 26 days ago
https://github.com/grpc/grpc-dotnetA high-performance, modern RPC framework for .NET Core 3.0+ and the recommended implementation for C# developers. It provides seamless integration with ASP.NET Core and HttpClient through core packages including Grpc.AspNetCore, Grpc.Net.Client, and Grpc.Net.ClientFactory. The framework supports gRPC-Web for browser clients, health checking via Grpc.AspNetCore.HealthChecks, and authentication through Grpc.Auth.
Grpc.Auth is a gRPC authentication library for C#/.NET. It is built upon the Google.Apis.Auth library to provide authentication capabilities within gRPC services.gRPC for .NET provides high-performance RPC functionality for .NET Core 3.0 or later. The implementation is divided into three primary packages:
HttpClient and utilizes HTTP/2 functionality.HttpClientFactory, allowing gRPC clients to be centrally configured and injected via Dependency Injection.Grpc.HealthCheck provides the reference implementation for the gRPC health check service. This allows you to implement a standard health check service that can be queried by external monitoring tools or load balancers to determine the status of your gRPC service.Grpc.Reflection provides the reference implementation of the gRPC reflection service. This service allows clients to query a gRPC server for information about the services it hosts, including method names, request/response types, and service definitions. This is commonly used by tools like grpcui, grpcurl, or Postman to discover server capabilities dynamically.The gRPC implementation for ASP.NET Core is provided through managed packages designed to work seamlessly as both client and server. The core components include:
Grpc.Tools (for code generation) and Google.Protobuf (for the default message protocol).Grpc.Core to allow for a managed server implementation without native dependencies.Note that package names are prefixed with Grpc.AspNetCore/ or Grpc.NetCore to distinguish them from native clients and servers.
protobuf-net.Grpc external library. This allows you to define Protobuf contracts directly in C# code rather than using .proto files.Grpc.AspNetCore.HealthChecks to bridge standard ASP.NET Core Health Checks with the gRPC Health Checking Protocol. This allows you to expose your application's health status via a gRPC service, making it compatible with the Grpc.HealthCheck package and standard gRPC health monitoring tools.Grpc.Core.Api is a shared API package designed to provide a common interface for both the gRPC C# (legacy) and gRPC for .NET implementations. It ensures a level of consistency across different C# gRPC implementations.The grpc-dotnet packages follow a specific versioning scheme to maintain compatibility with the broader gRPC ecosystem:
Grpc.Core or ASP.NET Core dependencies.Grpc.Core release schedule.Affected Packages:
Grpc.AspNetCoreGrpc.AspNetCore.ServerGrpc.AspNetCore.Server.ClientFactoryGrpc.Net.ClientGrpc.Net.ClientFactoryGrpc.Net.Commondotnet-grpcIf you do not want to enable gRPC-Web globally, you can enable it for individual gRPC services using the EnableGrpcWeb() extension method on the service mapping.
app.MapGrpcService<GreeterService>().EnableGrpcWeb();To run the automated interop tests, follow these steps:
InteropTestsWebsite container.InteropTestsGrpcWebWebsite container.testassets/InteropTestsGrpcWebWebsite/Tests directory and execute npm test.npm testYou can integrate grpc-dotnet with HttpClientFactory using the Grpc.Net.ClientFactory NuGet package. This provides:
Grpc.AspNetCore hosted service.