Henara.Grpc.Client.Common 1.2.0
Henara.Grpc.Client.Common
Shared base for the Henara gRPC client libraries (Henara.Grpc.Client.Dakota,
Henara.Grpc.Client.Imagelink, Henara.Grpc.Client.DakotaSlim). You normally consume one of those
domain clients rather than referencing this package directly — they bring it in transitively.
It provides:
GrpcClientBase— builds an authenticated, retryingGrpcChannelwhose per-callauthorizationheader is supplied by anICallTokenProvider; allows call credentials over plaintext (http/h2c) targets and disposes the channels it creates.KeycloakRefreshingTokenProvider— anICallTokenProviderfor native clients that does the interactive-login → refresh lifecycle. Seed it with the tokens from a Keycloak Authorization Code + PKCE login viaInitialize(...); it then refreshes the access token before expiry (rotating the refresh token) and throws when refresh fails (re-login required).AddNativeKeycloakAuth(...)— registers the provider above as the singletonICallTokenProvider.
Native auth wire-up
services.AddNativeKeycloakAuth(o =>
{
o.TokenEndpoint = "https://auth.praxx.me/realms/henara/protocol/openid-connect/token";
o.ClientId = "henara-main-sso";
});
services.AddDakotaExternalGrpcClients(); // or AddImageLinkDomainExternalGrpcClients()
// after the interactive login completes:
var auth = provider.GetRequiredService<KeycloakRefreshingTokenProvider>();
auth.Initialize(accessToken, refreshToken, expiresInSeconds);
AddNativeKeycloakAuth throws if an ICallTokenProvider is already registered — there must be exactly
one token authority. For a host that already owns a Keycloak session (e.g. SmartVO), do not use
this provider; use Henara.Grpc.Client.DakotaSlim instead, which adapts the host's existing token.
Supplying your own token provider
Any ICallTokenProvider works — register it before the domain clients to authenticate calls with a
token you already have (e.g. a web app's user token or a static server token):
services.AddScoped<ICallTokenProvider, MyTokenProvider>();
services.AddDakotaExternalGrpcClients();
Showing the top 20 packages that depend on Henara.Grpc.Client.Common.
| Packages | Downloads |
|---|---|
|
Henara.Grpc.Client.Dakota
Henara Dakota external gRPC client (pipeline + reporting) with native Keycloak token refresh
|
125 |
|
Henara.Grpc.Client.Dakota
Henara Dakota external gRPC client (pipeline + reporting) with native Keycloak token refresh
|
6 |
|
Henara.Grpc.Client.Dakota
Henara Dakota external gRPC client (pipeline + reporting) with native Keycloak token refresh
|
4 |
|
Henara.Grpc.Client.Imagelink
Henara ImageLink external gRPC client (pipeline + reporting)
|
4 |
|
Henara.Grpc.Client.Dakota
Henara Dakota external gRPC client (pipeline + reporting) with native Keycloak token refresh
|
3 |
|
Henara.Grpc.Client.Imagelink
Henara ImageLink external gRPC client (pipeline + reporting)
|
3 |
|
Henara.Grpc.Client.Dakota
Henara Dakota external gRPC client (pipeline + reporting) with native Keycloak token refresh
|
2 |
|
Henara.Grpc.Client.Imagelink
Henara ImageLink external gRPC client (pipeline + reporting)
|
2 |
|
Henara.Grpc.Client.Dakota
Henara Dakota external gRPC client (pipeline + reporting) with native Keycloak token refresh
|
1 |
|
Henara.Grpc.Client.Imagelink
Henara ImageLink external gRPC client (pipeline + reporting)
|
0 |
.NET 10.0
- Grpc.Net.Client (>= 2.80.0)
- ImageLink.Infrastructure.GrpcFramework (>= 1.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)