Henara.Grpc.Client.Common 1.1.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, retrying GrpcChannel whose per-call authorization header is supplied by an ICallTokenProvider; allows call credentials over plaintext (http/h2c) targets and disposes the channels it creates.
  • KeycloakRefreshingTokenProvider — an ICallTokenProvider for native clients that does the interactive-login → refresh lifecycle. Seed it with the tokens from a Keycloak Authorization Code + PKCE login via Initialize(...); 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 singleton ICallTokenProvider.

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

Version Downloads Last updated
2.2.0 128 07/13/2026
2.1.0 9 07/09/2026
2.0.0 4 07/05/2026
1.3.0 7 06/25/2026
1.2.0 2 06/25/2026
1.1.0 2 06/25/2026
1.0.0 3 06/25/2026