Winglet.Authentication.Testing
0.2.2
dotnet add package Winglet.Authentication.Testing --version 0.2.2
NuGet\Install-Package Winglet.Authentication.Testing -Version 0.2.2
<PackageReference Include="Winglet.Authentication.Testing" Version="0.2.2" />
<PackageVersion Include="Winglet.Authentication.Testing" Version="0.2.2" />
<PackageReference Include="Winglet.Authentication.Testing" />
paket add Winglet.Authentication.Testing --version 0.2.2
#r "nuget: Winglet.Authentication.Testing, 0.2.2"
#:package Winglet.Authentication.Testing@0.2.2
#addin nuget:?package=Winglet.Authentication.Testing&version=0.2.2
#tool nuget:?package=Winglet.Authentication.Testing&version=0.2.2
Winglet.Authentication.Testing
Winglet.Authentication.Testing 0.2.1 is a test-only package for deterministic canonical Winglet JWT v1 tests. It creates an ephemeral RSA keypair, issues only typ=winglet+jwt / RS256 tokens, and provides optional WebApplicationFactory configuration that replaces the production trust material for that host while retaining Winglet.Authentication 0.1.1's real validation pipeline.
Reference this package only from test projects, preferably with PrivateAssets="all". Never configure production applications to trust the test issuer or test key. The package does not provide a fake authentication handler, legacy token generator, OBO wire format or Party-specific authorization constants.
Use CreateAnonymousGlobalToken, CreateAuthenticatedToken, CreateStrongToken, CreateTenantToken, CreateStrongTenantToken and CreateServiceToken. Use RequireWingletPrivilege and the production authorization handlers to test authorization. The canonical wire contract is defined by docs/contracts/authentication/jwt-v1.md.
For a consumer service with production-style Authority/JWKS configuration, apply the helper to the real factory:
var auth = new WingletTestAuthentication();
var testFactory = productionFactory.WithWingletTestAuthentication(auth);
The helper targets the canonical Winglet Bearer scheme, replaces issuer and signing-key trust for that factory, and disables remote metadata discovery only in the test host. Consumers must not manually re-register JwtBearer, disable canonical validation, or add a fake authentication handler.
For standalone smoke, use await using var issuer = await WingletTestJwtIssuer.StartAsync(); it binds to a random localhost port and serves discovery plus JWKS. Use the issuer's semantic token factories and pass issuer.Issuer as the consuming service's configured issuer.
| 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
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.11)
- Microsoft.AspNetCore.Mvc.Testing (>= 10.0.11)
- Winglet.Authentication (>= 0.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.