Ark.oAuth.Oidc 2.0.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Ark.oAuth.Oidc --version 2.0.10
                    
NuGet\Install-Package Ark.oAuth.Oidc -Version 2.0.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ark.oAuth.Oidc" Version="2.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ark.oAuth.Oidc" Version="2.0.10" />
                    
Directory.Packages.props
<PackageReference Include="Ark.oAuth.Oidc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ark.oAuth.Oidc --version 2.0.10
                    
#r "nuget: Ark.oAuth.Oidc, 2.0.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ark.oAuth.Oidc@2.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ark.oAuth.Oidc&version=2.0.10
                    
Install as a Cake Addin
#tool nuget:?package=Ark.oAuth.Oidc&version=2.0.10
                    
Install as a Cake Tool

Ark.oAuth.Oidc

A self-contained OAuth 2.1 and OpenID Connect provider for ASP.NET Core. Add two lines to Program.cs, point any standard OIDC library at the issuer URL, and it configures itself from the discovery document.

Multi-tenant, runs on SQLite / MySQL / PostgreSQL / SQL Server, and ships its own sign-in, consent and admin UI. The matching client package is Ark.oAuth.Client.

For AI coding agents — prompt-oriented, source-verified docs live beside this README: AI-PROMPT.md (rules + capability map + injectable context block), AI-RECIPES.md (task → code recipes), API-GUIDE.md (host APIs, endpoints, settings, management routes + decision guide), TROUBLESHOOTING.md (symptom → cause → fix), MIGRATION.md (versions, schema scripts, upgrading). The C# in this directory is authoritative; do not invent APIs, endpoints, or settings.

Install

dotnet new mvc -n MyIdp
cd MyIdp
dotnet add package Ark.oAuth.Oidc
dotnet add package Ark.oAuth.Client

Program.cs

using Ark.oAuth;
using Ark.oAuth.Oidc;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddArkOidcServer(builder.Environment);   // the identity provider
builder.Services.AddArkOidcClient(builder.Configuration); // the admin console is itself a client
builder.Services.AddControllersWithViews();

var app = builder.Build();

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();        // must come before UseAuthentication / UseAuthorization
app.UseArkOidcCors();    // only needed if browser-based clients call the token endpoint
app.UseArkAuthData();    // one-time database bootstrap
app.UseArkOidcClient();
app.UseAuthentication();
app.UseAuthorization();

app.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();

UseRouting() has to run before UseAuthentication() / UseAuthorization(). Without a selected endpoint the authorization middleware cannot see the [Authorize] metadata it is meant to enforce.

appsettings.json

{
  "ark_oauth_server": {
    "TenantId": "my_idp",              // a client named "<TenantId>_client" is seeded for the admin console
    "BasePath": "",                    // set only if the app is hosted under a sub-path
    "BaseUrl": "https://idp.example.com",
    "Provider": "sqlite",              // sqlite (default) | mysql | postgres
    "UploadPath": "./wwwroot/{0}/",
    "DefaultPw": "<initial password for new users>",
    "UserPasswordMode": "admin_managed", // admin_managed | email_based | auto (legacy behaviour)
    "AdminUser": {                     // the account seeded when the database is first created
      "Username": "admin",             // optional, defaults to "admin"; need not be an email address
      "Password": "<required>",        // no default - see below
      "Name": "Admin User"
    },
    "Admin": {
      "SignOutUrl": "/Home/SignOutAll" // where the console's Sign out link goes; see below
    },
    "Oidc": {
      "EnableDeviceFlow": true,
      "EnablePushedAuthorizationRequests": true,
      "RequirePushedAuthorizationRequests": false,
      "EnableDynamicRegistration": false,
      "RequireRegistrationAccessToken": true,
      "AlwaysRequireConsent": false,
      "SessionLifetimeMinutes": 480,
      "MaxFailedSignIns": 10,
      "LockoutMinutes": 15,
      "EnableBackChannelLogout": true,       // see "Signing out"
      "BackChannelLogoutTimeoutSeconds": 5,
      "LogoutTokenLifetimeSeconds": 120,
      "SignOutAllBrowserSessions": true,     // sign-out covers every session in the browser
      "SignOutAcrossTenants": true,
      "CorsOrigins": []                // exact origins of any single-page-application clients
    }
  },
  "ConnectionStrings": {
    "ArkAuthConnection": "Data Source=./data/ark_auth.db"
  }
}

