Upgrading to 3.1
A 2.x deployment applies Upgrading to 3.0 first, then the items below.
Version 3.1 is not a drop-in replacement for 3.0. Interfaces a host implements gain members and parameters, many constructors change and some members are removed; some tenants and clients 3.0 served are refused; and some behavior changes with no error. Before you upgrade gathers what decides the rollout, what a host's own store changes in its records, the log records an alert moves to, and the checks to run in staging.
The changes fall into three groups: what fails to build, what stops the host at startup or leaves a stored tenant unserved, and what behaves differently at runtime with no error. The last group is the one to read closely, because nothing in the build or the log points at it; where a startup item loses a setting without an error, the runtime group points back to it.
Before you upgrade
Rollout and rollback
Replace all instances at once, rather than in a rolling update that mixes 3.0 and 3.1 nodes, when the deployment:
- uses resource indicators or token exchange audiences: 3.0 reads a refresh token issued by 3.1 as granting no resource and naming no audience (below);
- registers
client_secret_jwtclients: a 3.0 node cannot authenticate one that 3.1 registered, since 3.1 keeps the value of its secret only as an encrypted copy (below); - serves dynamic registration with a client store the nodes share. A 3.0 node handling a registration or an RFC 7592 update rebuilds the client from its 3.0 model and writes the whole record, so the members 3.0 does not know are lost:
Trust(the client then reads as trusted),SoftwareStatement(later updates stop applying it), the encrypted copy of a client secret 3.1 registered (client_secret_jwtthen fails for that client on every node) andCrossClientSubjectTokenExchange. A deployment that rolls routes the registration and client configuration endpoints to 3.1 nodes only, from the moment a 3.1 node writes a client. A store that patches the stored JSON rather than rewriting the record keeps these members.
3.1 reserves the single-use identifier (jti) of a client assertion, a DPoP proof and a JWT bearer grant assertion under new keys and reads none of the keys 3.0 used, so a value 3.0 accepted just before the switch is accepted once more by 3.1 while it is still valid: a client assertion up to its exp, capped by OidcOptions.ClientAssertionMaxLifetime (one hour by default), a DPoP proof within OidcOptions.DPoP.IssuedAtTolerance (one minute by default), a JWT bearer assertion up to its exp, or one hour without one. During a rolling update the two versions do not see each other's reservations for the whole rollout. Replace every node at once; to close the window, lower ClientAssertionMaxLifetime, and DPoP.IssuedAtTolerance where needed, before the switch, and restore them once the values accepted before it have expired. Authorization codes, pushed authorization request URIs, device and CIBA records, revocation records and back-channel logout tokens keep their keys.
A rollback to 3.0 leaves the client_secret_jwt clients registered by 3.1 unable to authenticate (below) and reads the refresh tokens 3.1 issued as granting no resource, so a deployment with either does not roll back while they are alive.
Stored client records
A host keeping clients in a store of its own (a tenant store or an ITenantClientRegistrationStore) checks its records before the upgrade:
- A client with
AllowCrossClientSubjectTokenExchangeset totruegetsCrossClientSubjectTokenExchangeAny, orAddressedToClient(below). - A hash stored only under
Sha256HashBase64,Sha512HashBase64,Sha256HashHexorSha512HashHexmoves toSha256HashorSha512Hash: under an alias it reads as no hash (below). - A hash 3.0 computed for a secret with non-ASCII characters is computed again, or the secret is issued anew (below).
- A null where a value is required, such as a client's
TokenEndpointAuthMethod, gets a value (below). - A client registered while registration was open gets
"Trust": "untrusted". A host that cannot tell which clients those are writes it into every dynamically registered record and setsTrustedon the clients it has checked. Read one migrated client back through the store and checkClientInfo.Trust: a record written in camelCase and read with the default options reads as trusted (below). - Members the store does not know itself,
Trust,SoftwareStatementandClientSecret.EncryptedValueamong them, are kept, and a record is written and read with the same JSON serializer options. - Redirect URIs that 3.1 refuses or no longer matches are found before an end user meets them: an
httpor private-use URI of a client that is not native, a query naming a parameter of the authorization response, and a URI a client sends in another spelling, such as another host case, a default port written out or a trailing slash (below, below). - The store looks a client up by its identifier exactly as written, letter case included. A record it returns for an identifier in another case is taken as no client, answered
invalid_client. Two registrations whose identifiers differ only in case are the store's to refuse (below).
Alerts keyed on event ids
- 2015 is no longer logged; its refusals are logged under 2014 (below).
- 3094 is no longer logged; its refusals are logged under 3018 and 3027 (below).
- New warnings: 10660, a client secret that no longer decrypts (below), and 10780, a public client declaring refresh token reuse without DPoP (below).
- New errors: 10700 and 10701, a stored tenant left out (below).
- New Information records: 11120, 11121, 10680, 10681, 10682 and 10628, one per token response, per registration change and per client resolved from a metadata document (below).
Checks in staging
- Start 3.1 against a copy of the tenant store and search the log for
left out of the tenants served. - Compare each tenant's discovery document with 3.0:
token_endpoint_auth_methods_supportedkeeps only the methods the security profile admits, andtls_client_authonly where the tenant lists certificate authorities. - Sign a test user in and out in the browser, and check that a refresh token of that session is refused, unless the deployment sets
RevokeSessionTokensOnLogoutto false. - Renew a refresh token issued by 3.0, and run one token exchange of a token issued to another client.
- Authenticate a
private_key_jwtclient whose keys come from itsjwks_uri. Without the proxy setting a fetch the network refuses logs event 6005, and an address the guard refuses 6004 (below). - Register a test client with every grant type and resource the deployment's clients use, and read one dynamically registered client back to check its
Trust. - Call registration, pushed authorization requests and introspection from a browser origin, where the deployment serves them: they need
app.UseCors()(below). - Set
OidcOptions.FingerprintKeyto the same value on every node, and check that one end user's records carry one fingerprint across nodes (below).
What fails to build
A host that constructs the library's classes itself passes the new constructor arguments listed below.
SubjectTokenContextgains the requiredSessionIdandAuthenticationTimeand the optionalIdentityProvider,AuthContextClassRefandAuthenticationMethodReferences. A host'sISubjectTokenResolversets the two required members or does not compile (CS9035).TokenExchangeGrantHandlertakes only anIServiceProvider.RefreshTokenSubjectTokenResolvertakes(IAuthServiceJwtReader, IRefreshTokenService, IRevocationCutoffChecker), andJwtSubjectTokenResolverno longer takes anIClientInfoProvider.IntrospectionRequestValidatorandRevocationRequestValidatortake anIAuthServiceJwtReaderwhere they took anIAuthServiceJwtValidator.RevocationRequestProcessortakes aRegistrationAccessTokenRevocationas its third parameter.ReadClientRequestProcessortakes anIClientSecretEncryptoras its last constructor parameter.RegisterClientRequestProcessorandUpdateClientRequestProcessorno longer takeNewClientOptionsand end with anIClientSecretEncryptorfollowed by anIOptionsMonitor<OidcOptions>, andUpdateClientRequestProcessorandRemoveClientRequestProcessortake anILoggerof their own type as their first parameter.ClientCredentialFactorytakes anIOptionsMonitor<OidcOptions>in place ofNewClientOptions, andOfflineAccessValidatorhas one constructor, taking anIOptionsMonitor<OidcOptions>.NewClientOptionsis no longer a service of its own: the server reads it only fromOidcOptions.NewClientOptions. A host that configured or resolved the service setsOidcOptions.NewClientOptionsinstead, throughAddOidcServicesorConfigure<OidcOptions>.NewClientOptions.AllowedResourcesis a non-nullable array, so code assigningnullto it does not compile (below).BackChannelClientAuthenticationCheckis removed, so a host that registered or constructed it drops that line. The shared check of the grants a public client may not hold (below) covers the backchannel grant.IClientInfoProvider.TryFindClientAsyncis replaced byFindClientAsync, which returns the client or why it is absent:Unknown, orRefusedandTemporarilyUnavailable, which come only from Client ID Metadata Documents and are experimental (ABX9001). The request's client lookup now reaches the client store,IClientAuthenticator,IClientJwtValidator, the authorization request fetchers, the authorization and pushed authorization request validators, the authorization response encoder and the response JWT builder, so a host that implements, decorates or calls any of them changes its code.ConfirmationValidatortakes anISessionClientRegistry. The MVCEndSessionResponseFormattertakesIFrontChannelLogoutService,ITenantAccessorandIUriResolver, the Minimal API oneIFrontChannelLogoutService,ITenantAccessorandIHttpContextAccessor.- The mutual TLS authenticators take a
TimeProvider. The JWT assertion authenticators andSigningAlgorithmsValidatortake anIOptionsMonitor<OidcOptions>.ClientJwtValidator,ClientEncryptionKeyResolverandEncryptedResponseAlgorithmsValidatortake anIClientSecretEncryptor.AuthorizationHandlertakes anIRedirectUriTrustPolicy(below), anIAuthSessionServiceand anIRevocationCutoffChecker. IClientJwtValidatorgainsValidateSecretSignedAsync, which a host implementing the interface adds.JwtAssertionAuthenticatorBasegains the protected abstractReads, which a host's own subclass implements: it answers from the assertion's JOSE header alone whether the authenticator judges that assertion. Theclient_secret_jwtauthenticator reads an assertion signed with HS256, HS384 or HS512 and a JWE; theprivate_key_jwtone reads an assertion signed with its asymmetric algorithms, a JWE, and one whose algorithm no method claims. An assertion an authenticator does not read is left to the other method, without a log line.- Token reading takes the request's client lookup as a parameter:
IAuthServiceJwtValidator.ValidateAsyncandIAuthServiceJwtReader.ReadAuthenticAsynctake anIClientInfoProviderafter the client, andIAuthServiceJwtReader.ReadRecordsAsync,TokenStatusCheck.CheckAsyncandIRevocationCutoffChecker.CheckAsynctake one after the tenant. So doIAuthorizationGrantHandler.AuthorizeAsync, after the client, andISubjectTokenResolver.ResolveAsync, after the client, which a host's own grant handler or subject token resolver changes too. - The constructors of
AuthServiceJwtValidatorandRevocationCutoffCheckerno longer take anIClientInfoProvider, and those ofIdTokenHintParser,RegistrationAccessTokenValidatorandInitialAccessTokenValidatorgain one.GrantRevocationtakes only anITokenRegistry, and itsRevokeAsynctakes the refresh token's client instead of looking it up.RefreshTokenGrantHandlertakes(IAuthServiceJwtReader, IRefreshTokenService), andIntrospectionRequestProcessoronly anISubjectTypeConverter.ValidRevocationRequesttakes the authenticated client, andValidIntrospectionRequestthe token's client too, as its newTokenClient. TokenValidationContextgainsClients, which the token endpoint'sClientValidatorsets; reading it before then throws, so a host replacing that validator sets it.ClientInfo.AllowCrossClientSubjectTokenExchangeis replaced byClientInfo.CrossClientSubjectTokenExchange:falsebecomesRefused, the default, andtruebecomesAny(below).SubjectTokenContextalso gainsActorChainWith, andAudiences,ProofKeyThumbprintandCertificateSha256Thumbprint, which a host's own subject token resolver sets.Audiencesis the subject token's audience, whichAddressedToClientmatches to exchange another client's token addressed to the presenting client (below). The two thumbprints name the DPoP key or client certificate a token of this server is bound to, which the client the token was issued to proves to exchange it (below).- A host's own
IRefreshTokenServiceimplementsRotates, andRefreshTokenRotationPolicy.Rotatestakes the payload of the presented refresh token.AuthorizationCodeReusePreventingDecoratortakes aGrantRevocationand aTimeProvider, andRefreshTokenReusePolicyChecka logger. SecurityProfileRequirements.RequireAccessTokenOutsideQueryandHttpResponseExtensions.AddPrivateCacheDirectiveare removed; a host that uses them drops those lines.SecurityProfileRequirements.RequireMatchingClientIdentifiersis removed, so a host that sets it drops that line: the server refuses aclient_idnaming a different client from the one the credentials identify, for every client (below).TokenStatusCheck,RegistrationAccessTokenRevocationandClientRequestValidatortake aRegistrationAccessTokenBindingin their constructors,ClientRequestValidatorin place of anIClientInfoManager.AuthorizationErrorgainsRefusal.UserInfoRequest.AccessTokenInQueryandUserInfoRequest.AccessTokenare removed; readAccessTokenInForm(below).- The token endpoint's
ClientValidatortakes anIAuthServiceJwtReader. OidcErrorgainsBasicChallengeOwed. A host replacing a producer ofinvalid_clientsets it to keep the Basic challenge (below).ClientRegistrationResponse.SoftwareStatementmoves to its baseRegisteredClientMetadataunder the same name and JSON member, so code setting it on aClientRegistrationResponsestill compiles.JwtBearerOptions.StrictAudienceValidationis[Obsolete]and changes nothing. Delete the line that assigns it: underTreatWarningsAsErrorsit fails the build with CS0618.
What stops the host at startup or leaves a stored tenant unserved
Tenants read from a store
A tenant read from a tenant store that fails any check of the tenant list is not served after the upgrade. Requests to it are answered as if no tenant matched, while the other tenants are served, so the host starts and a health check of it stays green.
Before production, start 3.1 in staging against a copy of the tenant store and search the log for left out of the tenants served: the errors logged under event id 10700 (refused by a check, with the tenant ids and the reason) and 10701 (a tenant that could not be readied). A tenant declared in the settings that fails a check stops the host at startup instead. A tenant catalog of the host's own gets none of these checks.
Client secret encryption for dynamic registration
A host serving dynamic client registration (AddDynamicClientRegistration()) sets TenantDefinition.ClientSecretEncryption on every tenant. A tenant in the settings without it stops the host at startup, naming the tenant and the setting; a tenant read from a store without it is left out. A tenant catalog of the host's own is not checked, so a tenant it hands out carries the setting, or registrations at that tenant fail.
Keyis a base64-encoded random value of at least 32 bytes, for example the output ofopenssl rand -base64 32. Keep it in a secret store, and use a key of its own rather than the pairwise salt.HashAlgorithmisSHA256(the default when absent),SHA384orSHA512.
Each client secret the tenant issues at registration is then kept encrypted beside its hash, so a read or an update of the registration returns client_secret, as RFC 7592, Appendix A.1 requires of a read or update response. client_secret_basic and client_secret_post still compare the hash; client_secret_jwt keys its HMAC with the decrypted copy. ClientSecret gains EncryptedValue, which a host's client store keeps exactly as given; JSON stored by 3.0 reads unchanged.
- A client registered before 3.1 holds only the hash of its secret, so a read of its registration answers without
client_secret, since the server holds no copy it could return. - Replacing
ClientSecretEncryption.Key, or changingHashAlgorithm, leaves aclient_secret_jwtclient registered by 3.1 or later unable to authenticate or to receive JWTs encrypted with a symmetric key, and a read of its registration answers withoutclient_secret; event id 10660 is logged as a warning. Clients stored with a plaintext secret are not affected. - A node on an earlier version cannot authenticate a
client_secret_jwtclient registered by 3.1, because such a client keeps the value of its secret only as the encrypted copy, so these clients do not survive a rollback.client_secret_basicandclient_secret_postclients compare the stored hash and keep working.
Open registration with consent granted to every client
A host that grants every client everything it asks for, with the consent provider AddConsentGrantedForEveryClient() registers, while dynamic registration is open does not start. Registration is open when RequireInitialAccessToken is false and no software statement from a trusted issuer is required (SoftwareStatement.RequireSoftwareStatement together with SoftwareStatement.TrustedIssuers): anybody could then register a client and obtain an end user's tokens without the end user being asked. Keep the initial access token, require such a software statement, or register an IUserConsentsProvider that asks the end user. The same holds while Client ID Metadata Documents are on with no AllowedClientIdPrefixes, since any URL could then name itself a client.
Token settings for new clients
An empty NewClientOptions.AllowedGrantTypes, or one holding a blank value, stops the start of a host that calls AddDynamicClientRegistration() or AddClientIdMetadataDocuments(), naming the setting, since a document client's grant types are cut to it too; an empty ClientIdMetadataDocuments.AllowedGrantTypes stops the start of a host that calls AddClientIdMetadataDocuments() (below).
NewClientOptions.AccessTokenExpiresIn, NewClientOptions.SingleResourceAccessTokens and NewClientOptions.RefreshToken set these values for clients registered dynamically and clients resolved from a metadata document; an RFC 7592 update keeps what the client was given. A lifetime of zero or less, or longer than ten years, stops the host at startup.
Redirect URIs
A client declared in the tenant settings whose RedirectUris or PostLogoutRedirectUris hold a relative URI, a URI with a fragment, or a javascript, data or vbscript URI stops the host at startup, naming the client. A tenant read from a store with such a client is left out, with an error in the log. The library does not drop the invalid entry, even beside a working absolute URI: the host removes it before upgrading. RFC 6749, section 3.1.2 requires a redirection endpoint to be an absolute URI without a fragment.
A client that is not native and is declared in the settings with an http redirect URI, localhost included, or with a private-use scheme stops the host at startup; a stored tenant with one is not served, and a client from the host's own store with one is refused at the authorization endpoint. RFC 9700, section 2.6 forbids http redirect URIs except for native clients using loopback redirection, and RFC 8252, section 7.1 describes private-use schemes as a redirect for native apps.
A redirect URI whose query names a parameter of the authorization response (code, state, iss, error, error_description, error_uri, id_token, access_token, token_type, expires_in, scope, session_state or response) stops the host at startup for a client in the settings; dynamic registration and client ID metadata documents answer it with invalid_redirect_uri, and the authorization endpoint refuses it for a client from the host's own store. Post-logout redirect URIs are not affected. OAuth 2.1, section 2.3 forbids the parameters of the authorization response in the query of a redirect URI, and the server holds the parameters OpenID Connect, the implicit flow and JARM add to the same rule.
Certificate authorities for tls_client_auth
A tenant serving tls_client_auth lists the certificate authorities that issue its clients' certificates, intermediates included, in TenantDefinition.TlsClientAuthCertificateAuthorities, each as base64-encoded DER; a self-signed certificate there is a trust anchor. A tenant listing none does not serve tls_client_auth or advertise it in discovery, and registration refuses the method, so its clients using it stop authenticating with no error at startup. RFC 8705, section 2.1 describes this method as relying on a validated certificate chain. An entry that is not a readable base64 DER certificate, an entry that is not a certificate authority certificate, and a list without a self-signed anchor each stop the host at startup for a tenant in the settings, and leave a stored tenant out while the other tenants are served.
Security profiles that leave no client authentication method
A tenant whose security profile leaves none of the server's client authentication methods usable at its token endpoint stops the host at startup when declared in the settings, and is left out when read from a store. Examples are FAPI 2.0 on a host offering only shared-secret methods, and tls_client_auth as the only method of a tenant without TlsClientAuthCertificateAuthorities. The refusal names the tenant, its profile and why each method is unusable.
Cross-client token exchange
ClientInfo.CrossClientSubjectTokenExchange decides whether a client may exchange a subject token issued to another client. Refused is the default and Any admits every such token. AddressedToClient admits another client's access token only when its aud names one of the presenting client's ResourceLocations, compared as exact strings, as RFC 7519, section 2 compares a StringOrURI value. A client whose ResourceLocations name the issuer, or one set to AddressedToClient with no ResourceLocations, stops the host at startup; a tenant read from a store with such a client is left out, and the other tenants are served.
A client declared in the settings or kept in a store that still carries AllowCrossClientSubjectTokenExchange loses it without an error: no part of 3.1 reads that key, and no startup check names it. The client takes Refused, and its exchanges of tokens issued to other clients are refused. Set CrossClientSubjectTokenExchange to Any for each client that had AllowCrossClientSubjectTokenExchange set to true to keep the behavior of 3.0, or to AddressedToClient when the tokens it exchanges are addressed to it.
Native clients
A native client (ApplicationType native) declared in the tenant settings starts only with TokenEndpointAuthMethod none (the default is client_secret_basic) and with redirect and post-logout redirect URIs on a private-use scheme containing a period (com.example.app:/cb), on https, or on http to a loopback host. Credentials of each installation reach the server through dynamic registration or an ITenantClientRegistrationStore. A tenant read from a store with a native client that breaks these rules is left out, and the other tenants are served.
Dynamic registration of a native client refuses a private-use scheme without a period, and a claimed https redirect registers as a web client with token_endpoint_auth_method none.
A native client may use only response types that include code and not token, or none, so code token and code id_token token are refused as token and id_token token are. Another one stops the host at startup for a client in the settings, is refused at registration, and is refused at the authorization endpoint. RFC 8252, section 8.2 recommends against the implicit flow for native apps, and RFC 9700, section 2.1.2 recommends against it for every client.
RFC 8252 sets these rules. Section 7.1 requires a private-use scheme based on a domain name the app controls, in reverse order, and section 8.4 recommends that a server reject one without a period. Claimed https redirects are section 7.2, loopback redirects section 7.3. A secret built into an app distributed to many users is not a confidential secret, and section 8.5 requires the server to treat such a client as public.
Grants a public client may not hold
A client authenticating with none may not hold the client_credentials, password, urn:ietf:params:oauth:grant-type:jwt-bearer or urn:openid:params:grant-type:ciba grant. Such a client declared in the tenant settings stops the host at startup, naming the client; a tenant read from a store with one is left out, and the other tenants are served. Move the client to a method that authenticates it, or drop the grant.
A dynamic registration or an RFC 7592 update asking for such a grant is refused with invalid_client_metadata, and the token endpoint, like the backchannel authentication endpoint for the backchannel grant, refuses it to a public client from the host's own store with unauthorized_client.
A client ID metadata document of such a client loses these grants, and its backchannel delivery mode and notification endpoint too, whether it declares the backchannel grant or not, so the client is served without the flow rather than refused, unless it is pairwise and took its sector through that mode (from its jwks_uri in poll or ping mode, from its notification endpoint in push mode).
RFC 6749, section 4.4 requires that only confidential clients use client_credentials. CIBA Core 1.0 requires the client to authenticate at the backchannel authentication endpoint (section 7.1) and at the token endpoint in poll and ping mode (section 10.1). The server holds the password and JWT bearer grants to the same rule.
Client identifiers compared exactly
A client is recognized only by its client_id exactly as it was declared or registered, letter case included, in a registration store of the host's own too. Two clients in the settings whose ids differ only in case stop the host at startup, and a tenant read from a store with two such clients is left out. The server also refuses a registration whose id differs only in case from a client it holds; a host's own registration store keeps that rule itself, and looks a client up by its id exactly as written: a record it returns for an id in another case is taken as no client.
Dynamic registration assigns every client_id: a client_id in the registration request is replaced by one the server generates, so a registrant that sends one gets 201 with a different one. RFC 9700, section 4.15.1 recommends against letting clients influence their client_id where client and user identifiers share a namespace, and RFC 7591, section 3.1 describes the identifier as assigned by the server. A host that lets registrants choose sets NewClientOptions.AcceptProposedClientId (false by default). Registration then refuses a proposed id that differs only in case from a registered one, answered as already registered, and, while Client ID Metadata Documents are enabled, one that is an https URL. An RFC 7592 update keeps the client's own client_id.
Nulls in a tenant definition
A tenant holding a null where its types declare a value (a member or a collection element whose nullable annotation rules null out) is refused alone, with Tenant '<id>': <path> is null, where a value is required. From the settings it stops the host at startup; from a store it is left out and the other tenants are served. Every endpoint of a left-out tenant answers 404, discovery and the key set included, until a reading of the store (every RefreshTenantsEvery, one minute by default) finds it fixed. Members 3.0 accepted as null count, such as a client's TokenEndpointAuthMethod written as null in a stored definition.
Client assertion lifetime
OidcOptions.ClientAssertionMaxLifetime of zero or less stops the host at startup (below).
Binding message length
BackChannelAuthenticationOptions.MaximumBindingMessageLength of zero or less stops the host at startup (below).
Outbound proxy and allowed destinations
A SecureHttpFetchOptions.OutboundProxy or SharedSignalsTransmitterOptions.OutboundProxy that is not an absolute http, https, socks4, socks4a, socks5 or socks5h address without a path, query or fragment, with a port where the scheme has no default one, stops the host at startup, and so does an invalid SecureHttpFetchOptions.AllowedDestinations entry.
What behaves differently at runtime, with no error
Sessions and refresh tokens
- Ending a session revokes the tokens issued in it:
OidcOptions.RevokeSessionTokensOnLogoutis nowtrueby default. After the end user signs out, or signs in as someone else in the same browser, every refresh token of that session is refused, and so is its access token at introspection and at the UserInfo endpoint. This includes native clients that signed in through that browser, and device or CIBA grants the host recorded under that session. An authorization code issued in the session and not yet redeemed is refused too, and so is any of its tokens presented to a token exchange. A deployment whose native applications stay signed in after a browser sign-out setsoptions.RevokeSessionTokensOnLogout = falseinAddOidcServices. - A client gets a refresh token only when two conditions hold. First, its
ClientInfo.OfflineAccessallows offline access: a client the host declares has itDisabledunless set, and a dynamically registered client takesNewClientOptions.OfflineAccess,ConsentRequiredby default, which gives offline access only to an authorization request withprompt=consent. Second, it may redeem one: itsAllowedGrantTypesincluderefresh_token, or token exchange withTokenExchangeAllowedSubjectTokenTypesadmitting the refresh token type. - A client with no
AllowedGrantTypes, and a registered client withoutgrant_types, takeauthorization_codeonly, so they get no refresh token untilrefresh_tokenis added. For a client that may not redeem one,offline_accessis dropped at the authorization, device authorization and backchannel authentication requests and at the token endpoint, so the end user is not asked to consent to it and no access token carries it. A host'sIUserDeviceAuthenticationHandlershows the end userValidBackChannelAuthenticationRequest.Scope, which leaves a droppedoffline_accessout, rather thanModel.Scope. - A public client's refresh token rotates on every use unless it is bound to a DPoP key, whatever
RefreshTokenReusePolicythe client declares. A public client declaring reuse withoutRequireDPoPis still served, and event id 10780 is logged as a warning naming the tenant and the client. RFC 9700, section 2.2.2 requires a public client's refresh tokens to be sender-constrained or rotated. Such a client presenting a refresh token that was already replaced loses the whole grant, since the server reads it as a replay and revokes every token of that grant, so a retried refresh or two browser tabs sharing one token sign the user out of the client. - When the presented refresh token rotates, a refresh request naming a narrower scope gets a new refresh token with the scope of the presented one, as RFC 6749, section 6 requires.
- A refresh token is addressed to the issuer: its
audis the issuer identifier, and the resources and token exchange audiences of the grant travel in claims only the server reads. A deployment using resource indicators or token exchange audiences replaces all its instances at once rather than in a rolling update that mixes 3.0 and 3.1, and does not roll back to 3.0 while refresh tokens issued by 3.1 are alive, because 3.0 reads such a token as granting no resource and naming no audience. A refresh token issued by 3.0 keeps renewing for the resources and audiences it was issued for: 3.1 reads them from itsaudwhen the server's own claims are absent. - A refresh token older than its client's current absolute lifetime (
RefreshToken.AbsoluteExpiresIn) is refused: withinvalid_grantat the refresh token grant, and withinvalid_requestas thesubject_tokenof a token exchange. - A reused authorization code revokes the refresh token family its first redemption started, and a code whose stored grant records no family revokes the tokens recorded with it. RFC 6749, section 4.1.2 recommends revoking the tokens issued on a code used more than once, and RFC 9700, section 4.2.4 repeats that recommendation.
- An ID token carries
sidonly for a client withBackChannelLogoutset, or withFrontChannelLogoutwhoseRequiresSessionIdis true. An ID token withoutsidis refused as thesubject_tokenoractor_tokenof a token exchange (below). - A logout request whose
id_token_hintcarries nosidends the session without asking when the hint names the signed-in end user, carries that session's authentication time and was issued to a client that signed in to it. Otherwise the end user is asked to confirm. RP-Initiated Logout 1.0, section 2 requires the question when noid_token_hintis given or the ID token does not belong to the current session with that client, and section 6 gives the reason: a logout request without a valid hint can force a sign-out. - With the new
TenantDefinition.LogoutConfirmationUriset, the end session endpoint sends the browser to that page to ask (303, with the request's parameters and the confirmation value, andReferrer-Policy: no-referrer) instead of answering 400 with JSON. The host builds that page. When the end user declines, it must not follow thepost_logout_redirect_urifrom its query: section 3 forbids post-logout redirection to an address that does not exactly match one the client registered. The page asks and sends the answer back to the end session endpoint, by GET or POST. Left unset, the endpoint answers 400confirmation_requiredwith the confirmation value, as before.
Reading and validating tokens
- The UserInfo endpoint answers only access tokens issued for an end user, as OpenID Connect Core 1.0, section 5.3 describes it; a token from the client credentials grant gets 401
invalid_token. - A token from the client credentials grant carries
idpclient_credentials, and introspection shows thatidpto every authorized caller; an end user'sidpstays withheld from other clients. A resource server tells a client's own token from an end user's byidp, not bysubequal toclient_id: for a pairwise clientsubis the client's pseudonym. - The UserInfo endpoint reads the access token from the
Authorizationheader or the form-encoded body and ignores anaccess_tokenin the query, as OAuth 2.1, section 5.1 requires of a resource server. A request carrying one beside a token in the header or the body is answered with that token, where it was refused withinvalid_request, and a repeated or emptyaccess_tokenin the query is ignored too. A token in the query alone is answered as a request without a token: 401 with a bareBearerchallenge, which RFC 6750, section 3.1 recommends for a request without authentication. - A token request naming a grant type the server has no handler for is answered
unsupported_grant_typeeven when the client is not allowed that type, where such a client gotunauthorized_client. Grant types are compared exactly, so one differing only in letter case is unsupported. - A
code_verifierthat is not 43 to 128 characters from the unreserved set (A-Z,a-z,0-9,-,.,_,~), as OAuth 2.1, section 4.1.1 defines it, and acode_verifiersent for a code issued without acode_challenge, are answeredinvalid_requestwhere they gotinvalid_grant(section 3.2.4). A missing or mismatchingcode_verifierstaysinvalid_grant. Aplaincode challenge shorter than 43 characters can no longer be redeemed, since its verifier is the challenge itself. - A token request for a code issued with a
code_challengemay leave outredirect_uri, whether or not the authorization request named one, as OAuth 2.1, section 10.2 describes; one that is sent is identical to the URI the code was issued at. For a code issued without PKCE the rule of RFC 6749 stays, and a missingredirect_urithere is answeredinvalid_requestwhere it gotinvalid_grant. - Revocation, introspection, the refresh token grant and the token exchange of a refresh token read tokens through
IAuthServiceJwtReader, whichAuthServiceJwtValidatorimplements and which is registered apart fromIAuthServiceJwtValidator. A host that replaced or decoratedIAuthServiceJwtValidatorregisters the same behavior forIAuthServiceJwtReader, or those four read tokens without it, with no error: a check the host added there no longer runs at them. - A signed request object (authorization, pushed authorization and backchannel authentication endpoints) and a CIBA
login_hint_tokenthat carry anaudmust name the issuer identifier exactly asTenantDefinition.Issuerwrites it. Anaudnaming only the endpoint address is refused. An object withoutaudis accepted. RFC 9101, section 4 recommends the issuer identifier as the audience of a request object. - The JWT bearer grant (RFC 7523 authorization grant) accepts an
audnaming the issuer identifier, the token endpoint on the issuer's scheme, host and port, or its mutual TLS alias where the tenant has one. RFC 10070, section 4, which replaces this rule of RFC 7523, allows an authorization grant to identify the server by either its issuer identifier or its token endpoint URL. This assertion is a different one from the JWT a client authenticates with: the same section requires that JWT to name the issuer identifier as its only audience and forbids the token endpoint URL there (Upgrading to 3.0). Every audience refusal of the grant is logged under event id 2014, whose message carries the accepted token endpoint spellings as a list and no{ApplicationUri}; event id 2015 is not logged, so an alert keyed on it moves to 2014. A host constructingJwtBearerAssertionPolicyitself with the six-parameter constructor accepts only the issuer identifier; the constructor taking anIServiceProvideraccepts the token endpoint too. - A native client (
ApplicationTypenative) and a public client (TokenEndpointAuthMethodnone) use PKCE whateverClientInfo.PkceRequiredsays:ClientInfo.EffectivePkceRequiredis true for them, so the authorization endpoint refuses their code request without acode_challenge, clients in the host's own store included. Registration refusespkce_required: falsefor such a client. A confidential web client keeps the opt-out. RFC 9700, section 2.1.1 requires PKCE from public clients. - At the authorization endpoint, a request object naming an unknown client is answered
unauthorized_client, and a request object orrequest_urinaming a client whose metadata document is refused is answeredinvalid_client. Neither is redirected to the client. - Only
AuthorizationCodeGrantHandlercompares the token request'sredirect_uriwith the grant'sAuthorizationContext.RedirectUri; a host's ownIAuthorizationGrantHandlerthat setsRedirectUriand needs the comparison makes it itself.
Client authentication
- With
client_secret_basic, the server decodes the client id and secret asapplication/x-www-form-urlencoded, the encoding RFC 6749, section 2.3.1 describes for the client:+is a space,%XXa byte, and a%without two hex digits refuses the credential. A client whose id or secret holds%or+sends it encoded.client_secret_postwas form-decoded before, andclient_secret_jwtis not affected. IHashServicehashes the UTF-8 bytes of a secret. A hash 3.0 computed for a secret with non-ASCII characters no longer matches, because 3.0 hashed each such character as?, and the client getsinvalid_clientuntil the secret is hashed again or issued anew. Generated secrets and secrets of ASCII characters only are not affected.- A
client_idparameter naming a different client from the one the credentials identify is refused, at the pushed authorization request endpoint withinvalid_client. RFC 7521, section 4.2 requires aclient_idsent beside an assertion to identify the client the assertion authenticates. OidcOptions.ClientAssertionMaxLifetime(one hour by default) bounds aprivate_key_jwtorclient_secret_jwtassertion: one whoseexplies further than that past itsiat, or past the current time and the client's forward clock skew, is refused. A value of zero or less stops the host at startup. RFC 7523, section 3 notes that the server may reject anexpunreasonably far in the future.private_key_jwtrefuses an assertion signed with an HMAC algorithm. OpenID Connect Core 1.0, section 9 has aprivate_key_jwtclient sign with the key it registered; an HMAC over the client secret isclient_secret_jwt.client_secret_jwtaccepts only the HS algorithms its secret is long enough to key: RFC 7518, section 3.2 requires a key at least as long as the hash output. A generated secret is 64 bytes by default; a secret under 32 bytes the host declares keys no algorithm.self_signed_tls_client_authrefuses a certificate outside its validity period.- Under a security profile requiring sender-constrained tokens, a client registered for certificate-bound access tokens that presents no client certificate at the token endpoint, for example at the top-level endpoint instead of its mutual TLS alias, is refused with
invalid_client, and the description names the certificate and the alias. A client that expectsinvalid_dpop_prooffor that request gets the new code. RFC 8705 defines no error for this case; the server answers it as RFC 8705, section 2 describes for a missing certificate in mutual TLS client authentication. - A refusal of client authentication (
invalid_client) is answered 401 withWWW-Authenticate: Basicwhen the request itself authenticated with HTTP Basic in theAuthorizationheader, as OAuth 2.1, section 3.2.4 requires, whatever method the client is registered for. Any other request, from aclient_secret_basicclient that sent its credential elsewhere or sent none included, gets 400 without a challenge at the token, revocation, pushed authorization request and device authorization endpoints, which the section allows, where it got 401 with a Basic challenge. The backchannel authentication endpoint (CIBA Core 1.0, section 13) and the introspection endpoint (RFC 7662, section 2.3) keep 401, without a challenge. A client that reads the status rather than theerrormember changes. - A refresh token request with no client credential and no
client_idis authenticated as the client its refresh token was issued to, so a public client may leaveclient_idout, as OAuth 2.1, sections 3.2.2 and 4.3.1 allow; such a request gotinvalid_clientbefore. A confidential client still authenticates, and a request whose refresh token cannot be read staysinvalid_client. - A tenant without
TlsClientAuthCertificateAuthoritiesno longer servestls_client_auth, and its clients using it stop authenticating with no error at startup (above). - Event id 3094 is no longer logged; its refusals are logged under 3018 and 3027, so an alert keyed on it moves.
Authorization endpoint
- Every client carries
ClientInfo.Trust,TrustedorUntrusted, decided once when the client is created and stored with it as the JSON stringtrustedoruntrusted, so every replica reads the same value. A client declared in the tenant settings is trusted unless the host setsUntrusted. A client registered dynamically while registration is open (above) is untrusted, and one registered while it is closed is trusted. A client from a metadata document is untrusted unlessAllowedClientIdPrefixeshas entries. A registrant cannot set or change it: it is not registration metadata, registration responses do not return it, and an RFC 7592 update keeps it. - A client record stored by 3.0 names no trust and reads as trusted. A host that ran dynamic registration without an initial access token writes
"Trust": "untrusted"into the records of those clients, or their authorization errors keep being redirected after a login. The store writes and reads the record with the same JSON serializer options: a record written in camelCase and read with the default options readstrustas absent, that is, trusted. - Changing
RequireInitialAccessTokenlater leaves the clients registered before as they were. A host that decides to trust a client writes itsTrustto its store, and replicas see it on the next lookup of a registration, at the next reading of the tenant store (RefreshTenantsEvery) for a declared client, and withinClientIdMetadataDocuments.MaximumCacheDurationfor a client from a metadata document. - An authorization error for an untrusted client is answered by the server with 400 at once, whether an end user is signed in or not, instead of being redirected. A host that trusts such clients sets their
TrusttoTrustedor registers its ownIRedirectUriTrustPolicy. RFC 9700, section 4.11.2 recommends redirecting automatically only to a redirection URI the server trusts. - An authorization error that will be redirected to a trusted client while nobody is signed in, other than for
prompt=none, first sends the end user to the login page, which receives the request as it receives a valid one; the error is redirected when the page sends the request back after the login. A login page that reads the pending request meets requests the server is going to refuse. The same section requires the server to authenticate the end user before redirecting. - An authorization request without the
openidscope may leave outredirect_uriwhen the client has exactly one registered redirect URI, as OAuth 2.1, section 4.1.1 allows; the server answers at that URI. OpenID Connect requests, requests of a client with several registered redirect URIs and requests of a client held to a FAPI profile still name it. A host that relied on the server refusing such a request now sees it served. - A
code_challengethat is not 43 to 128 characters from the unreserved set is refused withinvalid_requestat the redirect URI (OAuth 2.1, section 4.1.1, RFC 7636, section 4.2), where a code was issued for it before; aplainchallenge shorter than 43 characters is refused the same way. - A
code_challengewithoutcode_challenge_methodin a request that issues a code isplain, as RFC 7636, section 4.3 defines, and is refused unless the client allowsplain. A request that issues no code keeps no method. - Discovery lists
plainincode_challenge_methods_supported(RFC 8414, section 2) only for a tenant that declares a client allowed to use it. Clients registered dynamically or resolved from metadata documents never getplain, and discovery does not see the clients of a host's own store. - The authorization and token endpoints match a redirect URI only as it was written: a different host case, an explicit default port, a percent-encoded unreserved character or a trailing slash on an empty path is a different URI. RFC 9700, section 4.1.3 requires simple string comparison. A loopback redirect URI on
127.0.0.1or[::1]still takes any port, as RFC 8252, section 7.3 requires; one onlocalhostneeds its exact port, since section 8.3 recommends againstlocalhostand section 7.3 gives the port exception to the loopback IP literals.
Token exchange
- A client that still carries
AllowCrossClientSubjectTokenExchangetakesRefused, with no error and no log record, and its exchanges of tokens issued to other clients are refused (above). Search the settings and the client store for that key before upgrading. - A host's own subject token resolver returns
Subjectand everysubofActas real identifiers, never a pairwise pseudonym. - A client exchanging its own subject token bound to a DPoP key or a client certificate presents a DPoP proof of that key, or that certificate. An exchange of another client's subject token (above) is not held to the holder's key. A public client's refresh token is accepted as
subject_tokenonly when bound to a DPoP key, otherwise the exchange is refused withinvalid_request: an exchange issues no refresh token, so it cannot rotate one, which RFC 9700, section 2.2.2 requires of an unbound one. - A token issued by token exchange belongs to the session of its subject token, carries that sign-in's
auth_time,acrandamr, and expires no later than the subject token, so revoking the session revokes the exchanged token too. A JWT subject or actor token withoutsidorauth_timeis refused. A token exchanged again without anactor_tokenkeeps the subject token'sact. - A failure a subject token resolver returns reaches the client as
invalid_request, its description prefixed withsubject_token:oractor_token:; onlyserver_errorandtemporarily_unavailablepass as the resolver wrote them. A subject token too close to its expiry to give the new token any lifetime is refused withinvalid_requesttoo. - A token issued to a pairwise client carries every
subof itsactas that client's pseudonym, as it carriessub, so a delegated access token issued to such a client by 3.0 is refused until it expires. Introspection by a caller other than the token's client returnsact: with the caller's own pseudonyms for a pairwise caller, and without anysubfor another caller.
Discovery and registration
- Discovery publishes every endpoint on the scheme, host and port of the tenant's
Issuer, whatever host the document was fetched by, and the register, read and update responses of RFC 7592 returnregistration_client_urithe same way. A consumer inside the deployment that fetches discovery by an internal name (a Docker Compose service, a cluster service name) reads the issuer's public addresses: it fetches discovery at the issuer, or names the endpoints itself. - Discovery publishes only the client authentication methods the tenant's security profile admits (a FAPI profile leaves out
client_secret_basic,client_secret_postandclient_secret_jwt, andtls_client_authappears only where the tenant lists certificate authorities), adds the lists of the revocation and introspection endpoints, leaves out an empty list, and publishes a list of signing algorithms only beside a method that uses a JWT. A client that chose its method from discovery may choose another one. RegistrationClientUriBuilder.Buildreads the tenant fromHttpContext.RequestServices, so a host calling it over anHttpContextit built itself supplies request services.- The compiler-generated equality of
ClientRegistrationRequestcompares whetheroffline_accesswas stated, so a request without the member is not equal to one statingconsent_required, although both readOfflineAccessasConsentRequired. - The aliases
Sha256HashBase64,Sha512HashBase64,Sha256HashHexandSha512HashHexofClientSecretare read from configuration only and are[JsonIgnore], so JSON carries each hash once, asSha256HashorSha512Hash. JSON written by 3.0 reads to the same hashes. System.Text.Json skips an alias on reading too, so a stored client whose JSON names a hash only through an alias holds no hash. - Introspection answers
activefalse for a registration access token once it is revoked, replaced by an update or its client is deleted; a read of the registration keeps the token. RFC 7592, section 2.3 describes a deletion invalidating the client's registration access token, and Appendix A.1 describes replacing it at a read or an update. NewClientOptions.AllowedGrantTypesnames the grant types a dynamically registered client may take. Left unset, it admitsauthorization_codeandrefresh_token; a list the host sets, in code or in configuration, is taken as written. It holds in every registration mode: open registration, an initial access token and a required trusted software statement alike, and every RFC 7592 update. A registration or update asking for another grant type, such asclient_credentials,password,implicitor the device, CIBA, JWT bearer or token exchange grant, is refused withinvalid_client_metadata. A 3.0 host whose clients register with such a grant, even while presenting an initial access token or a trusted statement, lists it there.NewClientOptions.AllowedResourcesnames the resources a dynamically registered client may reach, none by default. A client that names noallowed_resourcesgets this list, so by default it gets access tokens for no resource, and one naming a resource outside it is refused. A host whose registered clients get access tokens for resources lists those resources there.- A client from a metadata document takes the grant types that
ClientIdMetadataDocuments.AllowedGrantTypes(authorization_codeandrefresh_tokenwhen unset),NewClientOptions.AllowedGrantTypesand the server all admit, so a host giving such clients another grant names it in both lists; its resources come fromNewClientOptions.AllowedResources. - A client registered before the upgrade keeps its grant types and resources until its next RFC 7592 update, which is judged against these lists.
- The registration endpoints (registration, and reading, updating and deleting a client), the pushed authorization request endpoint and the introspection endpoint apply the library's CORS policy on both adapters, as the token, revocation, UserInfo and discovery endpoints already did, since OAuth 2.1, section 3.2 requires CORS headers for browser-based clients. A host serving any of them calls
app.UseCors(). WithOidcCorsOptionsleft empty, any origin may read their responses; a host restricting origins setsOidcCorsOptions.AllowedOriginsor defines its own policy of that name. - A
client_idin a registration request is replaced by one the server generates, unless the host setsNewClientOptions.AcceptProposedClientId(above). - Dynamic registration accepts a
token_endpoint_auth_methodexactly when discovery lists it for the tenant. - An RFC 7592 update carrying a
client_secretother than the one issued to the client is refused withinvalid_client_metadata; an update carrying none is applied as before. - Where a trusted software statement names a member, the client is registered with the statement's value rather than the request body's, as RFC 7591, section 2 requires, and an RFC 7592 update cannot replace those members. Another statement presented at an update is validated in full and sets only the members it carries that the registered statement does not; it is neither stored nor returned. A host extension reading
ClientRegistrationRequest.AdditionalMemberssees the statement's value for a member both carry.SoftwareStatementValidatorruns first among the metadata checks, so a host composing the checks by position finds it moved. ClientInfogainsSoftwareStatement, the statement the client was registered with. A store keepingClientInfoas JSON keeps one more member, and a record without it reads as a client registered without a statement. The read and update responses of RFC 7592 returnsoftware_statement, as the registration response does; RFC 7591, section 3.2.1 requires the statement in the response unmodified.
Backchannel authentication
- A
binding_messagelonger thanBackChannelAuthenticationOptions.MaximumBindingMessageLength(128 code points by default), or carrying a code point of the Unicode categories Cc, Cf, Co, Cs, Cn, Zl or Zp, is refused with 400invalid_binding_message, the error CIBA Core 1.0, section 13 defines. A bidirectional override or a zero-width character would make the device show different text from what was sent; section 7.1 recommends a relatively short message in a limited set of plain text characters. A short message with letters of any script passes, and so does a single emoji; emoji joined with U+200D do not.
Log records and traces
- The library writes Information records with stable event ids for what it hands out and changes: 11120 for the tokens a token request is answered with (every grant, CIBA push delivery included), 11121 for tokens the authorization endpoint hands out in the implicit and hybrid flows, 10680, 10681 and 10682 for a client registered, updated and removed through dynamic registration, and 10628 for a client resolved from its metadata document, once per document held. A host whose log filter keeps Information for the library's categories now receives one record per token response and per registration change; one that drops Information does not see them.
- The token records carry the tenant, the
client_id, the grant type, the scope and the audiences, and those of the token endpoint the grant id too; the registration records carry the client's trust, grant types, scope and resources. The end user appears only as a fingerprint, and no record carries a token, a client secret or a registration access token. SetOidcOptions.FingerprintKeyto the same value on every node so the fingerprints of one end user match across nodes and restarts; left unset, each process draws its own key. - Endpoint spans carry
oauth.client_id(TelemetryTags.ClientId) once the client is known. Measurements never name a client, and no span or measurement names the end user. A host whose trace backend must not receive client identifiers drops the attribute in its exporter or processor.
Outbound requests to client-supplied addresses
- Outbound requests to addresses a client supplies (key sets, request objects, sector identifiers, back-channel logout and CIBA notifications, Shared Signals push delivery, client metadata documents) use no proxy unless one is named: neither the system proxy nor
HTTP_PROXYandHTTPS_PROXY. A deployment that leaves its network through a forward proxy setsSecureHttpFetchOptions.OutboundProxy, andSharedSignalsTransmitterOptions.OutboundProxyfor push delivery. With a proxy, the server still refuses an address its own lookup returns, but the proxy resolves the name again. - These requests refuse HTTP/3: a request with
Version3.0 or higher, or withVersionPolicyRequestVersionOrHigher. WithBlockPrivateNetworkson, they refuse every block of the IANA special-purpose address registries (IPv4, IPv6), the documentation, benchmarking, AS112 and AMT blocks among them. - They take their TLS options from
AddressValidatingHttpMessageHandler.SslOptions, where a host sets a private certificate authority or a client certificate. By default they download no certificate the endpoint's chain names and check no revocation online, so an endpoint that serves its certificate without its intermediate certificates is refused, and on Windows so is one whose public root is not yet in the local store. A host that needs downloads sets its ownCertificateChainPolicythere. - A refused fetch is logged by the step that made it: event 6004 for an address the guard refuses, 6005 for a host it cannot reach, a missing intermediate certificate included, with the exception, 6003 for a timeout, 6023 added for a key set, and 10623 for a client metadata document. A refused key set or request object fails the client's request; a refused metadata document answers 503 while no valid copy is held.
- A class derived from
AddressValidatingHttpMessageHandlerjudges the request URI inGuardAsyncand the resolved addresses by the ruleAddressRuleForreturns; one that overrides onlyGuardAsyncconnects without judging the address, so it overridesAddressRuleFortoo. The handler under the guard is not anHttpClientHandler, and the synchronousSendthrowsNotSupportedException. A refused address arrives asOutboundAddressRefusedException, anHttpRequestException. - The receiver address of push delivery is judged by the primary handler of the client named
PushDeliveryTransport.HttpClientName.ConfigurePrimaryHttpMessageHandlerorUseSocketsHttpHandleron that client, or on a client of the server's secure fetch, replaces the guard; add handlers withAddHttpMessageHandler.PushDeliverySender.SendPendingAsyncreturns a failed pass for a refused receiver instead of throwing: nothing is sent, the events stay queued, and a warning names the stream.
Caches
For each of IMemoryCache and IDistributedCache the host does not register, the library uses an in-process cache of its own, and a cache the host registers is used whatever order it is registered in; Abblix.JWT references Microsoft.Extensions.Caching.Memory for them. Only a cache registered without a key is found: one registered only as a keyed service is not, and the library keeps its state in process.
With a distributed cache keeping used jti values against replay, the values reserved before the upgrade stay under their earlier keys until they expire, and nothing in 3.1 reads them (above).
Client ID Metadata Documents
Client ID Metadata Documents (AddClientIdMetadataDocuments()) are new and experimental in 3.1. The feature implements an IETF Internet-Draft, draft-ietf-oauth-client-id-metadata-document-03, and its API may change in a minor release until the draft becomes an RFC; the compiler reports ABX9001 wherever code uses it. The Abblix.OIDC.Server package README shows how to turn it on.
A client from a metadata document is held to the first token_endpoint_auth_method it declares that its tenant admits: a document listing tls_client_auth before private_key_jwt gets private_key_jwt at a tenant without certificate authorities. A document whose JSON strings do not decode is refused as invalid.
When a document cannot be fetched for a reason that may pass (a network error, a timeout, a 5xx answer, a name that does not resolve) and no valid copy is held, the token, pushed authorization request, revocation and introspection endpoints answer a client authentication that fails on it with 503, no body and no Retry-After. Draft section 6.1 allows a 503 in place of invalid_client for a transient failure at the token and pushed authorization request endpoints, and RFC 7009, section 2.2.1 describes a 503 at revocation. Introspection also answers 503 for a token its records refuse while the token's client cannot be resolved. Telemetry names this answer client_metadata_unavailable, while the 429 of the rate limit stays temporarily_unavailable. A token that is not the caller's is answered as it would be without the outage: 200 at revocation, inactive at introspection, invalid_grant at the token endpoint. A copy already held is served past its lifetime during such a failure. A document that was fetched and refused stays invalid_client, and the authorization endpoint answers invalid_client without a redirect in both cases. ClientTemporarilyUnavailableError is new and experimental (ABX9001).
SoftwareStatement.RequireSoftwareStatement applies to registration requests only, so it does not refuse metadata documents: the metadata document settings decide which documents are accepted, and a software_statement inside a document is not read. ClientInfo.ResolvedFromMetadataDocument lets a host's IRedirectUriTrustPolicy tell a client from a metadata document from one somebody registered; the server sets it, and it is never written to or read from JSON.