Securing gRPC Endpoints

Learn how to apply authorization requirements on individual gRPC endpoints.

There are multiple ways of applying requirements on individual gRPC endpoints, and we will examine some of them in this lesson. The following playground demonstrates how it can be done:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}
gRPC service with authorization rules applied on individual endpoints

Note: Because we have to build two ASP.NET Core applications and populate the IdP database with the initial seed data, the build process is expected to take at least a few minutes.

The playground consists of the following three applications:

  • DemoApp: It is a Razor Pages application that acts as a gRPC client.

  • SecondaryApiApp: It is a gRPC server ...