Class OAuthAuthorizationServer.Builder
- Enclosing class:
OAuthAuthorizationServer
build() snapshots its values so later setters do not change an already-built server.
Application collaborators remain retained references and must satisfy their thread-safety, budget
and lifetime contracts; the server does not copy or close them.
Required configuration has no inferred defaults: authorization, token and JWKS routes, client
repository, authoritative store, signing-key provider, state sealer, grant policy and resource map.
Null clears those required values. Revocation and introspection routes default absent; refresh
defaults off and requires a revocation route when enabled. Collection setters replace complete
values; resources(Map) snapshots the map and its scope sets rather than merging them.
Numeric setters accept a nullable value and defer bounds to build. In addition to each documented inclusive interval, code lifetime must not exceed interaction lifetime; with refresh enabled, access lifetime must not exceed idle lifetime, which must not exceed absolute lifetime. Skew must not exceed half the access lifetime, request timeout must not exceed total deadline, and the sealed record cap must fit the sealer. Resource counts and scope limits are checked against the copied map.
Configuration and construction do not call the repository, store, signing-key provider, grant policy
or address resolver, sample the worker clock, perform network I/O/signing, or start owned threads.
The explicit construction-time observer exception is
OAuthServerObserver.didEnableLocalhostAnyPortRedirects() when that option is enabled.
Build neither initializes persistence nor opens serving/recovery admission. The application owns
trusted startup time, durable store qualification, keys, user authentication, consent, sessions/CSRF
and HTTP routing. Construction success does not qualify that deployment.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionaccessTokenLifetime(@Nullable Duration value) Sets the maximum issued access-token lifetime.Acknowledges the runtime TLS risk when opt-in CIMD requires network access; the default is false.Permits a numeric HTTP loopback issuer and its same-authority server routes for local development.Enables any-port matching for port-less HTTP localhost client registrations; the default is false.Enables exact HTTP localhost client redirects; the default is false.Enables HTTP IP-loopback client redirects with the native port exception; the default is false.Sets the lifetime of a one-use authorization code.authorizationEndpoint(@Nullable URI value) Sets the required browser authorization route; there is no default.Sets the maximum lifetime of a browser-bound authorization interaction.build()Validates the complete configuration and returns an issuer retaining the selected application collaborators.Selects opt-in client-ID metadata document (CIMD) policy.Sets the required application-owned registered-client lookup; there is no default.Sets the worker wall clock; the default and null selectClock.systemUTC().Sets issuer JWT-validation skew and its contribution to physical retention.Inspects the current configuration shape without invoking application collaborators.grantPolicy(@Nullable OAuthGrantPolicy value) Sets the required application-owned continuing authorization policy; there is no default.introspectionEndpoint(@Nullable URI value) Sets the optional resource-only introspection route; the default and null mean absent.jwksEndpoint(@Nullable URI value) Sets the required public verification-key publication route; there is no default.Sets the maximum client-identifier length in UTF-16 code units at issuer ingress.maximumHeaderBytes(@Nullable Integer value) Sets the aggregate request-header and prepared response-header budget in bytes.Sets the maximum raw query length in UTF-16 code units before form decoding.maximumRedirectUris(@Nullable Integer value) Sets the maximum redirect registrations accepted from a selected client.Sets the maximum admitted materialized endpoint request-body size in bytes.maximumResources(@Nullable Integer value) Sets the maximum resource entries accepted by configured issuer resource maps and client admission.Sets the maximum prepared issuer response-body size in bytes.maximumScopeLength(@Nullable Integer value) Sets the maximum length of each ASCII scope token.Sets the maximum scope count per resource in issuer configuration and client admission.maximumStateLength(@Nullable Integer value) Sets the maximum decoded authorization state length in UTF-16 code units.Sets the maximum attempts for bounded store-conflict retry loops.Sets the maximum ASCII sealed store-record size in bytes, not plaintext payload size.maximumSubjectLength(@Nullable Integer value) Sets the maximum application subject length in UTF-16 code units.observer(@Nullable OAuthServerObserver value) Sets the application-owned synchronous issuer observer.Selects the immutable outbound URI policy for opt-in CIMD address admission.Sets the HTTP Cache-Control max-age for public issuer metadata and JWKS responses.Sets the refresh-family absolute lifetime at initial issuance.Sets the refresh-family idle lifetime used for initial issuance and rotation.refreshTokensEnabled(@Nullable Boolean value) Enables server-side refresh-token issuance and rotation; the default is false.requestTimeout(@Nullable Duration value) Sets the per-request timeout for outbound CIMD HTTP work.Replaces the required complete map of exact resource identifiers to allowed scope sets.revocationEndpoint(@Nullable URI value) Sets the optional token-revocation route; the default and null mean absent.Sets the required application-owned signing-key snapshot provider; there is no default.stateSealer(@Nullable StateSealer value) Sets the required application-owned state sealer; there is no default.Sets the required application-owned authoritative store; there is no default.tokenEndpoint(@Nullable URI value) Sets the required code-exchange and refresh token route; there is no default.toString()Returns a fixed redacted description.totalDeadline(@Nullable Duration value) Sets the original monotonic budget for a public issuer operation.
-
Method Details
-
authorizationEndpoint
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder authorizationEndpoint(@Nullable URI value) Sets the required browser authorization route; there is no default. Null clears the required route, so the next build fails until it is supplied again. The route must use the issuer's scheme and exact raw authority, be distinct from every other configured route, and contain no user info, query or fragment. It is not inferred from the issuer or request headers. These checks run atbuild(); the application owns HTTP routing and TLS termination.- Parameters:
value- the exact absolute endpoint URI, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
tokenEndpoint
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder tokenEndpoint(@Nullable URI value) Sets the required code-exchange and refresh token route; there is no default. Null clears the required route, so the next build fails until it is supplied again. The route must use the issuer's scheme and exact raw authority, be distinct from every other configured route, and contain no user info, query or fragment. It is not inferred from the issuer or request headers. These checks run atbuild(); the application owns HTTP routing and TLS termination.- Parameters:
value- the exact absolute endpoint URI, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
jwksEndpoint
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder jwksEndpoint(@Nullable URI value) Sets the required public verification-key publication route; there is no default. Null clears the required route, so the next build fails until it is supplied again. The route must use the issuer's scheme and exact raw authority, be distinct from every other configured route, and contain no user info, query or fragment. It is not inferred from the issuer or request headers. These checks run atbuild(); the application owns HTTP routing and TLS termination.- Parameters:
value- the exact absolute endpoint URI, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
revocationEndpoint
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder revocationEndpoint(@Nullable URI value) Sets the optional token-revocation route; the default and null mean absent. A route is required whenrefreshTokensEnabled(Boolean)is true. Without it, revocation is not advertised and the public revocation operation is unavailable; null does not select another route. The route must use the issuer's scheme and exact raw authority, be distinct from every other configured route, and contain no user info, query or fragment. It is not inferred from the issuer or request headers. These checks run atbuild(); the application owns HTTP routing and TLS termination.- Parameters:
value- the exact absolute revocation URI, or null for no route- Returns:
- this builder
- Since:
- 1.0.0
-
introspectionEndpoint
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder introspectionEndpoint(@Nullable URI value) Sets the optional resource-only introspection route; the default and null mean absent. Without it, introspection is not advertised and the public introspection operation is unavailable. The route must use the issuer's scheme and exact raw authority, be distinct from every other configured route, and contain no user info, query or fragment. It is not inferred from the issuer or request headers. These checks run atbuild(); the application owns HTTP routing and TLS termination.- Parameters:
value- the exact absolute introspection URI, or null for no route- Returns:
- this builder
- Since:
- 1.0.0
-
clientRepository
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder clientRepository(@Nullable OAuthServerClientRepository value) Sets the required application-owned registered-client lookup; there is no default. Null clears it and makes the next build fail. The reference is retained, not copied or called during construction. It must be thread-safe and honor each operation's remaining cooperative budget. Exact registrations are consulted before opt-in client-ID metadata; a backend failure must not be reported as an unknown client. SeeOAuthServerClientRepository.- Parameters:
value- the registered-client repository, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
store
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder store(@Nullable OAuthAuthorizationServerStore value) Sets the required application-owned authoritative store; there is no default. Null clears it and makes the next build fail. The reference is retained without reading, writing or initializing a namespace during construction. The implementation must supply the coherent admitted time, atomic exact predicates, durability, recovery admission and permanent/replay retention required byOAuthAuthorizationServerStore; this setter supplies none of those deployment guarantees.- Parameters:
value- the authoritative issuer store, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
signingKeys
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder signingKeys(@Nullable OAuthIssuerKeyProvider value) Sets the required application-owned signing-key snapshot provider; there is no default. Null clears it and makes the next build fail. Construction retains the provider without invoking it, looking up keys or signing. Operations require coherent lifecycle snapshots and the issuer's RS256 profile. The application owns private-key protection, publication, rollover and retirement; changing the provider reference is not a key-migration or retention procedure. SeeOAuthIssuerKeyProvider.- Parameters:
value- the signing-key provider, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
stateSealer
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder stateSealer(@Nullable StateSealer value) Sets the required application-owned state sealer; there is no default. Null clears it and makes the next build fail. The immutable sealer reference is retained. At build,maximumStoreRecordBytes(Integer)must not exceed its configured maximum sealed length. Sealing keys, old-key retention and coordinated rotation across writers remain application-owned; replacing the sealer does not migrate stored records or repair missing fences.- Parameters:
value- the configured state sealer, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
grantPolicy
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder grantPolicy(@Nullable OAuthGrantPolicy value) Sets the required application-owned continuing authorization policy; there is no default. Null clears it and makes the next build fail. Construction retains the thread-safe callback without invoking it. Approval, code exchange and refresh recheck current permissions under the remaining cooperative budget. A decision can deny or narrow authority; it cannot replace application login, session/CSRF protection or consent. SeeOAuthGrantPolicy.- Parameters:
value- the continuing grant policy, or null to clear it- Returns:
- this builder
- Since:
- 1.0.0
-
resources
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder resources(@Nullable Map<@NonNull String, @NonNull Set<@NonNull String>> value) Replaces the required complete map of exact resource identifiers to allowed scope sets. There is no default; null clears the required map. Non-null maps and their scope sets are validated and defensively copied when set, rather than merged or retained. Resource identifiers are absolute, fragment-free URI spellings compared exactly and never fetched. The map must be nonempty; an empty scope set grants no authority. Carrier/aggregate ceilings are checked here; the selectedmaximumResources(Integer),maximumScopesPerResource(Integer)andmaximumScopeLength(Integer)are checked at build. Per-client and grant policy can only narrow this configuration.- Parameters:
value- the complete resource/scope map, or null to clear it- Returns:
- this builder
- Throws:
IllegalArgumentException- if the non-null replacement violates resource/scope carrier limitsNullPointerException- if a non-null map contains a null key, scope set or scope- Since:
- 1.0.0
-
clientMetadataPolicy
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder clientMetadataPolicy(@Nullable OAuthClientMetadataPolicy value) Selects opt-in client-ID metadata document (CIMD) policy. The default and null areOAuthClientMetadataPolicy.disabledInstance(); null disables CIMD, not registered clients. An enabled immutable policy retains its application resolver and explicit cache selection. Construction performs no resolution, cache access or HTTP fetch. Enabled CIMD requires the runtime floor described byacknowledgeUnpatchedRuntime(Boolean)and usesoutboundUriPolicy(OutboundUriPolicy). Cache reuse is not authoritative credential storage or shared-deployment qualification. Exact registered clients still take precedence.- Parameters:
value- the complete metadata policy, or null to disable CIMD- Returns:
- this builder
- Since:
- 1.0.0
-
clock
Sets the worker wall clock; the default and null selectClock.systemUTC(). The reference is retained without sampling it during construction. Operations use it for worker health checks, provisional key-lifecycle preparation and optional metadata-cache freshness. Timed authoritative state transitions use admitted store time and authenticated floors, not this clock as a fallback. Changing this clock neither establishes trusted startup time nor resets durable floors.- Parameters:
value- the application worker clock, or null to restore the system UTC clock- Returns:
- this builder
- Since:
- 1.0.0
-
outboundUriPolicy
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder outboundUriPolicy(@Nullable OutboundUriPolicy value) Selects the immutable outbound URI policy for opt-in CIMD address admission. The default and null selectOutboundUriPolicy.publicAddressesOnlyInstance(). This is a restriction on approved metadata requests, not permission to fetch arbitrary client URLs. The pinned transport still enforces its address, redirect and TLS/hostname rules. This setting does not change issuer endpoint authority or any of the separate redirect/loopback options.- Parameters:
value- the outbound metadata URI policy, or null to restore the public-address policy- Returns:
- this builder
- Since:
- 1.0.0
-
observer
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder observer(@Nullable OAuthServerObserver value) Sets the application-owned synchronous issuer observer. The default and null selectOAuthServerObserver.disabledInstance(). The reference is retained; hooks must be fast and thread-safe and follow the interface's failure-containment contract. Successful construction withallowLocalhostAnyPortRedirects(Boolean)enabled callsOAuthServerObserver.didEnableLocalhostAnyPortRedirects(); construction otherwise performs no issuer observer notification. This interface has no runtime-acknowledgment hook, and operation success events are checkpoints rather than credential-delivery receipts.- Parameters:
value- the issuer observer, or null to restore the disabled observer- Returns:
- this builder
- Since:
- 1.0.0
-
refreshTokensEnabled
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder refreshTokensEnabled(@Nullable Boolean value) Enables server-side refresh-token issuance and rotation; the default is false. False or null disables refresh. Enabling it requires a configuredrevocationEndpoint(URI)at build and per-client and current grant-policy refresh permission at operation time. It does not override either permission or extend an existing family's pinned lifetime. With refresh enabled, access lifetime must not exceed refresh idle lifetime, which must not exceed refresh absolute lifetime.- Parameters:
value- true to enable refresh; false or null to disable it- Returns:
- this builder
- Since:
- 1.0.0
-
allowInsecureLoopback
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder allowInsecureLoopback(@Nullable Boolean value) Permits a numeric HTTP loopback issuer and its same-authority server routes for local development. The default is false; false or null restores HTTPS-only issuer routes. The HTTP host must be exactly127.0.0.1or[::1], notlocalhost. This option neither admits client redirects nor enables the other loopback options, and it does not weaken CIMD transport or token validation.- Parameters:
value- true to allow numeric HTTP loopback issuer routes; false or null to disable- Returns:
- this builder
- Since:
- 1.0.0
-
allowNativeLoopbackRedirects
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder allowNativeLoopbackRedirects(@Nullable Boolean value) Enables HTTP IP-loopback client redirects with the native port exception; the default is false. False or null disables the exception. Literal127.0.0.1or[::1]redirects may vary the port while retaining the other checked components; code redemption must use the actual admitted redirect. CIMD uses this explicit policy regardless of itsapplication_typedeclaration. It does not enable HTTP issuer routes or localhost redirects; seeallowInsecureLoopback(Boolean),allowLocalhostRedirects(Boolean)andallowLocalhostAnyPortRedirects(Boolean).- Parameters:
value- true to enable the IP-loopback redirect port exception; false or null to disable- Returns:
- this builder
- Since:
- 1.0.0
-
allowLocalhostRedirects
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder allowLocalhostRedirects(@Nullable Boolean value) Enables exact HTTP localhost client redirects; the default is false. False or null disables this profile. Every component, including the configured port spelling, stays exact. This does not enable numeric-loopback redirects, an HTTP issuer, or port-less any-port matching; the latter requiresallowLocalhostAnyPortRedirects(Boolean)separately.- Parameters:
value- true to enable exact HTTP localhost redirects; false or null to disable- Returns:
- this builder
- Since:
- 1.0.0
-
allowLocalhostAnyPortRedirects
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder allowLocalhostAnyPortRedirects(@Nullable Boolean value) Enables any-port matching for port-less HTTP localhost client registrations; the default is false. False or null disables it. The registered authority must be exactlylocalhost; scheme, host, raw path and query stay exact. Fixed-port registrations still requireallowLocalhostRedirects(Boolean)and remain exact. No other loopback option is implied. Code redemption requires the actual admitted redirect. A successful build emitsOAuthServerObserver.didEnableLocalhostAnyPortRedirects(), and an authorization operation that relies on this exception emitsOAuthServerObserver.didUseLocalhostAnyPortRedirects()even if a later check rejects it. Exact matches under the separate exact-localhost profile do not use it.- Parameters:
value- true to enable port-less localhost any-port matching; false or null to disable- Returns:
- this builder
- Since:
- 1.0.0
-
acknowledgeUnpatchedRuntime
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder acknowledgeUnpatchedRuntime(@Nullable Boolean value) Acknowledges the runtime TLS risk when opt-in CIMD requires network access; the default is false. False or null restores refusal on runtimes below 17.0.3 on Java 17 or 18.0.1 on Java 18. The guard is checked at build only whenclientMetadataPolicy(OAuthClientMetadataPolicy)enables CIMD; Java 19 and later pass this guard. The flag does not patch TLS or alter signature, claim, address or peer-verification policy. The issuer observer has no acknowledgment event. With CIMD disabled it has no runtime-floor effect on issuer construction.- Parameters:
value- true to accept the runtime risk for CIMD; false or null to restore refusal- Returns:
- this builder
- Since:
- 1.0.0
-
authorizationInteractionLifetime
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder authorizationInteractionLifetime(@Nullable Duration value) Sets the maximum lifetime of a browser-bound authorization interaction. Default: 15 minutes; inclusive range: 1 minute through 1 hour. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Authorization-code lifetime must not exceed this lifetime.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
authorizationCodeLifetime
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder authorizationCodeLifetime(@Nullable Duration value) Sets the lifetime of a one-use authorization code. Default: 2 minutes; inclusive range: 30 seconds through 10 minutes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Must not exceedauthorizationInteractionLifetime(Duration); a longer code policy does not revive an expired or consumed code.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
accessTokenLifetime
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder accessTokenLifetime(@Nullable Duration value) Sets the maximum issued access-token lifetime. Default: 5 minutes; inclusive range: 30 seconds through 15 minutes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. With refresh enabled, must not exceed refresh idle lifetime; clock skew must not exceed half this value. Existing families keep their pinned maximum. Raising this value beyond a family pin causes its next refresh to revoke it rather than enlarge the pin.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
refreshTokenIdleLifetime
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder refreshTokenIdleLifetime(@Nullable Duration value) Sets the refresh-family idle lifetime used for initial issuance and rotation. Default: 24 hours; inclusive range: 5 minutes through 7 days. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. When refresh is enabled, access lifetime must not exceed this value, which must not exceed refresh absolute lifetime. Existing families retain their original idle-lifetime pin; increasing this setting does not extend it.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
refreshTokenAbsoluteLifetime
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder refreshTokenAbsoluteLifetime(@Nullable Duration value) Sets the refresh-family absolute lifetime at initial issuance. Default: 7 days; inclusive range: 1 hour through 30 days. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. With refresh enabled, must be at least refresh idle lifetime. Rotation does not reset the original family absolute expiry, and later configuration does not extend it.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
clockSkew
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder clockSkew(@Nullable Duration value) Sets issuer JWT-validation skew and its contribution to physical retention. Default: 30 seconds; inclusive range: zero through 60 seconds. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Must not exceed half the access-token lifetime. This does not reserve durable clock time or advance entity floors; authoritative temporal predicates use admitted store time. Together with total deadline and public metadata cache age it contributes to retained grant horizons. A combined policy beyond a stored family horizon causes its next refresh to revoke it; coordinate revocation and new authorization across nodes.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
totalDeadline
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder totalDeadline(@Nullable Duration value) Sets the original monotonic budget for a public issuer operation. Default: 10 seconds; inclusive range: 1 second through 60 seconds. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Preparation, callbacks, contention retries, store work and final admission share this budget; retries do not restart it. Request timeout must not exceed it. Synchronous application callbacks must cooperate because the library cannot forcibly preempt them. It also contributes to the retention margin described byclockSkew(Duration).- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
requestTimeout
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder requestTimeout(@Nullable Duration value) Sets the per-request timeout for outbound CIMD HTTP work. Default: 5 seconds; inclusive range: 1 second through 30 seconds. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Must not exceedtotalDeadline(Duration); the original remaining operation budget can shorten a request further. This does not set the host application HTTP-server timeout or preempt arbitrary application callbacks.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
publicMetadataHttpCacheMaxAge
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder publicMetadataHttpCacheMaxAge(@Nullable Duration value) Sets the HTTP Cache-Control max-age for public issuer metadata and JWKS responses. Default: 60 seconds; inclusive range: zero through 5 minutes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. The header uses whole seconds fromDuration.toSeconds(), while the full configured duration governs new-key publication wait and contributes to grant/verification-key retention. A combined policy beyond an existing family horizon causes its next refresh to revoke it; coordinate revocation and new authorization when changing this policy.- Parameters:
value- the setting in duration units, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumRequestBodyBytes
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumRequestBodyBytes(@Nullable Integer value) Sets the maximum admitted materialized endpoint request-body size in bytes. Default: 16384 bytes; inclusive range: 1024 bytes through 65536 bytes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. This is a library admission bound, not permission for a transport adapter or host server to allocate an unbounded body before calling the issuer. Query, header, token and result bounds still apply separately.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumRawQueryLength
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumRawQueryLength(@Nullable Integer value) Sets the maximum raw query length in UTF-16 code units before form decoding. Default: 16384 code units; inclusive range: 1024 code units through 65536 code units. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Encoded spelling consumes this budget separately from the decoded state/client/scope limits. The host must also bound acquisition of the original query.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumHeaderBytes
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumHeaderBytes(@Nullable Integer value) Sets the aggregate request-header and prepared response-header budget in bytes. Default: 16384 bytes; inclusive range: 1024 bytes through 65536 bytes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Admitted request names, values and framing are charged together; separate header-name/occurrence caps and duplicate-security-header rules remain. This does not change the container or adapter read limits.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumResponseBodyBytes
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumResponseBodyBytes(@Nullable Integer value) Sets the maximum prepared issuer response-body size in bytes. Default: 32768 bytes; inclusive range: 4096 bytes through 131072 bytes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Responses are bounded before credential-bearing output or the relevant transition is committed. Request/header/store budgets remain separate; a valid grant need not fit every smaller response policy.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumStoreRecordBytes
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumStoreRecordBytes(@Nullable Integer value) Sets the maximum ASCII sealed store-record size in bytes, not plaintext payload size. Default: 3800 bytes; inclusive range: 1024 bytes through 16384 bytes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Must not exceed the configuredstateSealer(StateSealer)maximum sealed length. Envelope, authentication and encoding overhead reduce usable payload capacity. Raising another admission limit does not prove a resulting record fits; this setter neither enlarges the sealer nor migrates existing records.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumStoreCommitAttempts
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumStoreCommitAttempts(@Nullable Integer value) Sets the maximum attempts for bounded store-conflict retry loops. Default: 3 attempts; inclusive range: 1 attempt through 8 attempts. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Attempts share the original total deadline; this is not a global cap on every store callback in a composite operation. Only a definite zero-effect conflict permits retry. Unknown mutation outcomes and confirmed commitments requiring reconciliation stop automatic retry.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumResources
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumResources(@Nullable Integer value) Sets the maximum resource entries accepted by configured issuer resource maps and client admission. Default: 64 resources; inclusive range: 1 resource through 1024 resources. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. The configured server map is checked at build; client maps are checked when selected. It is a count bound, not a collection of wildcard audiences or permission to fetch resource identifiers.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumRedirectUris
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumRedirectUris(@Nullable Integer value) Sets the maximum redirect registrations accepted from a selected client. Default: 32 redirects; inclusive range: 1 redirect through 64 redirects. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Selection applies this bound without changing exact redirect validation or the separately opted-in loopback profiles. Build does not fetch clients to pre-validate their registrations.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumScopesPerResource
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumScopesPerResource(@Nullable Integer value) Sets the maximum scope count per resource in issuer configuration and client admission. Default: 32 scopes; inclusive range: 1 scope through 128 scopes. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. The server resource map is checked at build and selected clients at admission. This does not grant a scope absent from the client/server intersection or current grant policy.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumScopeLength
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumScopeLength(@Nullable Integer value) Sets the maximum length of each ASCII scope token. Default: 128 characters; inclusive range: 1 character through 128 characters. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. The scope grammar remains strict; changing a length bound does not admit whitespace, quotes or backslashes or widen granted scopes.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumStateLength
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumStateLength(@Nullable Integer value) Sets the maximum decoded authorization state length in UTF-16 code units. Default: 1024 code units; inclusive range: 128 code units through 4096 code units. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Raw query/body and encoded redirect/response budgets still apply separately. State is reflected only after the request and registered redirect are admitted; it is not application session or CSRF authentication.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumClientIdLength
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumClientIdLength(@Nullable Integer value) Sets the maximum client-identifier length in UTF-16 code units at issuer ingress. Default: 2048 code units; inclusive range: 256 code units through 4096 code units. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. Exact registered and CIMD identifiers remain subject to their profile and aggregate request limits. This bound does not normalize client identifiers or authorize metadata fetching.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
maximumSubjectLength
@CheckReturnValue public @NonNull OAuthAuthorizationServer.Builder maximumSubjectLength(@Nullable Integer value) Sets the maximum application subject length in UTF-16 code units. Default: 255 code units; inclusive range: 16 code units through 1024 code units. Null restores the default. Bounds and combined constraints are checked bybuild(), not by this setter. The interval bounds this maximum setting, not a minimum accepted subject length. Subjects remain exact application identifiers, separately scoped by issuer; this does not create accounts or authorize a user.- Parameters:
value- the setting in the units described above, or null to restore the default- Returns:
- this builder
- Since:
- 1.0.0
-
configurationDiagnostics
Inspects the current configuration shape without invoking application collaborators. The immutable result contains only fixed codes and no configured values or exception text. An empty result establishes construction validity, not deployment or key-provider readiness.- Returns:
- every detectable missing or incompatible setting in deterministic order
- Since:
- 1.0.0
-
build
Validates the complete configuration and returns an issuer retaining the selected application collaborators. Missing required values, refresh without revocation, unsafe/duplicate/cross-authority routes, invalid numeric/combined limits and a CIMD runtime below the unacknowledged floor fail construction. No client/store/key/policy/resolver callback, clock sampling, network I/O, signing or owned thread is started. Enabling localhost any-port redirects does synchronously notify the configured observer as described byobserver(OAuthServerObserver); its documented failure rules apply. This does not initialize an issuer namespace, verify deployment recovery/witness readiness or authorize credential release. Later builder changes do not alter this server; retained application collaborators continue to follow their own lifecycle contracts.- Returns:
- the configured server, without persistence initialization or serving admission
- Throws:
IllegalStateException- if required configuration is missing, refresh lacks revocation, or CIMD requires an unacknowledged runtime floorIllegalArgumentException- if endpoint, resource, numeric or combined configuration is invalid- Since:
- 1.0.0
-
toString
-