On first run the server creates its schema, generates an RSA signing key in-process, seeds the OIDC scope catalogue and creates the administrator account from AdminUser.

AdminUser:Password is required and has no default — the server used to compile in admin / admin, which put the same credentials on the account that administers every tenant of every deployment. It falls back to DefaultPw, and a value left as a <<placeholder>> counts as unset; with neither configured, the first request fails with a message naming the setting and no database is created. Supply it out of band rather than in appsettings.json:

dotnet user-secrets set "ark_oauth_server:AdminUser:Password" "…"   # development
export ark_oauth_server__AdminUser__Password="…"                    # environment

The section is only read while the database is being created. Changing it afterwards renames nothing and resets no password — use the console.

UserPasswordMode lets the host choose one password-onboarding flow for newly created accounts. Use admin_managed when operators set or communicate passwords out of band, or email_based when email-address accounts should be parked in reset mode and sent an activation link. auto keeps the older mixed behaviour, where the caller decides.

Your issuer is {BaseUrl}/{TenantId}, and discovery lives at {BaseUrl}/{TenantId}/.well-known/openid-configuration.

What's supported

Specification Status
OAuth 2.0 (RFC 6749) Authorization code, refresh token, client credentials
PKCE (RFC 7636) Required for public clients, S256 only
OpenID Connect Core 1.0 ID tokens, UserInfo, nonce, at_hash/c_hash, auth_time, sid
OIDC Discovery 1.0 /.well-known/openid-configuration
AS Metadata (RFC 8414) /.well-known/oauth-authorization-server
JWKS (RFC 7517) /.well-known/jwks.json, two-phase key rotation
JWT Access Tokens (RFC 9068) typ: at+jwt, client_id, jti, scope
Introspection (RFC 7662) Access and refresh tokens
Revocation (RFC 7009) Revokes the whole refresh-token family
Device Grant (RFC 8628) With verification_uri_complete
PAR (RFC 9126) Optional, can be made mandatory
Dynamic Registration (RFC 7591/7592) Optional, off by default
RP-Initiated Logout 1.0 end_session_endpoint, browser-wide by default
Back-Channel Logout 1.0 Signed logout_token POSTed to each client that took part
Issuer Identification (RFC 9207) iss in the authorization response
Native Apps (RFC 8252) Loopback redirect URIs with variable ports

Deliberately not supported: the implicit grant, the hybrid flow, and the resource owner password credentials grant — all three are removed in OAuth 2.1.

Endpoints

All paths are relative to the issuer, {BaseUrl}/{TenantId}.

Purpose Path
Discovery /.well-known/openid-configuration
JWKS /.well-known/jwks.json
Authorization /oauth2/authorize
Token /oauth2/token
UserInfo /oauth2/userinfo
Introspection /oauth2/introspect
Revocation /oauth2/revoke
End session /oauth2/logout
Device authorization /oauth2/device_authorization
Pushed authorization request /oauth2/par
Dynamic registration /oauth2/register
Client setup page /oauth2/integrate/{client_id}

Signed in to the admin console, every registered client has a generated setup page at /{tenant_id}/oauth2/integrate/{client_id} carrying its exact issuer, client ID, scopes, redirect URIs and copy-paste snippets for the Ark client package, the raw ASP.NET Core handler, oidc-client-ts, Authlib and go-oidc.

That page will also run the flow for you. Pick one of the client's redirect URIs and press Start the flow: the page generates a real code_verifier and S256 code_challenge in your browser and runs the authorization request in an embedded iframe, ending on the redirect URI with the code and state in its query string. Nothing is simulated — it is the same request your application makes — and the verifier is shown alongside the curl that redeems the code, which is the fastest way to prove PKCE end to end before writing any client code. The frame ends up on the application's own origin, so if the application refuses to be framed, Open in a new tab runs the identical flow.

Signing out

end_session_endpoint is /{tenant_id}/oauth2/logout, and two things about it are worth knowing before pointing a client at it.

