[Example Request] gRPC authorization with IdentityServer4 (and roles)
See original GitHub issueFor my Blazor (3.2.0) WASM project (.NET 5.0 Preview latest) I’m now using IdentityServer4 (default Visual Studio Template) and gRPC (EF Core/SQLite) data services.
I would like to protect the gRPC services against unauthorized access much like the Ticketer example with [Authorize]
on the service, and use it with IdentityServer4 roles [Authorize (Roles=Administrator)]
See: Microsoft Docs, Secure an ASP.NET Core Blazor WebAssembly hosted app with Identity Server / Name and role claim with API authorization
Maybe it’s an idea to add an example to the samples gallery at https://github.com/grpc/grpc-dotnet/tree/master/examples
I tried to figure it out myself, but I’m stuck. I got the two (IdentityServer4 & Ticketer) working separately but I’m stuck combining gRPC authorization with IdentityServer4/Roles.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
@JeepNL I wrote a sample for GRPC+Auth that you can find here.
Its lacking roles, but you can add that piece following the docs if that helps you.
This is the main piece to enable roles on the GRPC service (I believe)
I got everything working now so if someone wants to close this issue …