WoW2.Sdk.Beta.Be.Identity.Testing
10.0.27-beta
Prefix Reserved
dotnet add package WoW2.Sdk.Beta.Be.Identity.Testing --version 10.0.27-beta
NuGet\Install-Package WoW2.Sdk.Beta.Be.Identity.Testing -Version 10.0.27-beta
<PackageReference Include="WoW2.Sdk.Beta.Be.Identity.Testing" Version="10.0.27-beta" />
<PackageVersion Include="WoW2.Sdk.Beta.Be.Identity.Testing" Version="10.0.27-beta" />
<PackageReference Include="WoW2.Sdk.Beta.Be.Identity.Testing" />
paket add WoW2.Sdk.Beta.Be.Identity.Testing --version 10.0.27-beta
#r "nuget: WoW2.Sdk.Beta.Be.Identity.Testing, 10.0.27-beta"
#:package WoW2.Sdk.Beta.Be.Identity.Testing@10.0.27-beta
#addin nuget:?package=WoW2.Sdk.Beta.Be.Identity.Testing&version=10.0.27-beta&prerelease
#tool nuget:?package=WoW2.Sdk.Beta.Be.Identity.Testing&version=10.0.27-beta&prerelease
WoW2.Sdk.Beta.Be.Identity.Testing
The Identity test kit. Today it holds the fake token issuer; fakes over the contract, personas, the OTP code sink and the
broker conformance bases land once the contract's brokers exist. It references the contract, WoW2.Sdk.Beta.Be.Identity.Auth
and WoW2.Sdk.Beta.Be.Testing.
dotnet add package WoW2.Sdk.Beta.Be.Identity.Testing --prerelease
Fake token issuer
FakeTokenIssuer signs person, service and exchanged tokens in the exact shape Identity issues, with an in-memory RSA key,
so a consumer tests with no Identity running.
using var issuer = new FakeTokenIssuer();
await using var factory = new WebApplicationFactory<Program>().WithWebHostBuilder(host =>
host.ConfigureTestServices(services => services.AddFakeTokenIssuer(issuer)));
var client = factory.CreateClient();
// The audience is the host's real one: a wrong one still answers 401.
var worker = issuer.IssueServiceToken("ocharo-editorial", "https://files.example.com/", "files.read");
client.DefaultRequestHeaders.Authorization = new("Bearer", worker);
await client.GetAsync("/files");
var person = new FakePerson { Id = Guid.NewGuid(), OrganizationId = organizationId, Role = "owner", Permissions = ["files:share"], SessionId = Guid.NewGuid() };
var own = issuer.IssuePersonToken(person, "https://files.example.com/", scopes: "files.read");
var exchanged = issuer.IssueExchangedToken(person, "ocharo-editorial", "https://files.example.com/", "files.read");
AddFakeTokenIssuermakes the defaultJwtBearerscheme trust only the fake. A host's metadata address, trusted issuers and resolver stop being read, so nothing reaches a network; its audiences stay.issuer.AsTrustedIssuer(partition, audiences)is the other way in: add it toJwtOptions.TrustedIssuerswhen a test needs the real trusted-issuer pipeline, a stampedpartitionincluded.Lifetimedefaults to 5 minutes;clockdates the tokens, so a past clock makes an expired token.
A caller under test
CreateTokenEndpointHandler() answers form posts as Identity's /connect/token does, for client_credentials and token exchange. Swap it in as the primary handler of the named HttpClient the be sdk's token handler posts through, or use a plain HttpClient:
using var tokens = new HttpClient(issuer.CreateTokenEndpointHandler());
var response = await tokens.PostAsync("https://fake-issuer.test/connect/token", new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = "ocharo-editorial",
["client_secret"] = "any",
["resource"] = "https://desk.example.com/",
["scope"] = "desk.media",
}));
The handler has no registry: any client may ask for any resource and scope, a client secret isn't checked, an omitted scope grants none, and an exchanged token keeps every permission. A failure answers 400 with { "error": … }, under the same error codes as Identity.
| 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.3)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
- Microsoft.IdentityModel.Tokens (>= 8.14.0)
- WoW2.Sdk.Beta.Be.Identity.Abstractions (>= 10.0.27-beta)
- WoW2.Sdk.Beta.Be.Identity.Auth (>= 10.0.27-beta)
- WoW2.Sdk.Beta.Be.Testing (>= 10.0.103-beta)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.27-beta | 0 | 11/5/2026 |
| 10.0.26-beta | 39 | 11/5/2026 |
| 10.0.25-beta | 41 | 11/5/2026 |
| 10.0.24-beta | 52 | 11/3/2026 |
| 10.0.23-beta | 50 | 11/2/2026 |
| 10.0.22-beta | 52 | 11/2/2026 |
| 10.0.21-beta | 59 | 11/2/2026 |
| 10.0.20-beta | 59 | 11/2/2026 |
| 10.0.19-beta | 61 | 11/2/2026 |
| 10.0.18-beta | 61 | 11/2/2026 |
| 10.0.17-beta | 60 | 11/2/2026 |
| 10.0.16-beta | 56 | 11/2/2026 |
| 10.0.15-beta | 56 | 11/2/2026 |
| 10.0.14-beta | 62 | 11/1/2026 |
| 10.0.13-beta | 60 | 11/1/2026 |
| 10.0.12-beta | 56 | 11/1/2026 |
| 10.0.11-beta | 58 | 11/1/2026 |
| 10.0.10-beta | 59 | 10/30/2026 |
| 10.0.9-beta | 60 | 10/30/2026 |
| 10.0.8-beta | 60 | 10/28/2026 |