It signs out the whole browser, not one session. The session cookie holds a single sid, but a browser accumulates sessions: each sign-in creates one and overwrites the cookie, so every earlier session stays live — with its refresh tokens — while becoming unreachable from the browser. On a shared machine that is a different person, and ending only the session the cookie names leaves them signed in everywhere they had been. A second cookie, ark_idp_bid, identifies the browser rather than the sign-in; every session records the browser it was created in, and logout ends all of them. It is a random value that means nothing without those session rows, and it is deliberately kept across sign-out — it identifies the user agent, not the user.

Clients are told, if they ask to be. Register a backchannel_logout_uri and the client is POSTed a signed logout_token whenever a session it took part in ends — application/x-www-form-urlencoded, one logout_token parameter, answer 200 or 204. The token is typ: logout+jwt, carries the http://schemas.openid.net/event/backchannel-logout event and, unless the client turns backchannel_logout_session_required off, the sid to end. It never carries a nonce, so it cannot be replayed into an ID token validator. Verify it against the same JWKS as an ID token. Set the URI in the console's client editor, at /oauth2/register (RFC 7591) or in the provisioning call; a client without one is simply never contacted, which is where every existing client starts.

The clients notified are the ones that were logged in under the session — recorded when the authorization code is issued, rather than derived from live refresh tokens, which would miss every client that never asked for offline_access. Sessions are revoked before the first notification goes out and each delivery has its own timeout, so a client that is down cannot stop a user signing out; the failure is logged as a warning and named on the signed-out page.

Setting Default
Oidc:EnableBackChannelLogout true Notifies nobody until a client registers a URI
Oidc:BackChannelLogoutTimeoutSeconds 5 Per client; deliveries run in parallel
Oidc:LogoutTokenLifetimeSeconds 120
Oidc:SignOutAllBrowserSessions true Off ends only the session the cookie names
Oidc:SignOutAcrossTenants true Off keeps a sign-out inside the tenant it was asked of

Front-channel logout is not implemented, and discovery no longer claims otherwise.

Provisioning API

Standing up a new application is four operations in a fixed order: register the client, register its redirect URIs, create the account, and add the per-user-per-client access mapping. The last is the one that gets forgotten, and its absence looks exactly like a wrong password on the sign-in page. This does all four in one call.

POST /api/oauth/v1/provision/client
Content-Type: application/json

{
  "client_name": "Billing Portal",          // required
  "user_name":   "jane@example.com",        // required - an email address or a plain username
  "tenant_id":   "my_idp",                  // defaults to ark_oauth_server:TenantId
  "client_id":   "billing_portal",          // derived from client_name when omitted
  "client_logo": "https://…/logo.png",      // or a data: URI; shown on the sign-in page
  "redirect_uris": [ "https://billing.example.com/signin-oidc" ],
  "claims": [ "sub", "name", "email", "email_verified" ],
  "send_activation_email": false
}
// 200
{ "error": false, "code": "provisioned",
  "msg": "client 'billing_portal' created in tenant 'my_idp' - the new user signs in with the configured default password.",
  "data": { "client_id": "billing_portal", "client_created": true,
            "user_name": "jane@example.com", "user_created": true,
            "user_credential": "default_password", "mapping_created": true,
            "issuer": "…", "discovery": "…", "setup_url": "…" } }

// 409 - the name is taken. Nothing was written.
{ "error": true, "code": "client_exists", "msg": "an application named 'Billing Portal' …" }

Collisions are handled asymmetrically on purpose. An existing client name is refused and nothing is written — quietly rewriting the redirect URIs of a live application would turn an onboarding script into a way to redirect somebody else's authorization codes. An existing user is reused and mapped to the new client, because that is exactly what happens when a person is given their second application.

A user this call creates gets ark_oauth_server:DefaultPw and can sign in immediately unless the host's ark_oauth_server:UserPasswordMode requires the email activation flow. In auto mode, set send_activation_email to email a link instead; the account then cannot sign in until it is used.

The console's Provision an application panel — on the administrator's Provisioning page, linked from the console's own navigation — is this endpoint with a form in front of it. Fill the form in and the page shows the same call as a curl command, with the values you typed already in it.

Deactivating a user or a client

Both an account and an application can be switched off without being deleted, and the sign-in screen says which of the two it was — an application names itself, an account is told it has been deactivated and who to ask. Neither message is reachable without the correct password, so the one deliberately-vague message shown for every credentials failure still holds and the form cannot be used to enumerate accounts.

