AAuth 0.1.0-alpha.2
See the version list below for details.
dotnet add package AAuth --version 0.1.0-alpha.2
NuGet\Install-Package AAuth -Version 0.1.0-alpha.2
<PackageReference Include="AAuth" Version="0.1.0-alpha.2" />
<PackageVersion Include="AAuth" Version="0.1.0-alpha.2" />
<PackageReference Include="AAuth" />
paket add AAuth --version 0.1.0-alpha.2
#r "nuget: AAuth, 0.1.0-alpha.2"
#:package AAuth@0.1.0-alpha.2
#addin nuget:?package=AAuth&version=0.1.0-alpha.2&prerelease
#tool nuget:?package=AAuth&version=0.1.0-alpha.2&prerelease
Getting Started
Prerequisites
- .NET 10+ SDK
Install
dotnet add package AAuth --prerelease
Or, if working within this repository, add a project reference:
dotnet add reference src/AAuth/AAuth.csproj
Generate a Key
using AAuth.Crypto;
var key = AAuthKey.Generate(); // Ed25519 keypair
var publicJwk = key.ToPublicJwk(); // Export for registration
var thumbprint = key.ComputeJwkThumbprint(); // JWK thumbprint (S256)
Make Your First Signed Request
The simplest mode is pseudonymous (HWK) — no Agent Provider needed:
using AAuth.Crypto;
using AAuth.HttpSig;
var key = AAuthKey.Generate();
using var client = new AAuthClientBuilder(key)
.UseHwk()
.Build();
var response = await client.GetAsync("https://resource.example/data");
// Request is signed with HTTP Message Signatures (RFC 9421)
// Resource sees: Signature-Key: sig=hwk;jkt="<thumbprint>";jwk="<public-key>"
Alternative: One-liner with static factory
using var client = AAuthSigningHandler.CreateClient(key, new HwkSignatureKeyProvider(key));
Alternative: DI / IHttpClientFactory
// In Program.cs
builder.Services.AddAAuthAgent("agent", options =>
{
options.Key = key;
options.PersonServer = "https://ps.example"; // omit for signing-only
});
// Inject via IHttpClientFactory
public class MyService(IHttpClientFactory factory)
{
private readonly HttpClient _client = factory.CreateClient("agent");
}
What Just Happened?
AAuthKey.Generate()created an Ed25519 keypair.AAuthClientBuilderconfigured the HWK signing mode and produced anHttpClient.AAuthSigningHandlersigns the request per RFC 9421 covering@method,@authority,@path, andsignature-key.- The resource verifies the signature using the inline public key from
Signature-Key.
Bootstrap with an Agent Provider (Three-Party Flow)
For production scenarios, agents register with an Agent Provider (AP) to get an identity-bound agent token. When a resource challenges with a 401, the SDK automatically exchanges the resource token at the Person Server (PS) and retries.
1. Enrol with the Agent Provider
using AAuth.Agent;
using AAuth.Crypto;
using AAuth.Discovery;
using AAuth.HttpSig;
var apClient = new AgentProviderClient(new HttpClient(), new InMemoryKeyStore());
var enrol = await apClient.EnrolAsync(
apIssuer: "https://ap.example",
agentId: "aauth:myagent@example.com",
enrollEndpoint: "https://ap.example/enrol",
personServer: "https://ps.example");
// enrol.Key — your Ed25519 signing key
// enrol.AgentToken — aa-agent+jwt issued by the AP
// enrol.KeyId — persisted key identifier
2. Build the Signed Client with Challenge Handling
using var client = new AAuthClientBuilder(enrol.Key)
.UseJwt(enrol.AgentToken)
.WithChallengeHandling(personServer: "https://ps.example")
.Build();
<details> <summary>Manual Setup (Advanced)</summary>
// Carrier-token holder — shared between signer and challenge handler.
var holder = new AAuthTokenHolder(enrol.AgentToken);
var signingHandler = new AAuthSigningHandler(
enrol.Key, new JwtSignatureKeyProvider(() => holder.Current))
{
InnerHandler = new HttpClientHandler(),
};
var exchangeHttp = new HttpClient(
new AAuthSigningHandler(enrol.Key, new JwtSignatureKeyProvider(() => enrol.AgentToken))
{ InnerHandler = new HttpClientHandler() });
var exchange = new TokenExchangeClient(exchangeHttp, new MetadataClient(new HttpClient()));
var pipeline = new ChallengeHandler(exchange, holder, "https://ps.example")
{
InnerHandler = signingHandler,
};
using var client = new HttpClient(pipeline);
</details>
3. Make Requests
// First request may trigger a 401 challenge — the SDK handles it transparently
var response = await client.GetAsync("https://resource.example/protected");
Console.WriteLine(await response.Content.ReadAsStringAsync());
What Happens Under the Hood
- Agent sends a signed GET → Resource replies 401 with
AAuth-Requirement: requirement=auth-tokenand aresource_token. ChallengeHandlerextracts the resource token, POSTs it to the Person Server's token endpoint.- The PS validates the agent token, confirms user consent (or defers), and returns an
auth_token. AAuthTokenHolderis updated; the handler retries the original request signed with the auth token.- Subsequent requests reuse the auth token until it expires.
Next Steps
- Signing Modes Overview — choose the right mode for your use case
- Identity-Based Access — simplest workflow
- PS-Asserted Access — full authorization flow
- Protocol Concepts — understand the full picture
Protocol Reference
Explore the interactive protocol specification at https://explorer.aauth.dev/.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- BouncyCastle.Cryptography (>= 2.6.2)
- Microsoft.IdentityModel.Tokens (>= 8.18.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on AAuth:
| Package | Downloads |
|---|---|
|
AAuth.R3
Experimental AAuth Rich Resource Requests (R3) preview helpers — vocabulary-agnostic operations (OpenAPI, MCP, …). Depends on AAuth. |
|
|
AAuth.Events
AAuth Events companion token, subscription and delivery contracts. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.10.0-alpha.1 | 50 | 9/10/2026 |
| 0.8.0-alpha.4 | 89 | 7/3/2026 |
| 0.8.0-alpha.3 | 89 | 6/29/2026 |
| 0.8.0-alpha.2 | 77 | 6/28/2026 |
| 0.8.0-alpha.1 | 77 | 6/27/2026 |
| 0.2.0-alpha.2 | 78 | 6/27/2026 |
| 0.2.0-alpha.1 | 77 | 6/10/2026 |
| 0.1.0-alpha.12 | 309 | 6/7/2026 |
| 0.1.0-alpha.11 | 66 | 6/3/2026 |
| 0.1.0-alpha.10 | 76 | 6/1/2026 |
| 0.1.0-alpha.9 | 65 | 5/31/2026 |
| 0.1.0-alpha.8 | 73 | 5/28/2026 |
| 0.1.0-alpha.7 | 66 | 5/27/2026 |
| 0.1.0-alpha.6 | 78 | 5/27/2026 |
| 0.1.0-alpha.5 | 78 | 5/26/2026 |
| 0.1.0-alpha.4 | 67 | 5/25/2026 |
| 0.1.0-alpha.3 | 70 | 5/24/2026 |
| 0.1.0-alpha.2 | 59 | 5/23/2026 |
| 0.1.0-alpha.1 | 73 | 5/23/2026 |