![]() |
VOOZH | about |
dotnet add package Vorn.Aaas.Client.Api --version 9.1.2
NuGet\Install-Package Vorn.Aaas.Client.Api -Version 9.1.2
<PackageReference Include="Vorn.Aaas.Client.Api" Version="9.1.2" />
<PackageVersion Include="Vorn.Aaas.Client.Api" Version="9.1.2" />Directory.Packages.props
<PackageReference Include="Vorn.Aaas.Client.Api" />Project file
paket add Vorn.Aaas.Client.Api --version 9.1.2
#r "nuget: Vorn.Aaas.Client.Api, 9.1.2"
#:package Vorn.Aaas.Client.Api@9.1.2
#addin nuget:?package=Vorn.Aaas.Client.Api&version=9.1.2Install as a Cake Addin
#tool nuget:?package=Vorn.Aaas.Client.Api&version=9.1.2Install as a Cake Tool
Lightweight .NET 8 library for consuming VORN AAAS-protected APIs from your ASP.NET Core applications.
It provides DI-ready services that:
AddAaasApiClient.HttpClient instances preconfigured with base address and bearer tokens.Add a project reference to Vorn.Aaas.Client.Api from your web/API project.
Configure options in appsettings.json under the Vorn:Aaas section.
Call AddAaasApiClient on your WebApplicationBuilder and inject the services you need.
Add the following section to your configuration (appsettings.json, user secrets, or environment variables):
{
"Vorn": {
"Aaas": {
"Authority": "https://auth.yourdomain.tld",
"Secret": "your-access-client-secret",
"ClientId": "your-default-owner-client-id",
"Local": null,
"DataProtectionDomain": null,
"DataProtectionPassword": null,
"CookieExpirationDays": 14
}
}
}
Notes:
Authority is your AAAS authority/STS base URL.Secret is used by the internal access client (see AaasConstants.AccessClient).ClientId is an optional default owner/client id used when no explicit owner is set.Local (any non-null value) appends a .local suffix to resolved API client ids (used by IApiClientService).Environment variables (example):
Vorn__Aaas__AuthorityVorn__Aaas__SecretVorn__Aaas__ClientIdVorn__Aaas__LocalIn Program.cs:
var builder = WebApplication.CreateBuilder(args);
// Registers options and the AAAS client services
builder.AddAaasApiClient();
var app = builder.Build();
app.Run();
This registers:
IAaasClientFactory for generic AAAS-backed clients.IApiClientService for endpoint-specific API clients discovered by endpoint naming.IOwnerContext for per-request owner/client id handling.IAaasClientFactorypublic class MyService(IAaasClientFactory factory)
{
public async Task<HttpResponseMessage> GetAsync()
{
// Optional: provide endpoint path and an overriding owner client id
using var client = await factory.CreateClient("/api/resource/", clientId: "owner.client.id");
return await client.GetAsync("items");
}
}
Behavior:
Authority combined with the provided endpoint via UrlExtensions.UrlCombine.Content-Owner (when available).IApiClientServiceIApiClientService resolves an ApiClient by the last segment of the endpoint. For example, for endpoint /api/orders/, it looks up client id api.orders (or api.orders.local when Vorn:Aaas:Local is set).
public class OrdersService(IApiClientService apiClientService)
{
public async Task<IReadOnlyList<Order>> GetOrdersAsync()
{
using var client = await apiClientService.CreateClient("/api/orders/");
var response = await client.GetAsync("list");
response.EnsureSuccessStatusCode();
return await response.Content.ReadFromJsonAsync<List<Order>>() ?? [];
}
}
Behavior:
ApiClient (id, secret, scopes, hostUri) via AAAS at /api/apiclients/{clientId}.https://{HostUri} combined with the provided endpoint.Content-Owner (when available).public class TokenService(IApiClientService apiClientService)
{
public async Task<string> GetTokenAsync()
{
var apiClient = await apiClientService.GetApiClient("api.orders")
?? throw new InvalidOperationException("Client not found");
return await apiClientService.GetAccessTokenAsync(apiClient)
?? throw new InvalidOperationException("Token unavailable");
}
}
Implement ISignalRClientDefinition on your hub client to provide its default registration. Use AddSignalRClient only when you need to customize the defaults, and ISignalRClientFactory to create connections with AAAS headers and access tokens applied automatically.
builder.Services
.AddAaasApiClient(builder.Configuration)
.AddSignalRClient<FileTransferHub>();
public class FileTransferHub(ISignalRClientFactory connectionFactory) : ISignalRClientDefinition
{
public static void Configure(SignalRClientRegistration registration)
{
registration.ClientId = "/files";
registration.ResourceId = "/hubs/transfer";
}
public Task<HubConnection> CreateAsync(CancellationToken cancellationToken = default) =>
connectionFactory.CreateConnection<FileTransferHub>(cancellationToken);
}
// Usage example
HubConnection connection = await connectionFactory.CreateConnection<FileTransferHub>();
await connection.StartAsync();
SignalRClientRegistration automatically resolves the AAAS API client based on the configured client id (override with ApiClientId if necessary), composes the hub path as /{clientId}/{resourceId}, applies owner headers, and configures reconnects and MessagePack by default. Customize the registration by calling AddSignalRClient<FileTransferHub>(options => { ... }) or tweak the underlying SignalR builder through the ConfigureBuilder and ConfigureHttpConnection delegates when additional options are required.
Per-connection adjustments are also supported through ISignalRClientFactory:
HubConnection connection = await connectionFactory.CreateConnection<FileTransferHub>(
new SignalRConnectionOptions
{
UseMessagePack = false,
ConfigureBuilder = builder => builder.WithAutomaticReconnect(new[] { TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(5) })
});
Content-Owner header is sent by clients created via IAaasClientFactory and IApiClientService.Make sure your downstream APIs expect and authorize these headers as needed.
IDistributedCache.SemaphoreSlim to avoid token stampedes.InvalidOperationException during startup.HttpResponseMessage.EnsureSuccessStatusCode() is used where appropriate; handle exceptions accordingly.Vorn__Aaas__Secret, etc.Vorn:Aaas:Local to any non-null value appends .local to resolved API client ids (useful for local stacks).BuilderExtensions.AddAaasApiClientIAaasClientFactory / AaasClientFactoryIApiClientService / ApiClientServiceISignalRClientFactory / SignalRClientFactoryIOwnerContext / OwnerContextVornOptions, AaasOptions, ApiClientDtoSignalRClientRegistration, SignalRClientOptionsAaasConstants, UrlExtensionsIssues and contributions are welcome. Please include a clear description and, if possible, a minimal reproduction.
Store secrets securely (Key Vault, environment variables, or user secrets). Do not store secrets in source control.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Vorn.Aaas.Client.Api:
| Package | Downloads |
|---|---|
|
Vorn.Aaas.Client
This library is designed as part of web applications which are clients who get authentication as a service from Vorn.Aaas.Server. |
|
|
Vorn.Files.Client
This library is designed as part of web applications which are clients who get file hosting as a service from a Vorn.Files.Host. |
|
|
Vorn.Caas.Client
This library is designed as a client for Vorn Caas. |
|
|
Vorn.Ai.Client
This library contains methods required to use VORN AI services. |
|
|
Vorn.Ai.Client.Components
This library contains methods required to use AI services. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.1.2 | 407 | 11/16/2025 |
| 9.1.1 | 306 | 11/15/2025 |
| 9.1.0 | 240 | 11/15/2025 |
| 9.0.2 | 591 | 11/10/2025 |
| 9.0.1 | 291 | 11/9/2025 |
| 9.0.0 | 329 | 11/5/2025 |
| 8.9.7 | 293 | 11/30/2025 |
| 8.9.6 | 359 | 11/30/2025 |
| 8.9.5 | 345 | 11/30/2025 |
| 8.9.4 | 288 | 11/29/2025 |
| 8.9.3 | 241 | 11/29/2025 |
| 8.9.2 | 279 | 11/23/2025 |
| 8.9.1 | 274 | 11/23/2025 |
| 8.9.0 | 330 | 11/9/2025 |
| 8.8.0 | 338 | 11/2/2025 |
| 8.7.1 | 312 | 10/29/2025 |
| 8.7.0 | 340 | 10/27/2025 |
| 8.6.2 | 331 | 10/27/2025 |
| 8.6.1 | 276 | 10/25/2025 |
| 8.6.0 | 275 | 10/25/2025 |