POST /api/oauth/v1/activation/client   { "tenant_id": "my_idp", "client_id": "billing_portal", "is_active": false }
POST /api/oauth/v1/activation/user     { "user_name": "jane@example.com", "is_active": false }

Deactivating revokes what has already been handed out — a client loses its refresh tokens, a user loses their sessions and their refresh tokens — because otherwise the switch would not take effect until they expired, up to fourteen days later. Access tokens already issued are self-contained and remain valid until they expire, which is the usual bound on revoking a JWT.

The console's Activation panel — on the same Provisioning page — states the request as a form and lists every client and account with its current state below it. Both endpoints need the same authorization as the rest of the management API; the page itself is restricted to the administrator account (AdminUser:Username, or a principal carrying an admin claim).

Admin console

The console ships in this package. Referencing it is all the wiring there is:

Purpose Path
Console /{tenant_id}/admin (/admin redirects to the configured tenant)
Its stylesheet and script /ark-admin/asset/ark-admin.css, /ark-admin/asset/ark-admin.js

Tenants, clients, users, scopes, claims, the per-user-per-client access mapping, one-call provisioning and the two activation switches — all over the management API at /api/oauth/v1/…. The page is self-contained — no layout, _ViewStart, tag helper or wwwroot entry is required of the host, because the view brings its own shell and the two assets are served straight out of the assembly. Tabulator is its one external dependency, loaded pinned from unpkg.

Two things are worth knowing:

  • Sign out. The console's session is the host application's authentication cookie, and only the host can drop it, so point ark_oauth_server:Admin:SignOutUrl at a route of your own that signs out of both the cookie and the OIDC scheme. Left unset, the link falls back to the tenant's end_session_endpoint, which ends the session at the IdP but leaves the local cookie in place.
  • Overriding it. Application views win over package views: put your own Views/Admin/Manage.cshtml in the host to replace the page and keep the routes and API.

AddArkOidcServer also unpacks the assets to the host's content root in Development, so they can be read and edited on disk; the served copies always come from the assembly.

The v1 console at /oauth/{tenant}/v1/server/{client_id}/manage is still served for existing deployments and is no longer developed.

Branding

The sign-in, consent and device pages show two marks in the header: the host logo, which says who is asking for the password, and the client logo, which says what is being signed in to.

Where it comes from Setting
Host logo ark_oauth_server:EmailConfig:host_logo
Default client logo ark_oauth_server:EmailConfig:client_logo
Per-client logo client_logo on the client — set it in the console's client editor, at provisioning time, or as logo_uri through dynamic registration

A client's own logo wins; the configured one is the fallback for every client that has not set one. Uploads through the console are inlined as a data: URI, so a logo needs no upload directory, no static file route and nothing extra to back up — keep them under 256 KB, since the value travels in every page that renders it.

The header lays itself out for whichever marks exist: two get a divider between them, one gets the room both would have shared, and none promotes the host name to being the thing itself rather than a caption under an empty space. The admin console's top bar draws the same lockup.

Upgrading an existing database

Schema changes ship as numbered scripts, and they now run themselves: on start-up the server applies every script the database has not had yet and records it in ark_schema_history.

00003_sql.sql   # 2.0.0 - protocol tables, RFC 7591 metadata
00004_sql.sql   # 2.0.2 - users.is_active
00005_sql.sql   # 2.0.3 - back-channel logout metadata, sessions.browser_id, session_clients

Nothing is ever replayed. A database that predates the history table is measured rather than replayed — each script is checked against the live schema, and one whose tables and columns are all present is recorded as a baseline without executing. That matters because 00003 rewrites every client that holds no secret, which is right for a 2.0.0 upgrade and wrong for anything else.

Skipping this used to be silent and specific: without 00004 the entity carried users.is_active and the table did not, so /api/oauth/v1/user/list answered a bare 500 and the console's Users grid came up empty with nothing saying why.

Only the SQLite scripts ship in this package. On MySQL or PostgreSQL there is nothing to run automatically and the ALTER TABLE is still yours to apply. GET /api/migration/v1/sql?action=up|down&name=00005_sql.sql is still there to run or roll back one by hand, and now reports whether it actually worked instead of always answering "executed".

