Henara.Grpc.Client.Common 2.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). The domain clients bring it in
transitively — you normally don't reference it directly.
It provides:
GrpcClientBase— builds an authenticated, retryingGrpcChannelwhose per-callauthorizationheader comes from anICallTokenProvider. Allows call credentials over plaintext (http/h2c) targets and disposes the channels it creates.KeycloakRefreshingTokenProvider— anICallTokenProviderfor native clients. Seed it with the tokens from an Authorization Code + PKCE login viaInitialize(...); it 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. Throws if anICallTokenProvideris already registered — there must be exactly one token authority.
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 login completes, seed the tokens from the login response:
var auth = provider.GetRequiredService<KeycloakRefreshingTokenProvider>();
auth.Initialize(accessToken, refreshToken, expiresInSeconds);
For a host that already owns a Keycloak session (e.g. SmartVO), do not use this provider — use
Henara.Grpc.Client.DakotaSlim, 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 (a web app's user token, 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 (>= 2.1.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)