![]() |
VOOZH | about |
dotnet add package Rig.TUnit.Security.OAuth --version 0.1.0-beta.2
NuGet\Install-Package Rig.TUnit.Security.OAuth -Version 0.1.0-beta.2
<PackageReference Include="Rig.TUnit.Security.OAuth" Version="0.1.0-beta.2" />
<PackageVersion Include="Rig.TUnit.Security.OAuth" Version="0.1.0-beta.2" />Directory.Packages.props
<PackageReference Include="Rig.TUnit.Security.OAuth" />Project file
paket add Rig.TUnit.Security.OAuth --version 0.1.0-beta.2
#r "nuget: Rig.TUnit.Security.OAuth, 0.1.0-beta.2"
#:package Rig.TUnit.Security.OAuth@0.1.0-beta.2
#addin nuget:?package=Rig.TUnit.Security.OAuth&version=0.1.0-beta.2&prereleaseInstall as a Cake Addin
#tool nuget:?package=Rig.TUnit.Security.OAuth&version=0.1.0-beta.2&prereleaseInstall as a Cake Tool
In-process mock OAuth 2.0 / OIDC server with
/authorize,/token,/jwks,/.well-known/openid-configuration— client-credentials + auth-code + PKCE S256 + refresh.
MockOAuthServer is an in-process OAuth 2.0 / OpenID Connect mock that
exposes the four endpoints client code expects (/authorize, /token,
/jwks, /.well-known/openid-configuration) and issues JWTs signed
with a rotating key set. Tokens are accepted by a real
JwtBearerHandler via JWKS discovery — the production validation
pipeline runs unchanged. Supports the three grant flows tests need:
client-credentials, authorization-code + PKCE (S256), and refresh-token.
MockOAuthServer
does not replicate provider-specific quirks (Azure AD B2C claim
mappings, Auth0 rules, etc.).FrameworkReference Microsoft.AspNetCore.App).using Rig.TUnit.Security.OAuth.Fixtures;
await using var mock = new MockOAuthServer(new MockOAuthServerOptions
{
Issuer = "https://mock",
});
await mock.StartAsync();
| Property | Type | Default | Description |
|---|---|---|---|
Issuer |
string |
"https://mock.oauth" |
OIDC issuer URL |
DefaultScopes |
string[] |
["openid", "profile"] |
Tokens minted with these by default |
AccessTokenTtl |
TimeSpan |
15m |
TTL for access tokens |
RefreshTokenTtl |
TimeSpan |
7d |
TTL for refresh tokens |
EnablePkce |
bool |
true |
Require PKCE for auth-code flow |
Rig.TUnit.Security.OAuth.Fixtures.MockOAuthServerRig.TUnit.Security.OAuth.Options.MockOAuthServerOptionsRig.TUnit.Security.OAuth.Builder.OAuthRigBuilderEach MockOAuthServer binds a random ephemeral port; multiple fixtures
run concurrently without collision. Signing keys are per-fixture
(rotatable via mock.RotateSigningKey()).
/token endpoint latency: ~5 ms (JWT signing dominant).TokenValidationParameters.RefreshInterval.code_verifier mismatch — ensure the verifier on /token
matches the S256 hash sent on /authorize; use the helper's PKCE
pair generator to avoid manual errors.See .
/.well-known/openid-configuration is served at the issuer base URL;
misconfigured Authority values on consumer fixtures will fail
discovery silently./token call with grant_type=refresh_ token issues a new refresh and invalidates the old. Tests asserting
"old refresh still works" will fail — by design.See ;
baseline in benchmarks/baseline-005.json.
MIT. See .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. 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 1 NuGet packages that depend on Rig.TUnit.Security.OAuth:
| Package | Downloads |
|---|---|
|
Rig.TUnit.All
Meta-package containing every Rig.TUnit.* package. DISCOURAGED — prefer per-feature or per-stack meta-packages (Rig.TUnit, Rig.TUnit.Microservices). |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.2 | 72 | 4/27/2026 |
| 0.0.0-alpha.0.14 | 62 | 4/26/2026 |