Before production

  1. Set AdminUser:Password before the first run, out of band, and change it after first sign-in.
  2. Set a strong DefaultPw.
  3. Keep RequireHttpsMetadata at true on clients.
  4. Leave EnableDynamicRegistration off unless you need it, and keep RequireRegistrationAccessToken on if you do.
  5. Give confidential clients real secrets and set token_endpoint_auth_method accordingly.

Documentation

Full documentation, flow walkthroughs, the configuration reference and the v1 migration guide are in the repository: https://github.com/ir-dev/ark-oauth-oidc

License

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.1.7 109 11/3/2026
2.1.6 106 11/2/2026
2.1.5 97 11/2/2026
2.1.4 95 11/2/2026
2.1.3 99 11/2/2026
2.1.2 96 11/1/2026
2.1.1 102 11/1/2026
2.0.14 103 11/1/2026
2.0.13 106 10/29/2026
2.0.12 92 10/29/2026
2.0.11 113 10/29/2026
2.0.10 174 9/12/2026
2.0.9 163 9/3/2026
2.0.8 138 9/2/2026
2.0.7 129 9/1/2026
2.0.6 125 9/1/2026
2.0.5 151 8/30/2026
2.0.4 131 8/29/2026
2.0.3 134 8/29/2026
2.0.2 146 8/19/2026
Loading failed

2.0.3 — back-channel logout, sign-out that covers the whole browser, and a dependency graph that
is only what this package uses.

* **Back-Channel Logout 1.0.** A client that registers a backchannel_logout_uri is now POSTed a
 signed logout token when a session it took part in ends — an RP-initiated logout, a revoked
 refresh token, or an account deactivated mid-session. The token is the §2.4 artefact: typ
 "logout+jwt", the backchannel-logout event claim, sub and sid, and deliberately no nonce, so a
 client cannot be handed one where an ID token was expected.
* **A client that is down cannot stop a user signing out.** The sessions are revoked at this
 server before the first notification goes out, every delivery runs in parallel behind its own
 timeout, and a refusal is written to the audit trail as a warning rather than raised. The worst
 outcome of an unreachable client is an application cookie that outlives the IdP session — which
 is exactly the state every deployment was in before this existed.
* **Clients are notified because they took part, not because they still hold a token.** A
 session_clients row is written the first time a session issues a client an authorization code or
 approves its device request. Deriving that list from live refresh tokens instead would miss
 every client that never asked for offline_access — most of them — and every client whose tokens
 have expired while its own application cookie is still valid.
* **Registering for it.** backchannel_logout_uri and backchannel_logout_session_required are
 accepted through dynamic client registration (§3.1 metadata: absolute, no fragment, https unless
 loopback), on POST /api/oauth/v1/provision/client, and in the admin console's client editor. A
 client with no URI is simply never notified, so nothing changes for clients that do not ask.
* **Signing out now ends every session in the browser, not just the newest.** The session cookie
 holds one sid and each sign-in overwrites it, so on a shared machine the previous person's
 session stayed live in the database — with its refresh tokens, and with them still signed in at
 every application they had opened — while /oauth2/logout ended only the session the cookie
 happened to name. A long-lived ark_idp_bid cookie now identifies the user agent, sessions record
 which browser they were created in, and logout ends all of them. It carries no identity of its
 own: it is a random value that means nothing without the session rows pointing at it.
* **Discovery now tells the truth about logout.** backchannel_logout_supported and
 backchannel_logout_session_supported are advertised. frontchannel_logout_supported and
 frontchannel_logout_session_supported, which were advertised as true against an endpoint this
 server has never had, are now false — a client that reads the document no longer configures a
 logout flow that cannot work.
* **The signed-out page says what actually happened**: how many sessions and accounts were ended
 when it was more than one, how many applications were signed out with you, and — named rather
 than hidden — how many could not be reached and may still be open.
* New settings under ark_oauth_server:Oidc, all defaulted to the behaviour above:
 EnableBackChannelLogout (true), BackChannelLogoutTimeoutSeconds (5), LogoutTokenLifetimeSeconds
 (120), SignOutAllBrowserSessions (true) and SignOutAcrossTenants (true). The last is worth a
 look if one browser is expected to hold sessions in several tenants at once: the browser cookie
 is one per deployment, not one per tenant.
* **Dependencies are now what this package actually uses.** Ark.EfCore, Azure.Identity and
 BouncyCastle are gone. Nothing here ever used a type from Ark.EfCore — it was acting purely as a
 carrier for the EF packages it happened to depend on, which meant the EF version was decided by
 somebody else's release, was pinned at 8.0.x on a net9.0 target, and dragged in a SQL Server
 provider stack (Microsoft.Data.SqlClient and its native SNI runtime) that nothing in this
 package can select. EF Core 9.0.x and the Sqlite, MySQL and PostgreSQL providers are now named
 directly. SQL Server is deliberately absent: Provider "sqlserver" fell through every branch of
 OnConfiguring and left the context with no provider configured, so it has never been a working
 option and shipping the client library implied otherwise.

Migration: existing databases need 00005, which adds clients.backchannel_logout_uri and
clients.backchannel_logout_session_required, sessions.browser_id, and the session_clients table.
Every change is additive and defaulted — existing clients register no logout URI and are not
notified, and sessions that predate the column have no browser to name and are treated as their
own. On SQLite it is applied on start-up and recorded in ark_schema_history, so there is nothing
to run by hand. Only the SQLite scripts ship in this package: on MySQL or PostgreSQL the
equivalent ALTER TABLE and CREATE TABLE are still yours to apply, and skipping them fails the same
way a missing 00004 did — the entities carry columns the tables do not.

2.0.2 — provisioning, activation, branding, and self-applying schema updates.

* **Provisioning API.** POST /api/oauth/v1/provision/client registers an application, creates or
 reuses a user, and adds the user-client access mapping in one call. An existing client name is
 refused with HTTP 409 and code "client_exists" and nothing is written — a live application's
 redirect URIs are never silently rewritten. An existing user is reused and mapped, which is what
 happens when somebody is given their second application. A user this creates signs in
 immediately on ark_oauth_server:DefaultPw; pass send_activation_email to email a link instead.
* **Activation, at two levels.** Applications already had is_active; accounts now have one too.
 POST /api/oauth/v1/activation/client and /activation/user switch either off, and revoke what has
 already been handed out — a deactivated client loses its refresh tokens, a deactivated user
 loses their sessions and refresh tokens — so the switch takes effect now rather than whenever
 they happened to expire. The switch is honoured through the plain client/user upsert too.
* **Sign-in says which level is off.** A deactivated application names itself on the authorization
 endpoint; a deactivated account gets "Your account has been deactivated…" on the sign-in page.
 Both only after the password has been verified, so the single deliberately-vague message for
 every credentials failure — and with it the page's resistance to account enumeration — is
 unchanged.
* **Pending schema scripts run on start-up.** The scripts in Migration/{provider}/up were an
 operator's job after every upgrade, and skipping one failed quietly and specifically: without
 00004 the entity carried users.is_active and the table did not, so /api/oauth/v1/user/list
 answered a bare 500 and the console's Users grid came up empty with nothing saying why. The
 bootstrap now applies what is pending and records it in ark_schema_history.
* **Nothing is replayed.** A database that predates the history table is measured rather than
 replayed: each script is checked against the live schema and one whose tables and columns are all
 present is recorded as a baseline without executing. 00003 rewrites every client that holds no
 secret — right for a 2.0.0 upgrade, wrong for anything after it — so that distinction is the
 whole point. A database created by EnsureCreated on this version records all four and runs none.
* **Provisioning and Activation have their own console page**, /{tenant}/admin/provisioning, linked
 from a navigation bar in the console's top bar and restricted to the administrator account
 (AdminUser:Username, or a principal carrying an "admin" claim). It carries the provisioning form,
 both activation switches, and the state of every client and account at once.
* **The page writes the curl for you.** Fill either form in and the equivalent command appears,
 carrying the values that are in the forms — the provisioning body, the activation body, and a
 client_credentials token step. The secret is the one thing the page cannot read back, so a button
 mints a new one for the machine client and drops it straight into the command.
* **Client logos.** Uploaded in the client editor or at provisioning time and inlined as a data
 URI, so nothing has to be hosted. The sign-in page header now carries the host logo and the
 client logo together, and lays itself out for two marks, one, or none — the previous header
 showed only the client's, with the host's relegated to the footer. The console's top bar shows
 the same lockup, and the client grid shows each client's mark.
* **The client setup page can run the flow.** /{tenant}/oauth2/integrate/{client_id} gained a live
 authorization code + PKCE section: it generates a real verifier and S256 challenge in the
 browser, runs the request in an embedded iframe ending at the redirect_uri you pick, and shows
 the token-exchange command for the code that comes back.
* The interactive pages now send Content-Security-Policy: frame-ancestors 'self' — clickjacking
 protection they did not have, and what lets the setup page frame the authorization endpoint.
* The management API's list endpoints report a failure as { error, msg } like every other endpoint
 instead of an empty 500, and /api/migration/v1/sql now reports whether the script it ran actually
 worked rather than always answering "executed".

Migration: existing databases need 00004, which adds users.is_active. It is one additive, defaulted
column, so every existing account stays active. This version applies it on start-up, so there is
nothing to run by hand, and a database created by this version already has it.

2.0.1 — maintenance release.

No API or protocol change over 2.0.0. Rebuilt and republished so the package on nuget.org matches
the 2.0.0 source tree exactly, and to carry the packaging fixes below. Consumers on 2.0.0 can
upgrade with no code change; the 2.0.0 notes apply unchanged and are kept below.

Packaging: the package icon (ark_logo.png) and the readme are packed at the root of the .nupkg, so
nuget.org and the Visual Studio package manager show both. The icon is referenced through
PackageIcon rather than the deprecated PackageIconUrl, and is included with an empty PackagePath so
it lands at the package root on a non-Windows build too.

2.0.0 — the standards release.

* Full OAuth 2.1 / OpenID Connect protocol core: discovery, JWKS with two-phase key rotation,
 authorization code + PKCE (S256 only, required for public clients), refresh token rotation,
 client credentials, device authorization grant (RFC 8628), pushed authorization requests
 (RFC 9126), introspection (RFC 7662), revocation (RFC 7009), dynamic client registration
 (RFC 7591/7592), RP-initiated logout, and issuer identification (RFC 9207).
* Access tokens now follow RFC 9068 (typ: at+jwt, client_id, jti, scope).
* Codes and refresh tokens are stored as SHA-256 hashes; replay of either is treated as compromise
 and revokes the derived tokens or the whole refresh-token family.
* Per-client setup page at /{tenant}/oauth2/integrate/{client_id}, generated from the client's own
 registration, with copy-paste config for the Ark client, the raw ASP.NET Core handler,
 oidc-client-ts, Authlib and go-oidc.
* Sign-in and consent pages load no third-party resources and work under a strict CSP.
* The admin console now ships inside this package, at /{tenant}/admin — tenants, clients, users,
 scopes, claims and the access mapping, with no view, stylesheet or script to copy into the host.
 Its CSS and JS are served from the assembly at /ark-admin/asset/{file}. Point
 ark_oauth_server:Admin:SignOutUrl at your own sign-out route, since only the host can drop its
 own authentication cookie. The v1 console at /oauth/{tenant}/v1/server/{client}/manage is still
 served and no longer developed.

Breaking / migration: the administrator account seeded into a new database now comes from
ark_oauth_server:AdminUser (Username, Password, Name) instead of the compiled-in "admin" / "admin".
Password is required, falls back to DefaultPw, and a value left as a <<placeholder>>
counts as unset — seeding stops with a message naming the setting rather than creating an account
whose credentials are published in the release notes of every deployment. Existing databases are
untouched: the section is only read while the schema is being created.

The implicit grant, the hybrid flow and the resource owner password
credentials grant are not supported. The v1 /oauth/{tenant}/v1/... routes still work and keep their
request and response shapes, but now delegate to the protocol core — so codes issued there are
single-use, expire, and have their PKCE verifier checked. Existing databases must run migration
00003 (GET /api/migration/v1/sql?action=up&name=00003_sql.sql), which adds the protocol state
tables and RFC 7591 metadata columns, seeds the scope catalogue, and adopts each tenant's existing
RSA key as its active signing key with kid = tenant_id, so tokens already issued keep validating.

Packaging: the package no longer ships application content or static web assets into consuming
projects, and now carries a readme, an SPDX license expression and a symbol package.