diff --git a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Program.cs b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Program.cs index bee687a8..e09f1ed5 100644 --- a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Program.cs +++ b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Program.cs @@ -43,10 +43,10 @@ builder.Services.AddUltimateAuthServer(o => { o.Cryptography.TokenHashingKey = builder.Configuration["UltimateAuth:Cryptography:TokenHashingKey"] - ?? throw new InvalidOperationException("UltimateAuth token hashing key is missing."); + ?? o.Cryptography.TokenHashingKey; o.Cryptography.JwtSigningKey = builder.Configuration["UltimateAuth:Cryptography:JwtSigningKey"] - ?? throw new InvalidOperationException("UltimateAuth JWT signing key is missing."); + ?? o.Cryptography.JwtSigningKey; // Identity Lab uses its own trusted creation align with Sandbox management. o.Endpoints.DisabledActions.Add(UAuthActions.Users.CreateAnonymous); diff --git a/docs/content/auth-flows/refresh-flow.md b/docs/content/auth-flows/refresh-flow.md index abec7bce..f09f737b 100644 --- a/docs/content/auth-flows/refresh-flow.md +++ b/docs/content/auth-flows/refresh-flow.md @@ -126,15 +126,6 @@ No access token or refresh token is issued. The existing session ID remains the The order is important: **session touch happens before token rotation** in the current implementation. These operations are not presented as one cross-store transaction. If rotation subsequently fails, the refresh response fails, although a preceding session touch may already have been persisted. This should not be described as an all-or-nothing operation. -### SemiHybrid and PureJwt: implementation branches - -The current service includes branches for two additional modes: - -- `SemiHybrid` requires a session ID and refresh token, validates the session and rotates the token, but does not touch the session. -- `PureJwt` uses the refresh token for rotation without a session touch step in `RefreshFlowService`. - -These describe the existing code paths, **not a promise of v0.1.0 production support**. Configuration validation and supported-mode documentation remain authoritative for which modes applications can enable. - ## Request resolution and response delivery The refresh endpoint uses the server's `AuthFlowContext`. It obtains the session ID from `flow.Session`, the device from `flow.Device`, and the refresh token through `RefreshTokenResolver`. @@ -151,8 +142,6 @@ On success, the endpoint chooses a **primary credential** according to the refre The HTTP endpoint returns **`204 No Content`** on successful refresh and **`401 Unauthorized`** when continuation fails. Clients should obtain credentials from the configured response delivery mechanism rather than expecting a JSON token payload. When `Diagnostics.EnableRefreshDetails` is enabled, the endpoint also writes the refresh outcome through its diagnostic response writer. -> Response delivery customization is not fully independent in v0.1.0: mode templates and application-profile adaptation constrain the effective behavior. Do not assume every configured credential-delivery override is honored. - ## Outcomes and client expectations | Outcome | Meaning | Client interpretation | diff --git a/docs/content/client-sdk/authentication.md b/docs/content/client-sdk/authentication.md index daba00a5..51c496fc 100644 --- a/docs/content/client-sdk/authentication.md +++ b/docs/content/client-sdk/authentication.md @@ -79,11 +79,62 @@ var request = new LoginRequest await UAuthClient.Flows.LoginAsync(request); ``` -The method returns `Task`, not a structured login result. +`LoginAsync` returns a structured login result describing the outcome of the submission. -It submits the login payload through the configured navigation-based transport. +The client discovers the effective login transport supported by the server. -Depending on the hosting environment, this may initiate navigation or redirect behavior. +Depending on the authentication mode, credential delivery configuration, and return URL, login may use browser navigation or a fetch-based request. + +A navigation submission does not itself confirm successful server-side authentication. A fetch-based submission allows the client to observe the server response and process delivered credentials. + +### Login Transport Selection + +UltimateAuth supports three login transport strategies: + +| Transport | Behavior | +|---|---| +| `Auto` | Automatically selects a compatible transport | +| `Navigation` | Submits the login through browser navigation | +| `Fetch` | Submits the login through an HTTP request and processes the response | + +`Auto` is the default and recommended strategy. + +```csharp +var result = await UAuthClient.Flows.LoginAsync( + request, + returnUrl: "/dashboard", + transport: UAuthLoginTransport.Auto); +``` + +Navigation is suitable when the effective credential delivery configuration supports browser-managed authentication credentials. + +Fetch is required when the client must observe a header-delivered access token. + +Applications can explicitly request fetch-based login: + +```csharp +var result = await UAuthClient.Flows.LoginAsync( + request, + transport: UAuthLoginTransport.Fetch); +``` + +An explicitly requested transport must be compatible with the effective server configuration. + +The client does not silently downgrade an incompatible explicit navigation request. + +### Processing Header-Delivered Access Tokens + +When login delivers an access token through a response header, UltimateAuth processes the token and stores it in the client-side token store. + +The default token store is in-memory. + +Applications using the UltimateAuth client do not need to manually extract JWTs from login responses or construct authorization headers. + +The client attaches the access token to supported authenticated requests and clears expired credentials from the token store. + +In-memory storage does not persist access tokens across a full application reload. + +Authentication continuation after a reload depends on the available refresh credential and the effective server configuration. ### LoginRequest Properties @@ -479,6 +530,32 @@ This is useful when the current PKCE context can no longer be used. The application should not repeatedly resubmit the same invalid authorization code and verifier. +### UAuthHub Handoff and Credential Ownership + +A PKCE flow initiated by an application retains the initiating application's authentication context. + +When the user completes login through UAuthHub, the resulting credentials belong to the initiating application, not to the Hub's interactive login interface. + +The Hub completes the authentication flow and returns the user to the validated application return URL. + +Header-delivered access tokens associated with the initiating application must not be installed into the Hub's local authentication state. + +After returning to the initiating application, the client can restore authentication through the available session or refresh credentials. + +This behavior preserves the original application and device context throughout the authentication journey. + +### Authentication Recovery + +The client may recover a header-delivered access token when the application starts without a usable token but a compatible refresh credential remains available. + +This allows authentication to continue after a full application reload or a supported UAuthHub handoff. + +Recovery does not bypass refresh-token validation, device binding, expiration, rotation, or server-side authentication policies. + +Recovery can fail when the refresh credential has expired, has been revoked, or is unavailable because of browser cookie restrictions. + +Cross-site browser deployments must not assume that refresh cookies will always be available. + ## 8. Direct Credential Posting Restrictions UltimateAuth restricts direct credential posting according to the configured application profile. @@ -741,7 +818,11 @@ Explicit validation is useful when an application needs to check current server- await UAuthClient.Flows.LogoutAsync(); ``` -The method uses the configured logout endpoint and navigation transport. +The method submits logout to the configured endpoint and observes the server response before clearing the local access token and publishing the logout event. + +Automatic navigation can be disabled without disabling server-side logout. + +A failed logout response does not represent a successfully terminated authentication context. Depending on the application profile and configuration, logout may involve navigation and authentication state changes. diff --git a/docs/content/client-sdk/resource-api-requests.md b/docs/content/client-sdk/resource-api-requests.md index e8bfc3ce..6d10eb0c 100644 --- a/docs/content/client-sdk/resource-api-requests.md +++ b/docs/content/client-sdk/resource-api-requests.md @@ -591,13 +591,45 @@ Likewise, configuring a Resource API URL in the client SDK does not automaticall ### Credential Delivery -The client and Resource API must agree on how the credential is transported. +The client and Resource API must agree on the credential used for authentication and its transport. -For header delivery, the API must read the configured access-token header and format. +#### Session-based Resource APIs -For cookie delivery, the API must read the configured access-token cookie. Browser origin, cookie scope, SameSite, Secure, and CORS settings must permit the credential to reach the API. +PureOpaque and Hybrid Resource APIs use opaque session credentials. -The Resource API must independently validate the credential and enforce authorization policies. +Cookie delivery is the default for incoming session credentials. + +The Resource API validates the selected session through UAuthHub using the configured Hub address. + +The browser must be able to send the session cookie to the Resource API. + +#### JWT-based Resource APIs + +PureJwt Resource APIs use JWT access tokens. + +The default Blazor Resource Client attaches the current access token using: + +```http +Authorization: Bearer +``` + +For a Resource API that exclusively uses header-based JWT authentication, browser cookies can be omitted: + +```csharp +options.Resource.Credentials = UAuthResourceCredentialsMode.Omit; +``` + +Omitting browser cookies does not prevent the client from attaching its access-token authorization header. + +This option affects Resource API requests, not authentication or refresh requests sent to UAuthHub. + +#### Credential compatibility + +A JWT issued in Hybrid mode is not interchangeable with a PureJwt access token. + +Hybrid-aware JWT validation in separate Resource APIs is not currently implemented. + +Authentication mode selection and credential compatibility remain explicit configuration responsibilities. ### PureJwt and UAuthHub Connectivity diff --git a/docs/content/configuration/advanced-configuration.md b/docs/content/configuration/advanced-configuration.md index 661c972b..7a5cc238 100644 --- a/docs/content/configuration/advanced-configuration.md +++ b/docs/content/configuration/advanced-configuration.md @@ -178,22 +178,21 @@ Applications should not assume that per-tenant options customization exists auto The default `EffectiveAuthModeResolver` maps application profiles to authentication modes. -| Application profile | Resolved mode | +| Application Profile | Default Mode | |---|---| | `BlazorServer` | `PureOpaque` | | `WebServer` | `Hybrid` | | `BlazorWasm` | `Hybrid` | | `Maui` | `Hybrid` | -| `ResourceApi` | `PureJwt` | -| `Api` | `PureJwt` | +| `UAuthHub` | `Hybrid` | +| `ResourceApi` | `Hybrid` | +| `Api` | `Hybrid` | | Other / unknown | `Hybrid` | These mappings describe the current default resolver. They do not imply that every resolved mode is fully supported in the current release. -In particular, the current server options validator rejects explicit activation of `SemiHybrid` and `PureJwt` through `AllowedModes`. - Applications should verify that their application profiles resolve to a supported authentication mode before deploying. ### AllowedModes Is Not a Mode Selector @@ -345,14 +344,6 @@ Token.RefreshTokenLifetime = TimeSpan.FromDays(7); Hybrid also configures refresh-token delivery through a cookie. -### Unsupported Modes - -Although default templates exist for `SemiHybrid` and `PureJwt`, their presence does not mean those modes are ready for production use. - -The server's current validator explicitly rejects these modes when they are enabled through `AllowedModes`. - -Only use modes supported by the current release. - ## 7. Inspect Effective Options Advanced integrations can use `IEffectiveServerOptionsProvider` to inspect configured and effective server options. diff --git a/docs/content/configuration/client-options.md b/docs/content/configuration/client-options.md index 2f972658..c82dbbf2 100644 --- a/docs/content/configuration/client-options.md +++ b/docs/content/configuration/client-options.md @@ -280,6 +280,13 @@ Changing a client endpoint does not create or expose the corresponding server en | `PkceTryComplete` | `/pkce/try-complete` | | `PkceComplete` | `/pkce/complete` | | `HubLoginPath` | `/uauthhub/entry` | +| `LoginTransport` | `/login/transport` | + +> The `LoginTransport` endpoint exposes the effective login transport capabilities of the authentication server. +> +>The client uses this information to determine whether navigation-based login is supported and whether the authentication response requires access-token processing. +> +>This endpoint does not select an authentication mode or negotiate the server's authentication configuration. ### Customize Individual Paths diff --git a/docs/content/configuration/server-options.md b/docs/content/configuration/server-options.md index 20c473ae..9e285be2 100644 --- a/docs/content/configuration/server-options.md +++ b/docs/content/configuration/server-options.md @@ -403,8 +403,9 @@ UltimateAuth resolves the effective authentication mode using the application pr | WebServer | Hybrid | | BlazorWasm | Hybrid | | Maui | Hybrid | -| Api | PureJwt | -| ResourceApi | PureJwt | +| UAuthHub | Hybrid | +| Api | Hybrid | +| ResourceApi | Hybrid | The server controls the effective authentication mode. Application profile metadata is not an authorization boundary. @@ -412,8 +413,6 @@ The server controls the effective authentication mode. Application profile metad `AllowedModes` restricts permitted modes but does not select a mode. -PureJwt is implemented. SemiHybrid remains unavailable. - ### Explicit PureJwt Configuration ```csharp @@ -1191,40 +1190,91 @@ The application should return valid, trusted navigation destinations. Avoid constructing redirects from unvalidated user-controlled URLs. -## 22. Authentication Response Options +## 22. Credential Delivery and Authentication Responses + +UltimateAuth separates credential delivery from navigation behavior. + +Credential delivery is configured through `options.GrantDelivery`: + +```csharp +options.GrantDelivery.Default +options.GrantDelivery.Session +options.GrantDelivery.AccessToken +options.GrantDelivery.RefreshToken +``` + +Each grant can have its own delivery configuration. + +### Mode-Specific Delivery Defaults -`options.AuthResponse` controls how authentication credentials and redirect behavior are represented in responses. +| Authentication Mode | Session | Access Token | Refresh Token | +|---|---|---|---| +| PureOpaque | Cookie | Not issued | Not issued | +| Hybrid | Cookie | Header | Cookie | +| PureJwt | Not issued | Header | Cookie | + +These are the built-in defaults before application-profile adaptation and explicit configuration. -The available groups are: +For MAUI, grants that would otherwise use cookie delivery default to header delivery. + +### Configure Grant Delivery ```csharp -options.AuthResponse.SessionIdDelivery -options.AuthResponse.AccessTokenDelivery -options.AuthResponse.RefreshTokenDelivery +builder.Services.AddUltimateAuthServer(options => +{ + options.AuthMode = UAuthMode.PureJwt; -options.AuthResponse.Login -options.AuthResponse.Logout + options.GrantDelivery.AccessToken.Mode = GrantDeliveryMode.Header; + options.GrantDelivery.RefreshToken.Mode = GrantDeliveryMode.Cookie; +}); ``` -These settings govern credential delivery and authentication response behavior. +An explicit per-grant delivery mode takes precedence over the global delivery default and the built-in mode-specific default. + +Only credentials available in the selected authentication mode can be configured for delivery. + +### Credential Delivery Versus Request Authentication + +Response headers deliver newly issued credentials to the client. + +The default credential response header names are: + +| Credential | Response Header | +|---|---| +| Session | `uas` | +| Access token | `uat` | +| Refresh token | `uar` | + +These response headers must not be confused with the headers used to authenticate subsequent requests. + +For example, the Blazor client receives an access token through the configured response header and sends it on subsequent authenticated requests using `Authorization: Bearer`. + +### Redirect Configuration + +Login and logout redirect behavior is configured separately: + +```csharp +options.Redirect.Login +options.Redirect.Logout +``` -### Important: Mode-Specific Response Defaults +A redirect is a navigation concern, not an authentication credential. -UltimateAuth provides response templates for authentication modes. +### Login Transport Discovery -For example, `PureOpaque` uses a session-oriented cookie response, while `Hybrid` combines session and token delivery behavior. +The client discovers whether the effective server configuration supports navigation-based login or requires fetch-based submission. -The effective response may therefore depend on the resolved authentication mode and flow. +Header-delivered access tokens require a transport that allows the client to observe and process the authentication response. -Do not assume that a single globally configured response delivery setting applies unchanged to every authentication mode. +Applications should normally allow the client to select the appropriate login transport automatically. ### Security Considerations -Credential delivery settings determine whether sensitive authentication material is exposed through cookies, headers, or other response mechanisms. +Credential delivery must be compatible with the selected authentication mode, application profile, and deployment topology. -Only customize them when the application has a clear requirement and the selected transport is appropriate for the client platform. +Browser cookie restrictions, CORS policies, trusted origins, and token storage behavior remain relevant regardless of the selected transport. -For advanced response customization, see [Advanced Configuration](/docs/configuration/advanced-configuration). +For additional client-side behavior, see [Authentication](/docs/client-sdk/authentication). ## 23. Diagnostics Options diff --git a/docs/content/fundamentals/application-profiles.md b/docs/content/fundamentals/application-profiles.md index c29c363d..5ee5754b 100644 --- a/docs/content/fundamentals/application-profiles.md +++ b/docs/content/fundamentals/application-profiles.md @@ -215,7 +215,7 @@ A Blazor WebAssembly application communicating with a separate API may benefit f These are architectural recommendations, not inherent limitations of the runtimes. -### Recommended defaults +### Recommended Authentication Modes | Application environment | Recommended mode | Reason | |---|---|---| diff --git a/docs/content/fundamentals/auth-modes.md b/docs/content/fundamentals/auth-modes.md index 9dc1b42d..6ac0fff0 100644 --- a/docs/content/fundamentals/auth-modes.md +++ b/docs/content/fundamentals/auth-modes.md @@ -42,7 +42,7 @@ Depending on the mode, it may be: - An opaque token resolved and validated by the server. - A JWT validated cryptographically without a session lookup. -An access token is not necessarily a session identifier. In Hybrid, the opaque access token is a separate credential associated with a server-side session. +An access token is not a session identifier. In Hybrid, the JWT access token is a separate credential issued alongside a server-side session. The session remains authoritative for session-backed authentication and lifecycle management. **Refresh token** @@ -175,104 +175,91 @@ PureOpaque is not restricted to server-to-server communication. It can also be u ### Session-backed authentication with separate tokens -Hybrid combines server-side authentication sessions with separately issued access and refresh tokens. +Hybrid combines server-authoritative authentication sessions with JWT access tokens and opaque refresh tokens. -The current implementation supports opaque session credentials and JWT access tokens. The server-side session remains authoritative for session-backed authentication and lifecycle operations. +A successful login establishes a server-side session and issues separate access and refresh credentials. -Hybrid should not be confused with PureJwt. A JWT issued within a Hybrid authentication context may retain a relationship with the server-side session. +```text +Authentication + | + +----> Opaque Session Credential + | | + | Session Validation + | | + | Root / Chain / Session + | + +----> JWT Access Token + | + +----> Opaque Refresh Token +``` -Resource API support is currently limited to the session-validation path. Automatic selection between opaque session validation and Hybrid JWT validation is not yet implemented. +The session identifier, access token, and refresh token represent different credentials with different responsibilities. -Consequently, applications must explicitly configure compatible credentials and validation behavior when integrating Hybrid clients with separate Resource APIs. +The server-side session remains authoritative for session-backed authentication. Issuing a JWT does not automatically make Hybrid authentication stateless. +### Current Resource API support -```text -Client - | - | Opaque Access Token - v -Access Token Resolution - | - v -Associated Session - | - v -Session Validation - | - v -Authenticated Identity - | - v -AccessContext -``` +In the current implementation, Hybrid Resource APIs authenticate requests using the opaque session credential and validate the session remotely through UAuthHub. -The opaque access token and internal session identifier represent different concepts. +Hybrid-aware JWT access-token validation in separate Resource APIs is not yet implemented. -The access token is a client-facing authentication credential with its own lifetime. The session represents the server-authoritative authentication state. +Applications requiring independent JWT validation should explicitly select PureJwt and configure compatible signing and verification keys. ### Refresh and session lifecycle -Hybrid uses refresh tokens to continue authentication without requiring a new login. +Hybrid uses refresh tokens to continue authentication without requiring the user to authenticate again. A successful refresh validates the relevant session and refresh-token state, applies the configured session policies, and issues replacement credentials. -Access-token lifetime and session lifetime can therefore be managed separately. - -For example, an application may use a short-lived opaque access token while maintaining a longer-lived session, subject to refresh-token expiration and revocation rules. - -A valid refresh token must not be allowed to restore an expired or revoked session. +Session lifetime, access-token lifetime, and refresh-token lifetime are separate concerns. ### Advantages -**Separate credential lifetimes** - -Access tokens can expire independently of the underlying session. +**Server-authoritative authentication** -**Immediate session-based revocation** +Session-backed requests remain subject to server-side session validation and lifecycle policies. -Because session validity is enforced during authentication, revoking the session prevents associated access tokens from authenticating on subsequent validations. +**Centralized session management** -**Opaque access credentials** +Applications retain access to device-associated sessions, session chains, revocation, and other session-management capabilities. -The access token does not disclose identity claims, roles, tenant information, or other application data through a readable token payload. - -**Centralized security policies** +**Separate credential lifetimes** -Session status and related security conditions can be enforced as part of authentication. +Access and refresh credentials can have lifetimes appropriate to their individual responsibilities. -**Suitable for API-oriented clients** +**Unified application integration** -Applications can use access and refresh tokens while retaining server-side control over the authenticated session. +Hybrid provides a common authentication model for browser applications, native clients, and centralized authentication deployments. ### Limitations -**More complex lifecycle** +**Server-side state** -Hybrid requires access-token issuance, refresh-token management, rotation, replay protection, and session lifecycle coordination. +Hybrid requires session infrastructure and refresh-token lifecycle management. -**Server-side validation remains mandatory** +**Remote validation dependency** -Opaque access tokens do not provide stateless JWT validation. The server must resolve the token and enforce the associated session state. +Separate Resource APIs using session validation depend on the availability of the authentication server. -**Additional infrastructure dependencies** +**JWT integration boundaries** -Token resolution and session validation may require storage or cache access. +Hybrid JWT access tokens must not be treated as interchangeable with PureJwt access tokens. The current Resource API implementation does not support Hybrid-aware JWT validation. -**Credential theft remains a risk** +**Credential confidentiality** -Opaque tokens conceal claims but remain bearer credentials. Their format does not prevent unauthorized use if they are stolen. +JWT payloads are readable by their holders. Signing protects integrity and authenticity, not confidentiality. ### Recommended applications -Hybrid is generally appropriate for: +Hybrid is particularly useful for: + +- Blazor WebAssembly applications. +- Native and mobile applications. +- Applications using centralized authentication through UAuthHub. +- Applications requiring token-based credential delivery while retaining server-authoritative session management. -- Blazor WebAssembly applications communicating with an API. -- Web applications with a separate backend API. -- Mobile and desktop applications requiring refresh-token continuity. -- Full-stack applications needing centrally controlled authentication. -- Systems requiring separate access-token expiration and immediate session revocation. +Hybrid is the default authentication mode for application profiles other than BlazorServer under the built-in mode resolver. -Hybrid is particularly useful when the application benefits from access/refresh token semantics but does not want to sacrifice server-authoritative session validation. ## SemiHybrid @@ -553,7 +540,7 @@ UltimateAuth's four authentication modes represent four distinct strategies: **PureOpaque** uses a server-side session as the authentication authority and avoids a separate access/refresh token lifecycle. -**Hybrid** uses separate opaque access and refresh tokens while requiring authoritative session validation for authenticated requests. +**Hybrid** combines server-authoritative sessions with JWT access tokens and opaque refresh tokens. The current Resource API implementation authenticates Hybrid requests through remote session validation. **SemiHybrid** uses JWT access tokens for stateless request authentication while retaining server-side sessions for refresh, logout, revocation, and device management. diff --git a/docs/content/fundamentals/runtime-architecture.md b/docs/content/fundamentals/runtime-architecture.md index 8c751676..f8d27344 100644 --- a/docs/content/fundamentals/runtime-architecture.md +++ b/docs/content/fundamentals/runtime-architecture.md @@ -210,15 +210,47 @@ It must then enforce the relevant authorization policies. ### Authentication validation depends on the mode -In PureOpaque and Hybrid, authentication requires server-side session authority. +The authentication mode determines how a resource application establishes the caller's authenticated identity. -The resource authentication path must therefore have access to the infrastructure necessary to enforce the relevant session validation requirements. +In PureOpaque and Hybrid, the current Resource API implementation relies on remote session validation through UAuthHub. -In SemiHybrid and PureJwt, normal access-token authentication uses JWT validation without a mandatory session lookup. +```text +Client + | + | Session credential + v +Resource API + | + | Remote session validation + v +UAuthHub + | + v +Session infrastructure +``` + +In PureJwt, the Resource API validates JWT access tokens locally using trusted verification keys and explicit token-validation configuration. + +```text +Client + | + | JWT access token + v +Resource API + | + v +Local JWT validation +``` + +UAuthHub remains responsible for authentication flows, credential issuance, and refresh-token lifecycle management. + +A PureJwt Resource API does not need to contact UAuthHub for ordinary access-token validation. + +Hybrid-aware JWT validation in separate Resource APIs is not yet implemented. -This can allow a resource API to validate access tokens locally when it has the required verification keys and token-validation configuration. +SemiHybrid remains a planned authentication mode. -The authentication mode therefore affects the resource application's infrastructure dependencies. +Authentication mode selection therefore determines the resource application's infrastructure dependencies, revocation semantics, and authorization freshness guarantees. ### Authorization remains local to the protected operation diff --git a/docs/content/getting-started/index.md b/docs/content/getting-started/index.md index e5b91581..af697330 100644 --- a/docs/content/getting-started/index.md +++ b/docs/content/getting-started/index.md @@ -118,7 +118,7 @@ They should not necessarily use identical credential storage, transport, or auth UltimateAuth separates the common authentication model from client-specific integration. -```text +```text Your .NET Applications Blazor Server Blazor WebAssembly @@ -138,7 +138,7 @@ UltimateAuth separates the common authentication model from client-specific inte ▼ Shared Security Lifecycle -``` +``` The architecture also provides foundations for .NET MAUI, traditional ASP.NET Core applications, and API-oriented integrations. @@ -428,4 +428,4 @@ UltimateAuth brings together the concepts needed to establish, maintain, evaluat **Start simple. Understand the security model. Extend when you need to.** -[Continue to QuickStart](/docs/getting-started/quickstart) \ No newline at end of file +[Continue to QuickStart](/docs/getting-started/quickstart) diff --git a/docs/content/getting-started/real-world-setup.md b/docs/content/getting-started/real-world-setup.md index eee98995..94f258b9 100644 --- a/docs/content/getting-started/real-world-setup.md +++ b/docs/content/getting-started/real-world-setup.md @@ -574,7 +574,11 @@ Include the UltimateAuth JavaScript asset in the application's HTML host page. A single UAuthHub can issue different authentication credentials according to the resolved application profile and server configuration. -Blazor Server defaults to PureOpaque, while Blazor WebAssembly and MAUI default to Hybrid. API-oriented profiles default to PureJwt. +Blazor Server defaults to PureOpaque. All other application profiles default to Hybrid under the built-in authentication mode resolver. + +PureJwt must be explicitly selected when independent JWT-based authentication is required. + +UAuthHub and Resource APIs must be configured with compatible authentication modes and credential transports. JWT-enabled modes require a signing key. The UAuthHub remains responsible for protecting that key and issuing trusted access tokens. @@ -751,6 +755,46 @@ dotnet add package CodeBeam.UltimateAuth.Server ### Configure services +#### Hybrid Resource API + +Hybrid is the default authentication mode for Resource APIs. + +The current Hybrid Resource API implementation authenticates requests using opaque session credentials and validates those sessions through UAuthHub. + +```csharp +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllers(); + +builder.Services.AddUltimateAuthResourceApi(options => +{ + options.Hub.BaseUrl = "https://auth.example.com"; + options.Cors.AllowedOrigins.Add("https://app.example.com"); +}); + +var app = builder.Build(); + +app.UseHttpsRedirection(); +app.UseUltimateAuthResourceApiWithAspNetCore(); + +app.MapControllers(); +app.Run(); +``` + +`Hub.BaseUrl` is the base address of the authentication server. + +The default incoming session credential transport is cookie-based. + +The browser must be able to send the session cookie to the Resource API. Compatible cookie scope, deployment topology, and CORS configuration are required. + +The Resource API forwards the selected session credential and device context to UAuthHub for validation. + +Hybrid-aware JWT access-token validation is not yet supported by separate Resource APIs. + +#### PureJwt Resource API + +Select PureJwt explicitly when the Resource API should validate JWT access tokens independently of UAuthHub. + `PureJwt` Resource API's `Program.cs`: ```csharp @@ -775,7 +819,7 @@ builder.Services.AddUltimateAuthResourceApi(options => ?? throw new InvalidOperationException("JWT verification key is missing.") }); - options.Auth.AccessToken.DeliveryMode = GrantDeliveryMode.Header; + options.Auth.Mode = UAuthMode.PureJwt; options.Cors.AllowedOrigins.Add("https://app.example.com"); }); @@ -790,25 +834,6 @@ app.Run(); ``` -`PureOpaque` Resource API's `Program.cs`: - -```csharp -builder.Services.AddUltimateAuthResourceApi(options => -{ - options.Auth.Mode = UAuthMode.PureOpaque; - - options.Hub.BaseUrl = "https://auth.example.com"; - - options.Auth.Session.DeliveryMode = GrantDeliveryMode.Cookie; - - options.Auth.Session.CookieName = "uas"; - - options.Cors.AllowedOrigins.Add("https://app.example.com"); -}); -``` - -`Hub.BaseUrl` is the base address of the authentication server. - Notice that this example uses the Hub origin without the `/auth` suffix, matching the current Resource API samples. `AllowedOrigins` controls the browser origins permitted by the Resource API's CORS configuration. @@ -1099,7 +1124,13 @@ The default resolver maps application profiles to authentication modes. This mapping describes the resolver's behavior, not a guarantee that every mode is currently fully supported by the server. -In particular, `PureJwt` and `SemiHybrid` have implementation limitations in the current release. +PureOpaque, Hybrid, and PureJwt are implemented authentication modes. + +SemiHybrid remains reserved for future implementation. + +Hybrid Resource APIs currently support session-based authentication. PureJwt Resource APIs support independent JWT validation. + +Applications must explicitly configure compatible authentication modes when the built-in defaults do not match their architecture. ### Restrict allowed modes diff --git a/docs/content/migration/index.md b/docs/content/migration/index.md index 651a0643..5868eef7 100644 --- a/docs/content/migration/index.md +++ b/docs/content/migration/index.md @@ -20,7 +20,7 @@ Preview and release candidate versions are excluded. | Version | Migration Impact | What's Changed | Migration Guide | |---|---|---|---| -| **v0.2.0 (In Progress)** | **Medium (Provisional)** | Authorization changes, native login forms, authentication security defaults, concurrency controls, and persistence updates | [View Guide](/docs/migration/v0.2.0) | +| **v0.2.0 (In Progress)** | **High (Provisional)** | Authorization changes, native login forms, authentication security defaults, concurrency controls, and persistence updates | [View Guide](/docs/migration/v0.2.0) | | **v0.1.4** | **Low** | CSRF protection, antiforgery integration, and interface changes | [View Guide](/docs/migration/v0.1.4) | | **v0.1.3** | **None** | Session deletion, revocation, and refresh consistency fixes | Not required | | **v0.1.2** | **None** | Password change transaction and session revocation fixes | Not required | diff --git a/docs/content/migration/v0.2.0.md b/docs/content/migration/v0.2.0.md index 05d1c95e..3e862b1d 100644 --- a/docs/content/migration/v0.2.0.md +++ b/docs/content/migration/v0.2.0.md @@ -6,9 +6,9 @@ group: migration # Migrating to v0.2.0 -**Migration Impact: Medium — In Progress** +**Migration Impact: High — In Progress** -**Latest published prerelease reviewed: v0.2.0-preview.2** +**Latest published prerelease reviewed: v0.2.0-preview.4** This guide covers migration requirements for the upcoming UltimateAuth v0.2.0 release. @@ -40,6 +40,7 @@ The following table focuses on commonly accessed public APIs and configuration p | `AutoDetectClientProfile` | `AutoDetectApplicationProfile` | | `ClientProfileModes` | `ApplicationProfileModes` | | `IClientProfileDetector` | `IApplicationProfileDetector` | +| `IFlowClient.LoginAsync(...)` returning `Task` | `IFlowClient.LoginAsync(...)` returning `Task` | | `TokenResponseMode` | `GrantDeliveryMode` | | `AuthResponse.SessionIdDelivery` | `GrantDelivery.Session` | | `AuthResponse.AccessTokenDelivery` | `GrantDelivery.AccessToken` | @@ -50,6 +51,23 @@ The following table focuses on commonly accessed public APIs and configuration p | `ResourceApi.AllowedClientOrigins` | `ResourceApi.Cors.AllowedOrigins` | | `ResourceApi.CorsPolicyName` | `ResourceApi.Cors.PolicyName` | +### Common Behavioral Changes + +The following changes may affect existing applications even when no compilation errors occur. + +| Area | Previous Behavior | v0.2.0 Behavior | +|---|---|---| +| Login submission | Navigation-based | Automatic navigation or fetch selection | +| Hybrid access token | Opaque | JWT | +| API authentication mode | PureJwt under the previous v0.2.0 resolver | Hybrid | +| Resource API authentication | Remote session validation | Hybrid remote session validation by default | +| Access-token handling | Application-managed when required | Built-in in-memory token store | +| Logout completion | Navigation-oriented submission | Response-aware completion and local credential cleanup | + +Applications using the standard UltimateAuth integrations generally do not need to rewrite their login or logout implementations. + +However, applications relying on specific navigation behavior, custom credential handling, or explicit authentication mode assumptions should review the corresponding migration sections. + These are API and configuration-path replacements, not guarantees of identical behavior. **Important:** `AuthResponse` is obsolete and no longer functional. Accessing it throws `NotSupportedException`. Applications must migrate to `GrantDelivery` and `Redirect`. @@ -928,17 +946,36 @@ Do not configure the server's token-hashing key as a Resource API verification k ### Remote versus local authentication -The built-in Resource API mode selection now defaults to `PureJwt`, rather than assuming remote session validation. +The built-in authentication mode resolver now selects PureOpaque for BlazorServer and Hybrid for all other application profiles. + +Resource APIs default to Hybrid. + +Existing applications using remote session validation can continue using session-backed authentication by configuring the Hub address. + +```csharp +builder.Services.AddUltimateAuthResourceApi(options => +{ + options.Hub.BaseUrl = "https://auth.example.com"; +}); +``` + +The default incoming session credential transport is cookie-based. + +PureJwt must be explicitly selected when independent JWT validation is required: -This is a **behavioral change for applications that previously relied on the Resource API's implicit session-validation configuration**. +```csharp +options.Auth.Mode = UAuthMode.PureJwt; +``` + +The issuing authentication server must also be configured to issue compatible PureJwt credentials. -To retain remote session validation, explicitly select the appropriate session-backed mode and configure `Hub.BaseUrl`. +Although Hybrid now issues JWT access tokens, the current Hybrid Resource API implementation continues to use remote session validation. -A PureJwt Resource API validates JWTs locally and does not require a Hub URL for each access-token validation request. +Hybrid-aware JWT validation in separate Resource APIs is not yet supported. -Review existing Resource APIs before upgrading, especially when they expect opaque session IDs instead of JWT access tokens. +UAuthHub and Resource APIs resolve their authentication modes independently. Automatic authentication configuration discovery and mode negotiation are not currently supported. -See [Resource API Requests](/docs/client-sdk/resource-api-requests) and [Authentication Modes](/docs/fundamentals/auth-modes). +Applications should verify authentication mode compatibility, cookie scope, credential transport, and CORS configuration before deployment. ## 20. Refresh Token Persistence and Database Migration @@ -1066,6 +1103,117 @@ For customized deployments, verify the following scenarios against the selected These checks are especially important when upgrading implementations that previously assumed all authentication contexts were backed by server-side sessions. +## 22. Login Transport and Client API Changes + +**Authentication client changes in v0.2.0** + +UltimateAuth now supports both navigation-based and fetch-based login submission. + +The client discovers the effective server capabilities and selects a compatible login transport automatically. + +### LoginAsync return type + +The return type of `IFlowClient.LoginAsync` has changed. + +**Before:** + +```csharp +Task LoginAsync(LoginRequest request, string? returnUrl = null); +``` + +**After:** + +```csharp +Task LoginAsync( + LoginRequest request, + string? returnUrl = null, + UAuthLoginTransport transport = UAuthLoginTransport.Auto); +``` + +Existing awaited calls remain source-compatible: + +```csharp +await UAuthClient.Flows.LoginAsync(request); +``` + +Applications can now inspect the returned result: + +```csharp +var result = await UAuthClient.Flows.LoginAsync(request); +``` + +For navigation-based submissions, successful submission does not itself confirm that the server has accepted the authentication credentials. + +Fetch-based submissions allow the client to observe the authentication response and process the delivered credentials. + +Custom `IFlowClient` implementations, test doubles, and mocks must be updated to match the new method signature. + +### TryLoginAsync signature + +`TryLoginAsync` now accepts an optional login transport parameter: + +```csharp +Task TryLoginAsync( + LoginRequest request, + UAuthSubmitMode mode, + string? returnUrl = null, + UAuthLoginTransport transport = UAuthLoginTransport.Auto); +``` + +The existing `TryOnly`, `TryAndCommit`, and `DirectCommit` submission modes remain available. + +Existing application calls do not need to specify the new parameter. + +### Explicit login transport + +Applications can explicitly select a transport when necessary: + +```csharp +await UAuthClient.Flows.LoginAsync( + request, + transport: UAuthLoginTransport.Fetch); +``` + +The available transport strategies are: + +- `Auto` +- `Fetch` +- `Navigation` + +`Auto` is the default and recommended strategy. + +Applications must not assume that every login operation performs a full browser navigation. + +### Login transport discovery endpoint + +A new endpoint exposes the effective login transport capabilities: + +```text +/auth/login/transport +``` + +Applications using custom endpoint paths can configure: + +```csharp +options.Endpoints.LoginTransport = "/login/transport"; +``` + +Review reverse proxies, endpoint allowlists, and custom authentication endpoint configurations to ensure that this endpoint is accessible to the client. + +### Custom client implementations + +The `IFlowClient` contract also introduces: + +```csharp +Task RecoverAsync(); +``` + +This operation supports authentication recovery when a usable access token is unavailable but a compatible refresh credential remains available. + +Custom client implementations must implement the updated contract. + +Applications using the built-in UltimateAuth client do not need to implement recovery manually. + --- This page will continue to evolve through the v0.2.0 preview and RC series and will become the stable migration guide when v0.2.0 is released. diff --git a/docs/content/security/token-security.md b/docs/content/security/token-security.md index 2865b1c3..1fa25141 100644 --- a/docs/content/security/token-security.md +++ b/docs/content/security/token-security.md @@ -156,9 +156,9 @@ UltimateAuth selects credential behavior according to the configured authenticat | Mode | Access mechanism | Continuation mechanism | Protected request authority | |---|---|---|---| | **PureOpaque** | Opaque session credential | Session lifecycle | Server-managed session state | -| **Hybrid** | Opaque access credential | Opaque refresh credential | Server-managed session state | +| **Hybrid** | Opaque session credential and JWT access token | Opaque refresh credential | Server-managed session state for the current session-backed path | | **SemiHybrid** | JWT access token | Server-managed refresh flow | Locally validated JWT | -| **PureJwt** | JWT access token | Optional refresh mechanism | Locally validated JWT | +| **PureJwt** | JWT access token | Stateful refresh-token rotation | Locally validated JWT | ### PureOpaque @@ -172,13 +172,15 @@ Session lifecycle operations govern the continuation and validity of authenticat ### Hybrid -Hybrid uses distinct opaque access and refresh credentials. +Hybrid establishes server-side sessions and issues JWT access tokens together with opaque refresh credentials. -Access requests are validated against authoritative server-managed state. +The current session-backed authentication path relies on authoritative server-managed session state. -Refresh operations use the refresh credential to continue authentication according to the configured lifecycle and rotation behavior. +Refresh operations validate the relevant session and refresh credential before issuing replacement credentials. -**Hybrid does not require JWT access tokens.** +Hybrid-aware JWT validation in separate Resource APIs is not yet implemented. + +JWT payloads are readable by their holders. The use of signed JWTs does not provide payload confidentiality. ### SemiHybrid @@ -276,7 +278,13 @@ They are intended for the authentication system's refresh operation, not for gen In UltimateAuth, refresh behavior is mode-dependent. -PureOpaque does not require a separate refresh credential pair, while Hybrid and SemiHybrid use refresh flows. PureJwt can support an optional refresh mechanism. +PureOpaque does not issue a separate access-token and refresh-token pair. + +Hybrid uses refresh-token rotation together with session validation. + +PureJwt uses stateful refresh-token rotation without requiring an authentication session. + +SemiHybrid is intended to combine JWT authentication with server-managed session lifecycle operations. ### Refresh Security Requirements diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/auth-flows/refresh-flow.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/auth-flows/refresh-flow.json index d65dac01..20763899 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/auth-flows/refresh-flow.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/auth-flows/refresh-flow.json @@ -1,7 +1,7 @@ { "Slug": "auth-flows/refresh-flow", "Title": "Refresh", - "Html": "\n\u003Cp\u003ERefresh is how an existing authentication context continues without asking the user to authenticate again. In UltimateAuth, it is not synonymous with issuing a new access token: the operation depends on the active authentication mode and on whether the context is represented by a server-side session, refresh credentials, or both.\u003C/p\u003E\n\u003Cp\u003EA successful refresh preserves the authenticated identity and its continuity. It does \u003Cstrong\u003Enot\u003C/strong\u003E prove the user\u0027s credentials again, create a new login, or necessarily extend every lifetime associated with the authentication.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022the-model-continuity-not-a-second-login\u0022\u003EThe model: continuity, not a second login\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth distinguishes three related operations:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EAuthentication\u003C/strong\u003E establishes a new authenticated context after the required proof is accepted.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003ERefresh\u003C/strong\u003E attempts to continue an already established context, subject to its current validity and security policies.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReauthentication\u003C/strong\u003E establishes trust again when continuation is unavailable or no longer permitted.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThis distinction matters for both security and client behavior. A refresh request can fail because a session expired, a refresh credential is invalid or consumed, the device context does not match, or the underlying chain is no longer usable. The client should treat an unsuccessful refresh as a need to authenticate again, not as an invitation to retry the same credential indefinitely.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-dependent-strategies\u0022\u003EMode-dependent strategies\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EContinuation mechanism\u003C/th\u003E\n\u003Cth\u003ERequired state\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ESession touch\u003C/td\u003E\n\u003Ctd\u003EValid server-side session\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003ESession-backed refresh-token rotation\u003C/td\u003E\n\u003Ctd\u003EValid session and refresh token\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESemiHybrid\u003C/td\u003E\n\u003Ctd\u003EPlanned\u003C/td\u003E\n\u003Ctd\u003ENot currently supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003ERefresh-token rotation\u003C/td\u003E\n\u003Ctd\u003EValid refresh token and refresh chain\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-refresh-without-a-session\u0022\u003EPureJwt: refresh without a session\u003C/h3\u003E\n\u003Cp\u003EPureJwt uses a persisted refresh-token chain without requiring an authentication session.\u003C/p\u003E\n\u003Cp\u003EThe refresh operation:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates the refresh token, tenant, and device binding.\u003C/li\u003E\n\u003Cli\u003EVerifies that the token is associated with a valid refresh chain and is not session-bound.\u003C/li\u003E\n\u003Cli\u003EResolves the authenticated user\u0027s current identity information and claims.\u003C/li\u003E\n\u003Cli\u003EGenerates replacement access and refresh credentials.\u003C/li\u003E\n\u003Cli\u003EAtomically consumes the previous refresh token and persists its replacement.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe new JWT access token can be validated independently by Resource APIs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022concurrent-requests-and-replay-protection\u0022\u003EConcurrent requests and replay protection\u003C/h3\u003E\n\u003Cp\u003EA consumed refresh token cannot be used for another successful rotation.\u003C/p\u003E\n\u003Cp\u003EThe configured concurrent-request window distinguishes likely overlapping refresh requests from later reuse attempts.\u003C/p\u003E\n\u003Cp\u003EReuse outside that window can revoke the associated refresh chain.\u003C/p\u003E\n\u003Cp\u003EFor PureJwt, this revocation does not require a Session or SessionChain record.\u003C/p\u003E\n\u003Cp\u003EPreviously issued JWT access tokens are not automatically invalidated by refresh-token rotation or refresh-chain revocation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-touch\u0022\u003ESession touch\u003C/h2\u003E\n\u003Cp\u003EA session touch is a controlled update to existing server-side authentication state. It does not issue a replacement credential or create a new session.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ESession ID\n \u2192 Validate session, chain and device context\n \u2192 Recheck active state and chain/session relationship\n \u2192 Touch if policy requires\n \u2192 Continue with the same session ID\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn \u003Ccode\u003EPureOpaque\u003C/code\u003E, the refresh flow requires a session ID. The session validator checks the session against the current tenant, device context and session options. The touch service then reloads the session and chain from the store and checks that they are still active and consistent, including the chain\u0027s active session, tenant, user and chain identifiers.\u003C/p\u003E\n\u003Cp\u003ETouch behavior is governed by the effective session options:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003ETouchInterval\u003C/code\u003E avoids writing activity state on every request. If the interval has not elapsed, the operation may succeed as \u003Cstrong\u003ENoOp\u003C/strong\u003E.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ETouchMode\u003C/code\u003E is \u003Ccode\u003EIfNeeded\u003C/code\u003E by default; \u003Ccode\u003EForce\u003C/code\u003E requests a touch even when the normal interval has not elapsed.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ESlidingExpiration\u003C/code\u003E allows a touch to extend the session expiration using the configured \u003Ccode\u003ELifetime\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EAn absolute chain expiration remains an upper bound; sliding expiration cannot extend the session beyond it.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EIdleTimeout\u003C/code\u003E participates in chain-state validation. An idle or otherwise inactive chain cannot be revived merely by touching it.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA successful \u003Cstrong\u003ENoOp\u003C/strong\u003E is not a failed refresh: the existing state was valid, but no persistence update was necessary. Likewise, a touch is not an unconditional promise to extend the session\u0027s expiry; that depends on policy and the absolute limit.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-rotation\u0022\u003ERefresh-token rotation\u003C/h2\u003E\n\u003Cp\u003ERotation replaces a valid refresh credential while preserving its association with the existing authentication context.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ERefresh token\n \u2192 Validate token, tenant, device and expected session (if supplied)\n \u2192 Resolve user, session and chain\n \u2192 Prepare replacement refresh/access tokens\n \u2192 Atomically consume old refresh token and store replacement\n \u2192 Return new credentials\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe rotation service first rejects modes or configurations that do not permit refresh-token issuance (\u003Ccode\u003EPureOpaque\u003C/code\u003E or \u003Ccode\u003EIssueRefresh = false\u003C/code\u003E). It then validates the presented credential and its context. The replacement refresh token and access token are prepared before the existing token is consumed. Persistence uses the refresh-token store\u0027s execution boundary and \u003Ccode\u003ETryConsumeAsync\u003C/code\u003E, so competing requests cannot both successfully consume the same old token.\u003C/p\u003E\n\u003Cp\u003ERotation preserves the validated user, session and chain association; it is \u003Cstrong\u003Enot\u003C/strong\u003E a new authentication or a new session. Claims for the replacement access token are obtained through the configured claims provider.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022reuse-and-concurrent-requests\u0022\u003EReuse and concurrent requests\u003C/h3\u003E\n\u003Cp\u003EA consumed refresh token cannot be used again to obtain another replacement. UltimateAuth distinguishes two situations:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ELikely concurrent request:\u003C/strong\u003E if a consumed token has a recorded replacement and the second request falls within \u003Ccode\u003ERefreshTokenConcurrentRequestWindow\u003C/code\u003E, the second rotation is rejected without treating it as a confirmed replay.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReplay outside that window:\u003C/strong\u003E the rotation service revokes the associated refresh-token chain, or tokens associated with the session when a chain identifier is unavailable.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThis distinction reduces destructive responses to ordinary client-side concurrency while retaining a response to suspicious reuse. The concurrency window is \u003Cstrong\u003Enot\u003C/strong\u003E a grace period in which the old token may be exchanged again: the second request still fails.\u003C/p\u003E\n\u003Cp\u003EThe rotation implementation shown here revokes refresh-token state. Do not interpret that as an unconditional guarantee that every related server-side session is also revoked; session invalidation is a separate concern.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022how-each-mode-executes\u0022\u003EHow each mode executes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque-session-continuation\u0022\u003EPureOpaque: session continuation\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E has no refresh-token rotation step. The endpoint resolves the existing session from the authentication flow context, validates it and performs a conditional touch. It returns \u003Ccode\u003ETouched\u003C/code\u003E when state was updated or \u003Ccode\u003ENoOp\u003C/code\u003E when the valid session required no update.\u003C/p\u003E\n\u003Cp\u003ENo access token or refresh token is issued. The existing session ID remains the credential representing the continued context.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid-session-and-token-continuity\u0022\u003EHybrid: session and token continuity\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EHybrid\u003C/code\u003E requires \u003Cstrong\u003Eboth\u003C/strong\u003E a valid session ID and a refresh token. The flow:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates the session and device context.\u003C/li\u003E\n\u003Cli\u003EPerforms the session touch operation according to policy.\u003C/li\u003E\n\u003Cli\u003EValidates and rotates the refresh token, requiring it to match the expected session.\u003C/li\u003E\n\u003Cli\u003EReturns the existing session ID together with replacement access and refresh tokens.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe order is important: \u003Cstrong\u003Esession touch happens before token rotation\u003C/strong\u003E in the current implementation. These operations are not presented as one cross-store transaction. If rotation subsequently fails, the refresh response fails, although a preceding session touch may already have been persisted. This should not be described as an all-or-nothing operation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022semihybrid-and-purejwt-implementation-branches\u0022\u003ESemiHybrid and PureJwt: implementation branches\u003C/h3\u003E\n\u003Cp\u003EThe current service includes branches for two additional modes:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003ESemiHybrid\u003C/code\u003E requires a session ID and refresh token, validates the session and rotates the token, but does not touch the session.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E uses the refresh token for rotation without a session touch step in \u003Ccode\u003ERefreshFlowService\u003C/code\u003E.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese describe the existing code paths, \u003Cstrong\u003Enot a promise of v0.1.0 production support\u003C/strong\u003E. Configuration validation and supported-mode documentation remain authoritative for which modes applications can enable.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022request-resolution-and-response-delivery\u0022\u003ERequest resolution and response delivery\u003C/h2\u003E\n\u003Cp\u003EThe refresh endpoint uses the server\u0027s \u003Ccode\u003EAuthFlowContext\u003C/code\u003E. It obtains the session ID from \u003Ccode\u003Eflow.Session\u003C/code\u003E, the device from \u003Ccode\u003Eflow.Device\u003C/code\u003E, and the refresh token through \u003Ccode\u003ERefreshTokenResolver\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor refresh-token input, the resolver checks:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EThe explicit \u003Ccode\u003EX-Refresh-Token\u003C/code\u003E header, if present.\u003C/li\u003E\n\u003Cli\u003EThe configured refresh cookie, when cookie delivery is active.\u003C/li\u003E\n\u003Cli\u003EThe configured refresh header, when header delivery is active.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe explicit header takes precedence. Header values may be supplied with a \u003Ccode\u003EBearer \u003C/code\u003E prefix, which the resolver strips.\u003C/p\u003E\n\u003Cp\u003EOn success, the endpoint chooses a \u003Cstrong\u003Eprimary credential\u003C/strong\u003E according to the refresh response policy, rather than automatically writing every credential returned by the flow. The refresh token is written separately when permitted by the response policy and when a replacement exists. Actual cookie/header placement is determined by the effective response configuration and application profile.\u003C/p\u003E\n\u003Cp\u003EThe HTTP endpoint returns \u003Cstrong\u003E\u003Ccode\u003E204 No Content\u003C/code\u003E\u003C/strong\u003E on successful refresh and \u003Cstrong\u003E\u003Ccode\u003E401 Unauthorized\u003C/code\u003E\u003C/strong\u003E when continuation fails. Clients should obtain credentials from the configured response delivery mechanism rather than expecting a JSON token payload. When \u003Ccode\u003EDiagnostics.EnableRefreshDetails\u003C/code\u003E is enabled, the endpoint also writes the refresh outcome through its diagnostic response writer.\u003C/p\u003E\n\u003Cblockquote\u003E\n\u003Cp\u003EResponse delivery customization is not fully independent in v0.1.0: mode templates and application-profile adaptation constrain the effective behavior. Do not assume every configured credential-delivery override is honored.\u003C/p\u003E\n\u003C/blockquote\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022outcomes-and-client-expectations\u0022\u003EOutcomes and client expectations\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOutcome\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003Cth\u003EClient interpretation\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENoOp\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExisting session is valid; no touch was necessary\u003C/td\u003E\n\u003Ctd\u003EContinue normally\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETouched\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExisting session activity was updated\u003C/td\u003E\n\u003Ctd\u003EContinue normally\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERotated\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh token was consumed and replacement credentials issued\u003C/td\u003E\n\u003Ctd\u003EReplace stored credentials with the new values\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauthRequired\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EThe flow could not safely continue\u003C/td\u003E\n\u003Ctd\u003EStop using the failed refresh credential and require authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshFlowResult\u003C/code\u003E also recognizes \u003Ccode\u003ESuccess\u003C/code\u003E as a successful outcome, although the mode-specific branches described above return \u003Ccode\u003ENoOp\u003C/code\u003E, \u003Ccode\u003ETouched\u003C/code\u003E, \u003Ccode\u003ERotated\u003C/code\u003E or \u003Ccode\u003EReauthRequired\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EClients should serialize refresh attempts where practical. Parallel refresh requests using the same token do not produce multiple valid replacements, even when they fall within the concurrency window.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-boundaries\u0022\u003ESecurity boundaries\u003C/h2\u003E\n\u003Cp\u003ERefresh continues existing trust only while the relevant state remains valid:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ESession and chain checks:\u003C/strong\u003E session-based paths validate active state, tenant, user, chain and session relationships.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EDevice context:\u003C/strong\u003E session and refresh-token validation receive the current device context; mismatches can prevent continuation.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003ESingle-use refresh tokens:\u003C/strong\u003E successful rotation consumes the old credential and persists a replacement.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReplay response:\u003C/strong\u003E suspicious reuse can revoke refresh-token state associated with the chain or session.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EExpiration:\u003C/strong\u003E idle, session, chain and refresh-token validity rules can end continuation. Refresh does not bypass those limits.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EIssuance policy:\u003C/strong\u003E \u003Ccode\u003EIssueRefresh = false\u003C/code\u003E prevents rotation before the old token is consumed.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese controls complement one another. A refresh token should be treated as a sensitive credential, not as a harmless request to generate another access token.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EThe useful distinction is not simply \u003Cem\u003Estateful versus stateless\u003C/em\u003E. It is \u003Cstrong\u003Ewhat must remain valid for authentication to continue\u003C/strong\u003E:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E continues an existing server-side session, with conditional activity updates.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EHybrid\u003C/code\u003E requires both session validity and successful refresh-token rotation.\u003C/li\u003E\n\u003Cli\u003EOther rotation branches exist, but are not part of the completed v0.1.0 supported-mode set.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003ERefresh does not authenticate a user again. It extends the usefulness of an already established authentication context only within the boundaries of the selected mode and configured security policies.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-step\u0022\u003ENext step\u003C/h2\u003E\n\u003Cp\u003EContinue to \u003Ca href=\u0022./logout-flow\u0022\u003ELogout Flow\u003C/a\u003E.\u003C/p\u003E\n", + "Html": "\n\u003Cp\u003ERefresh is how an existing authentication context continues without asking the user to authenticate again. In UltimateAuth, it is not synonymous with issuing a new access token: the operation depends on the active authentication mode and on whether the context is represented by a server-side session, refresh credentials, or both.\u003C/p\u003E\n\u003Cp\u003EA successful refresh preserves the authenticated identity and its continuity. It does \u003Cstrong\u003Enot\u003C/strong\u003E prove the user\u0027s credentials again, create a new login, or necessarily extend every lifetime associated with the authentication.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022the-model-continuity-not-a-second-login\u0022\u003EThe model: continuity, not a second login\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth distinguishes three related operations:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EAuthentication\u003C/strong\u003E establishes a new authenticated context after the required proof is accepted.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003ERefresh\u003C/strong\u003E attempts to continue an already established context, subject to its current validity and security policies.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReauthentication\u003C/strong\u003E establishes trust again when continuation is unavailable or no longer permitted.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThis distinction matters for both security and client behavior. A refresh request can fail because a session expired, a refresh credential is invalid or consumed, the device context does not match, or the underlying chain is no longer usable. The client should treat an unsuccessful refresh as a need to authenticate again, not as an invitation to retry the same credential indefinitely.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-dependent-strategies\u0022\u003EMode-dependent strategies\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EContinuation mechanism\u003C/th\u003E\n\u003Cth\u003ERequired state\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ESession touch\u003C/td\u003E\n\u003Ctd\u003EValid server-side session\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003ESession-backed refresh-token rotation\u003C/td\u003E\n\u003Ctd\u003EValid session and refresh token\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESemiHybrid\u003C/td\u003E\n\u003Ctd\u003EPlanned\u003C/td\u003E\n\u003Ctd\u003ENot currently supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003ERefresh-token rotation\u003C/td\u003E\n\u003Ctd\u003EValid refresh token and refresh chain\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-refresh-without-a-session\u0022\u003EPureJwt: refresh without a session\u003C/h3\u003E\n\u003Cp\u003EPureJwt uses a persisted refresh-token chain without requiring an authentication session.\u003C/p\u003E\n\u003Cp\u003EThe refresh operation:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates the refresh token, tenant, and device binding.\u003C/li\u003E\n\u003Cli\u003EVerifies that the token is associated with a valid refresh chain and is not session-bound.\u003C/li\u003E\n\u003Cli\u003EResolves the authenticated user\u0027s current identity information and claims.\u003C/li\u003E\n\u003Cli\u003EGenerates replacement access and refresh credentials.\u003C/li\u003E\n\u003Cli\u003EAtomically consumes the previous refresh token and persists its replacement.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe new JWT access token can be validated independently by Resource APIs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022concurrent-requests-and-replay-protection\u0022\u003EConcurrent requests and replay protection\u003C/h3\u003E\n\u003Cp\u003EA consumed refresh token cannot be used for another successful rotation.\u003C/p\u003E\n\u003Cp\u003EThe configured concurrent-request window distinguishes likely overlapping refresh requests from later reuse attempts.\u003C/p\u003E\n\u003Cp\u003EReuse outside that window can revoke the associated refresh chain.\u003C/p\u003E\n\u003Cp\u003EFor PureJwt, this revocation does not require a Session or SessionChain record.\u003C/p\u003E\n\u003Cp\u003EPreviously issued JWT access tokens are not automatically invalidated by refresh-token rotation or refresh-chain revocation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-touch\u0022\u003ESession touch\u003C/h2\u003E\n\u003Cp\u003EA session touch is a controlled update to existing server-side authentication state. It does not issue a replacement credential or create a new session.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ESession ID\n \u2192 Validate session, chain and device context\n \u2192 Recheck active state and chain/session relationship\n \u2192 Touch if policy requires\n \u2192 Continue with the same session ID\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn \u003Ccode\u003EPureOpaque\u003C/code\u003E, the refresh flow requires a session ID. The session validator checks the session against the current tenant, device context and session options. The touch service then reloads the session and chain from the store and checks that they are still active and consistent, including the chain\u0027s active session, tenant, user and chain identifiers.\u003C/p\u003E\n\u003Cp\u003ETouch behavior is governed by the effective session options:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003ETouchInterval\u003C/code\u003E avoids writing activity state on every request. If the interval has not elapsed, the operation may succeed as \u003Cstrong\u003ENoOp\u003C/strong\u003E.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ETouchMode\u003C/code\u003E is \u003Ccode\u003EIfNeeded\u003C/code\u003E by default; \u003Ccode\u003EForce\u003C/code\u003E requests a touch even when the normal interval has not elapsed.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ESlidingExpiration\u003C/code\u003E allows a touch to extend the session expiration using the configured \u003Ccode\u003ELifetime\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EAn absolute chain expiration remains an upper bound; sliding expiration cannot extend the session beyond it.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EIdleTimeout\u003C/code\u003E participates in chain-state validation. An idle or otherwise inactive chain cannot be revived merely by touching it.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA successful \u003Cstrong\u003ENoOp\u003C/strong\u003E is not a failed refresh: the existing state was valid, but no persistence update was necessary. Likewise, a touch is not an unconditional promise to extend the session\u0027s expiry; that depends on policy and the absolute limit.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-rotation\u0022\u003ERefresh-token rotation\u003C/h2\u003E\n\u003Cp\u003ERotation replaces a valid refresh credential while preserving its association with the existing authentication context.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ERefresh token\n \u2192 Validate token, tenant, device and expected session (if supplied)\n \u2192 Resolve user, session and chain\n \u2192 Prepare replacement refresh/access tokens\n \u2192 Atomically consume old refresh token and store replacement\n \u2192 Return new credentials\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe rotation service first rejects modes or configurations that do not permit refresh-token issuance (\u003Ccode\u003EPureOpaque\u003C/code\u003E or \u003Ccode\u003EIssueRefresh = false\u003C/code\u003E). It then validates the presented credential and its context. The replacement refresh token and access token are prepared before the existing token is consumed. Persistence uses the refresh-token store\u0027s execution boundary and \u003Ccode\u003ETryConsumeAsync\u003C/code\u003E, so competing requests cannot both successfully consume the same old token.\u003C/p\u003E\n\u003Cp\u003ERotation preserves the validated user, session and chain association; it is \u003Cstrong\u003Enot\u003C/strong\u003E a new authentication or a new session. Claims for the replacement access token are obtained through the configured claims provider.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022reuse-and-concurrent-requests\u0022\u003EReuse and concurrent requests\u003C/h3\u003E\n\u003Cp\u003EA consumed refresh token cannot be used again to obtain another replacement. UltimateAuth distinguishes two situations:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ELikely concurrent request:\u003C/strong\u003E if a consumed token has a recorded replacement and the second request falls within \u003Ccode\u003ERefreshTokenConcurrentRequestWindow\u003C/code\u003E, the second rotation is rejected without treating it as a confirmed replay.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReplay outside that window:\u003C/strong\u003E the rotation service revokes the associated refresh-token chain, or tokens associated with the session when a chain identifier is unavailable.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThis distinction reduces destructive responses to ordinary client-side concurrency while retaining a response to suspicious reuse. The concurrency window is \u003Cstrong\u003Enot\u003C/strong\u003E a grace period in which the old token may be exchanged again: the second request still fails.\u003C/p\u003E\n\u003Cp\u003EThe rotation implementation shown here revokes refresh-token state. Do not interpret that as an unconditional guarantee that every related server-side session is also revoked; session invalidation is a separate concern.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022how-each-mode-executes\u0022\u003EHow each mode executes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque-session-continuation\u0022\u003EPureOpaque: session continuation\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E has no refresh-token rotation step. The endpoint resolves the existing session from the authentication flow context, validates it and performs a conditional touch. It returns \u003Ccode\u003ETouched\u003C/code\u003E when state was updated or \u003Ccode\u003ENoOp\u003C/code\u003E when the valid session required no update.\u003C/p\u003E\n\u003Cp\u003ENo access token or refresh token is issued. The existing session ID remains the credential representing the continued context.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid-session-and-token-continuity\u0022\u003EHybrid: session and token continuity\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EHybrid\u003C/code\u003E requires \u003Cstrong\u003Eboth\u003C/strong\u003E a valid session ID and a refresh token. The flow:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates the session and device context.\u003C/li\u003E\n\u003Cli\u003EPerforms the session touch operation according to policy.\u003C/li\u003E\n\u003Cli\u003EValidates and rotates the refresh token, requiring it to match the expected session.\u003C/li\u003E\n\u003Cli\u003EReturns the existing session ID together with replacement access and refresh tokens.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe order is important: \u003Cstrong\u003Esession touch happens before token rotation\u003C/strong\u003E in the current implementation. These operations are not presented as one cross-store transaction. If rotation subsequently fails, the refresh response fails, although a preceding session touch may already have been persisted. This should not be described as an all-or-nothing operation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022request-resolution-and-response-delivery\u0022\u003ERequest resolution and response delivery\u003C/h2\u003E\n\u003Cp\u003EThe refresh endpoint uses the server\u0027s \u003Ccode\u003EAuthFlowContext\u003C/code\u003E. It obtains the session ID from \u003Ccode\u003Eflow.Session\u003C/code\u003E, the device from \u003Ccode\u003Eflow.Device\u003C/code\u003E, and the refresh token through \u003Ccode\u003ERefreshTokenResolver\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor refresh-token input, the resolver checks:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EThe explicit \u003Ccode\u003EX-Refresh-Token\u003C/code\u003E header, if present.\u003C/li\u003E\n\u003Cli\u003EThe configured refresh cookie, when cookie delivery is active.\u003C/li\u003E\n\u003Cli\u003EThe configured refresh header, when header delivery is active.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe explicit header takes precedence. Header values may be supplied with a \u003Ccode\u003EBearer \u003C/code\u003E prefix, which the resolver strips.\u003C/p\u003E\n\u003Cp\u003EOn success, the endpoint chooses a \u003Cstrong\u003Eprimary credential\u003C/strong\u003E according to the refresh response policy, rather than automatically writing every credential returned by the flow. The refresh token is written separately when permitted by the response policy and when a replacement exists. Actual cookie/header placement is determined by the effective response configuration and application profile.\u003C/p\u003E\n\u003Cp\u003EThe HTTP endpoint returns \u003Cstrong\u003E\u003Ccode\u003E204 No Content\u003C/code\u003E\u003C/strong\u003E on successful refresh and \u003Cstrong\u003E\u003Ccode\u003E401 Unauthorized\u003C/code\u003E\u003C/strong\u003E when continuation fails. Clients should obtain credentials from the configured response delivery mechanism rather than expecting a JSON token payload. When \u003Ccode\u003EDiagnostics.EnableRefreshDetails\u003C/code\u003E is enabled, the endpoint also writes the refresh outcome through its diagnostic response writer.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022outcomes-and-client-expectations\u0022\u003EOutcomes and client expectations\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOutcome\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003Cth\u003EClient interpretation\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENoOp\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExisting session is valid; no touch was necessary\u003C/td\u003E\n\u003Ctd\u003EContinue normally\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETouched\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExisting session activity was updated\u003C/td\u003E\n\u003Ctd\u003EContinue normally\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERotated\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh token was consumed and replacement credentials issued\u003C/td\u003E\n\u003Ctd\u003EReplace stored credentials with the new values\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauthRequired\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EThe flow could not safely continue\u003C/td\u003E\n\u003Ctd\u003EStop using the failed refresh credential and require authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshFlowResult\u003C/code\u003E also recognizes \u003Ccode\u003ESuccess\u003C/code\u003E as a successful outcome, although the mode-specific branches described above return \u003Ccode\u003ENoOp\u003C/code\u003E, \u003Ccode\u003ETouched\u003C/code\u003E, \u003Ccode\u003ERotated\u003C/code\u003E or \u003Ccode\u003EReauthRequired\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EClients should serialize refresh attempts where practical. Parallel refresh requests using the same token do not produce multiple valid replacements, even when they fall within the concurrency window.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-boundaries\u0022\u003ESecurity boundaries\u003C/h2\u003E\n\u003Cp\u003ERefresh continues existing trust only while the relevant state remains valid:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ESession and chain checks:\u003C/strong\u003E session-based paths validate active state, tenant, user, chain and session relationships.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EDevice context:\u003C/strong\u003E session and refresh-token validation receive the current device context; mismatches can prevent continuation.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003ESingle-use refresh tokens:\u003C/strong\u003E successful rotation consumes the old credential and persists a replacement.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReplay response:\u003C/strong\u003E suspicious reuse can revoke refresh-token state associated with the chain or session.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EExpiration:\u003C/strong\u003E idle, session, chain and refresh-token validity rules can end continuation. Refresh does not bypass those limits.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EIssuance policy:\u003C/strong\u003E \u003Ccode\u003EIssueRefresh = false\u003C/code\u003E prevents rotation before the old token is consumed.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese controls complement one another. A refresh token should be treated as a sensitive credential, not as a harmless request to generate another access token.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EThe useful distinction is not simply \u003Cem\u003Estateful versus stateless\u003C/em\u003E. It is \u003Cstrong\u003Ewhat must remain valid for authentication to continue\u003C/strong\u003E:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E continues an existing server-side session, with conditional activity updates.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EHybrid\u003C/code\u003E requires both session validity and successful refresh-token rotation.\u003C/li\u003E\n\u003Cli\u003EOther rotation branches exist, but are not part of the completed v0.1.0 supported-mode set.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003ERefresh does not authenticate a user again. It extends the usefulness of an already established authentication context only within the boundaries of the selected mode and configured security policies.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-step\u0022\u003ENext step\u003C/h2\u003E\n\u003Cp\u003EContinue to \u003Ca href=\u0022./logout-flow\u0022\u003ELogout Flow\u003C/a\u003E.\u003C/p\u003E\n", "Headings": [ { "Id": "the-model-continuity-not-a-second-login", @@ -53,11 +53,6 @@ "Text": "Hybrid: session and token continuity", "Level": 1 }, - { - "Id": "semihybrid-and-purejwt-implementation-branches", - "Text": "SemiHybrid and PureJwt: implementation branches", - "Level": 1 - }, { "Id": "request-resolution-and-response-delivery", "Text": "Request resolution and response delivery", @@ -84,6 +79,6 @@ "Level": 0 } ], - "SourceHash": "280FFE36F8DDEB0C3A2B7B0CCCB08091FF26F9141DACAE0B2EA8BE2378F65D3A", + "SourceHash": "287AA7F1BE0EB954F3A9C8901150A29CA679AC6E3B7A0043F61062550DC3617D", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/authentication.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/authentication.json index 3274df45..ec886299 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/authentication.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/authentication.json @@ -1,7 +1,7 @@ { "Slug": "client-sdk/authentication", "Title": "Authentication", - "Html": "\n\u003Cp\u003EThe UltimateAuth Client SDK provides a high-level API for authentication workflows, including login, PKCE, session validation, refresh, logout, and device-specific session revocation.\u003C/p\u003E\n\u003Cp\u003EThese operations are exposed through \u003Ccode\u003EUAuthClient.Flows\u003C/code\u003E, which implements the \u003Ccode\u003EIFlowClient\u003C/code\u003E contract.\u003C/p\u003E\n\u003Cp\u003EThis guide shows how to use the authentication client in application code, handle structured results, configure interactive behavior, and choose the correct flow for different client environments.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022accessing-the-authentication-client\u0022\u003E1. Accessing the Authentication Client\u003C/h2\u003E\n\u003Cp\u003EIn a Blazor component, inject \u003Ccode\u003EIUAuthClient\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAuthentication operations are available through the \u003Ccode\u003EFlows\u003C/code\u003E property.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.RefreshAsync();\nawait UAuthClient.Flows.ValidateAsync();\nawait UAuthClient.Flows.LogoutAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe relevant methods are defined by \u003Ccode\u003EIFlowClient\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMethod\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmit a direct login flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryLoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAttempt login with configurable try/commit behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBeginPkceAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EStart a PKCE authentication flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECompletePkceLoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EComplete a PKCE login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryCompletePkceLoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EComplete PKCE with structured try/commit behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh or continue authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValidateAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidate current authentication state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELog out the current session\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutMyDeviceAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke a selected device-associated chain\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutMyOtherDevicesAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke other devices while retaining the current one\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutAllMyDevicesAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke all devices for the current user\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EAdministrative device logout operations are also available and covered later in this guide.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-the-correct-login-flow\u0022\u003E2. Choosing the Correct Login Flow\u003C/h2\u003E\n\u003Cp\u003EBefore implementing login, determine whether your application is a trusted server-hosted client or a public client.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EClient environment\u003C/th\u003E\n\u003Cth\u003ERecommended flow\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003EDirect login or supported interactive login flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUAuthHub\u003C/td\u003E\n\u003Ctd\u003EServer-hosted authentication flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WebAssembly\u003C/td\u003E\n\u003Ctd\u003EPKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBrowser SPA\u003C/td\u003E\n\u003Ctd\u003EPKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPublic native application\u003C/td\u003E\n\u003Ctd\u003EPKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EPublic clients must not rely on embedding a secret or trusting browser-executed code to protect credentials.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth restricts direct credential posting based on the configured application profile and login options.\u003C/p\u003E\n\u003Cp\u003EFor public clients, use the PKCE flow instead of enabling direct credential posting.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-login\u0022\u003E3. Direct Login\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ELoginAsync\u003C/code\u003E performs a direct login submission.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new LoginRequest\n{\n Identifier = \u0026quot;user@example.com\u0026quot;,\n Secret = \u0026quot;password\u0026quot;\n};\n\nawait UAuthClient.Flows.LoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe method returns \u003Ccode\u003ETask\u003C/code\u003E, not a structured login result.\u003C/p\u003E\n\u003Cp\u003EIt submits the login payload through the configured navigation-based transport.\u003C/p\u003E\n\u003Cp\u003EDepending on the hosting environment, this may initiate navigation or redirect behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022loginrequest-properties\u0022\u003ELoginRequest Properties\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ELoginRequest\u003C/code\u003E supports the following properties:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESecret\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential secret\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential type; defaults to \u003Ccode\u003EPassword\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMetadata\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional request metadata\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERequestTokens\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHint to request tokens when supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreviewReceipt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional receipt associated with a prior login preview\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EExample:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new LoginRequest\n{\n Identifier = email,\n Secret = password,\n CredentialType = CredentialType.Password,\n RequestTokens = true\n};\n\nawait UAuthClient.Flows.LoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ERequestTokens\u003C/code\u003E is a hint, not a guarantee that tokens will be issued. The server\u0027s authentication mode and policy remain authoritative.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022redirect-after-login\u0022\u003ERedirect After Login\u003C/h3\u003E\n\u003Cp\u003EProvide an explicit return URL when necessary:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.LoginAsync(request, returnUrl: \u0026quot;/dashboard\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe direct login flow resolves its return URL in the following order:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EThe explicit \u003Ccode\u003EreturnUrl\u003C/code\u003E argument.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ELogin.ReturnUrl\u003C/code\u003E option.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E option.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor example, client options can specify a default:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe return URL is part of the login workflow. It should not be treated as an authorization grant.\u003C/p\u003E\n\u003Cp\u003EApplications and servers must still enforce their redirect validation rules.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022interactive-login-with-tryloginasync\u0022\u003E4. Interactive Login with TryLoginAsync\u003C/h2\u003E\n\u003Cp\u003EFor interactive forms, \u003Ccode\u003ETryLoginAsync\u003C/code\u003E provides structured feedback before or during the authentication commit process.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.TryAndCommit);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is generally the more useful API for a login form that needs to display validation feedback.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022submit-modes\u0022\u003ESubmit Modes\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthSubmitMode\u003C/code\u003E defines three submission behaviors.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryOnly\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExecute the try operation and return its result without committing authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmit directly to the commit endpoint without a separate try operation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETry first, then commit when the try operation succeeds\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese modes control client workflow, not whether the server validates authentication.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDirectCommit does not bypass credential verification or server security requirements.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022tryonly-validate-without-login\u0022\u003ETryOnly: Validate Without Login\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003ETryOnly\u003C/code\u003E when you want structured feedback without establishing an authenticated session.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.TryOnly);\n\nif (result.IsSuccess)\n{\n // The try operation succeeded.\n // Authentication has not been committed.\n}\nelse\n{\n // Display the appropriate feedback.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis can be useful for a custom interactive workflow.\u003C/p\u003E\n\u003Cp\u003EA successful try result must not be interpreted as an authenticated application session.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022tryandcommit-interactive-login\u0022\u003ETryAndCommit: Interactive Login\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003ETryAndCommit\u003C/code\u003E to combine structured validation with authentication commit.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.TryAndCommit,\n returnUrl: \u0026quot;/dashboard\u0026quot;);\n\nif (!result.IsSuccess)\n{\n // Show validation feedback.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen the try stage succeeds, the client proceeds to the commit operation through its configured transport.\u003C/p\u003E\n\u003Cp\u003EThis can involve navigation, so application code should not assume that execution always continues within the same component instance.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022directcommit-single-commit-submission\u0022\u003EDirectCommit: Single Commit Submission\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.DirectCommit);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this mode, the SDK submits the commit operation directly.\u003C/p\u003E\n\u003Cp\u003EThe method returns a \u003Ccode\u003ETryLoginResult\u003C/code\u003E with \u003Ccode\u003EIsSuccess = true\u003C/code\u003E after the navigation submission completes, but this is not a structured server-side authentication success confirmation.\u003C/p\u003E\n\u003Cp\u003EIf you need structured credential validation feedback, prefer \u003Ccode\u003ETryAndCommit\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-login-results\u0022\u003E5. Handling Login Results\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ETryLoginAsync\u003C/code\u003E returns \u003Ccode\u003ETryLoginResult\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIts available properties include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIsSuccess\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EWhether the try operation succeeded\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReason\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional authentication failure reason\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERemainingAttempts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERemaining attempts, when provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELockoutUntilUtc\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELockout expiration, when provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERequiresMfa\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EWhether additional authentication is required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreviewReceipt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional receipt for subsequent flow handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EExample:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(request, UAuthSubmitMode.TryOnly);\n\nif (!result.IsSuccess)\n{\n if (result.LockoutUntilUtc is not null)\n {\n errorMessage = $\u0026quot;Login temporarily unavailable until {result.LockoutUntilUtc:u}\u0026quot;;\n }\n else\n {\n errorMessage = \u0026quot;Unable to sign in.\u0026quot;;\n }\n\n return;\n}\n\nif (result.RequiresMfa)\n{\n // Continue with the supported additional authentication flow.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not expose sensitive internal authentication details unnecessarily.\u003C/p\u003E\n\u003Cp\u003EFor public-facing login forms, generic failure messages may be preferable to displaying every failure reason.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-transport-and-protocol-errors\u0022\u003EHandling Transport and Protocol Errors\u003C/h3\u003E\n\u003Cp\u003EA structured authentication failure is different from a network or protocol failure.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Etry\n{\n var result = await UAuthClient.Flows.TryLoginAsync(request, UAuthSubmitMode.TryAndCommit);\n\n if (!result.IsSuccess)\n {\n errorMessage = \u0026quot;Unable to sign in.\u0026quot;;\n }\n}\ncatch (UAuthTransportException)\n{\n errorMessage = \u0026quot;Authentication service is unavailable.\u0026quot;;\n}\ncatch (UAuthProtocolException)\n{\n errorMessage = \u0026quot;An authentication protocol error occurred.\u0026quot;;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUse the corresponding UltimateAuth client error namespace when referencing these exception types.\u003C/p\u003E\n\u003Cp\u003EA failed authentication attempt should normally be handled through the structured try result where supported. Transport and protocol exceptions indicate different failure categories.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pkce-authentication\u0022\u003E6. PKCE Authentication\u003C/h2\u003E\n\u003Cp\u003EPKCE provides a proof mechanism for authorization-code-based authentication flows.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports PKCE using an S256 code challenge.\u003C/p\u003E\n\u003Cp\u003EThe SDK generates a cryptographically random verifier, derives its challenge, and coordinates the authorization flow.\u003C/p\u003E\n\u003Cp\u003EPublic clients such as Blazor WebAssembly should use PKCE rather than direct credential posting.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022start-pkce\u0022\u003EStart PKCE\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.BeginPkceAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EYou can provide a return URL:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.BeginPkceAsync(returnUrl: \u0026quot;/dashboard\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client performs the following operations:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EGenerates a PKCE code verifier.\u003C/li\u003E\n\u003Cli\u003EDerives an S256 code challenge.\u003C/li\u003E\n\u003Cli\u003ESends the authorization request.\u003C/li\u003E\n\u003Cli\u003EReceives an authorization code.\u003C/li\u003E\n\u003Cli\u003EInvokes the configured authorization callback, if any.\u003C/li\u003E\n\u003Cli\u003ENavigates to the configured UAuthHub login flow when automatic redirection is enabled.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe authorization code and verifier are used later to complete the flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-pkce\u0022\u003EConfigure PKCE\u003C/h3\u003E\n\u003Cp\u003EThe relevant client options include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.Enabled = true;\noptions.Pkce.AutoRedirect = true;\noptions.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EPKCE is enabled by default in \u003Ccode\u003EUAuthClientPkceLoginFlowOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EAutomatic redirection is also enabled by default.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022observe-authorization\u0022\u003EObserve Authorization\u003C/h3\u003E\n\u003Cp\u003EYou can register a callback that runs after the authorization code is received and before the automatic Hub redirect.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.OnAuthorized = async response =\u0026gt;\n{\n // Observe the authorization response.\n await Task.CompletedTask;\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis callback is useful for application-specific coordination.\u003C/p\u003E\n\u003Cp\u003EDo not log authorization codes or expose them to unrelated components.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-redirection\u0022\u003EDisable Automatic Redirection\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.AutoRedirect = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith this configuration, \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E still performs the authorization request and invokes \u003Ccode\u003EOnAuthorized\u003C/code\u003E, but it does not automatically navigate to the Hub login endpoint.\u003C/p\u003E\n\u003Cp\u003EThe application becomes responsible for coordinating the remaining flow.\u003C/p\u003E\n\u003Cp\u003EThis is an advanced integration option.\u003C/p\u003E\n\u003Cp\u003EA custom implementation must preserve the authorization code, verifier, and relevant context securely and complete the flow using the supported protocol.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-pkce-login\u0022\u003E7. Complete PKCE Login\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ECompletePkceLoginAsync\u003C/code\u003E submits the PKCE completion request.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new PkceCompleteRequest\n{\n AuthorizationCode = authorizationCode,\n CodeVerifier = codeVerifier,\n Identifier = email,\n Secret = password,\n ReturnUrl = \u0026quot;/dashboard\u0026quot;\n};\n\nawait UAuthClient.Flows.CompletePkceLoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe request model includes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthorizationCode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECode obtained from the authorization step\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECodeVerifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOriginal PKCE verifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESecret\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin credential\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional post-login destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubSessionId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional Hub session context\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe authorization code and verifier must correspond to the same PKCE flow.\u003C/p\u003E\n\u003Cp\u003EDo not generate a new verifier when completing an existing authorization.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022interactive-pkce-completion\u0022\u003EInteractive PKCE Completion\u003C/h3\u003E\n\u003Cp\u003EFor structured feedback, use \u003Ccode\u003ETryCompletePkceLoginAsync\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryCompletePkceLoginAsync(\n request,\n UAuthSubmitMode.TryAndCommit);\n\nif (!result.IsSuccess)\n{\n // Display PKCE login feedback.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe same submit modes are supported:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003ETryOnly\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022try-pkce-without-commit\u0022\u003ETry PKCE Without Commit\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryCompletePkceLoginAsync(request, UAuthSubmitMode.TryOnly);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis returns a \u003Ccode\u003ETryPkceLoginResult\u003C/code\u003E without committing a successful login.\u003C/p\u003E\n\u003Cp\u003EThe result includes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eresult.IsSuccess;\nresult.Reason;\nresult.RemainingAttempts;\nresult.LockoutUntilUtc;\nresult.RequiresMfa;\nresult.RetryWithNewPkce;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022retrywithnewpkce\u0022\u003ERetryWithNewPkce\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ERetryWithNewPkce\u003C/code\u003E indicates that the client should begin a new PKCE authorization sequence rather than continuing with the existing authorization material.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eif (result.RetryWithNewPkce)\n{\n await UAuthClient.Flows.BeginPkceAsync(\u0026quot;/login\u0026quot;);\n return;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is useful when the current PKCE context can no longer be used.\u003C/p\u003E\n\u003Cp\u003EThe application should not repeatedly resubmit the same invalid authorization code and verifier.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-credential-posting-restrictions\u0022\u003E8. Direct Credential Posting Restrictions\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth restricts direct credential posting according to the configured application profile.\u003C/p\u003E\n\u003Cp\u003EThe client option is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.AllowCredentialPost = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is the default.\u003C/p\u003E\n\u003Cp\u003EIf the current profile is not permitted to post credentials directly and the option has not enabled that capability, direct login methods throw an \u003Ccode\u003EInvalidOperationException\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor example, attempting direct login from a public client may produce an error indicating that PKCE is required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022trusted-server-hosted-clients\u0022\u003ETrusted Server-Hosted Clients\u003C/h3\u003E\n\u003Cp\u003EThe option can be explicitly configured for a trusted server-hosted integration where direct credential posting is appropriate:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.AllowCredentialPost = true;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis must not be used to bypass PKCE requirements in a public browser application.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDo not enable direct credential posting in production Blazor WebAssembly or SPA clients.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn application profile is an integration descriptor, not cryptographic proof that the caller is trusted.\u003C/p\u003E\n\u003Cp\u003EServer-side security requirements remain authoritative.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-authentication\u0022\u003E9. Refresh Authentication\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshAsync\u003C/code\u003E requests continuation of the current authentication state.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.RefreshAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe method returns \u003Ccode\u003ERefreshResult\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed record RefreshResult\n{\n public bool IsSuccess { get; init; }\n public int Status { get; init; }\n public RefreshOutcome Outcome { get; init; }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERefresh behavior depends on the authentication mode.\u003C/p\u003E\n\u003Cp\u003EA refresh operation may update session activity, rotate authentication material, or determine that reauthentication is required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-refresh-results\u0022\u003EHandling Refresh Results\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.RefreshAsync();\n\nif (result.IsSuccess)\n{\n // Authentication continuation succeeded.\n}\nelse if (result.Outcome == RefreshOutcome.ReauthRequired)\n{\n // The current authentication can no longer continue.\n // Direct the user to the appropriate login flow.\n}\nelse\n{\n // Handle another unsuccessful refresh result.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA \u003Ccode\u003E401 Unauthorized\u003C/code\u003E refresh response is handled as a normal reauthentication outcome.\u003C/p\u003E\n\u003Cp\u003EIt returns:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Enew RefreshResult\n{\n IsSuccess = false,\n Status = 401,\n Outcome = RefreshOutcome.ReauthRequired\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENetwork and unexpected protocol failures can still produce exceptions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-outcomes\u0022\u003ERefresh Outcomes\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshOutcome\u003C/code\u003E defines the following values:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOutcome\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENone\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENo specific semantic outcome\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESuccess\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EGeneric successful refresh\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENoOp\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENo refresh state change was necessary\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETouched\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApplicable session activity was updated\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERotated\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERotation occurred\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauthRequired\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication continuation is no longer permitted\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.RefreshAsync();\n\nif (!result.IsSuccess)\n{\n return;\n}\n\nswitch (result.Outcome)\n{\n case RefreshOutcome.Rotated:\n // Authentication material was rotated.\n break;\n\n case RefreshOutcome.Touched:\n // Applicable session activity was updated.\n break;\n\n case RefreshOutcome.NoOp:\n // Successful refresh and no state change was required.\n break;\n\n case RefreshOutcome.Success:\n // Refresh succeeded without a more specific outcome.\n break;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022detailed-refresh-diagnostics\u0022\u003EDetailed Refresh Diagnostics\u003C/h3\u003E\n\u003Cp\u003EThe server may return a generic success outcome rather than exposing the internal refresh action.\u003C/p\u003E\n\u003Cp\u003EWhere supported, detailed refresh outcomes can be enabled through server diagnostics:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Diagnostics.EnableRefreshDetails = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis setting is intended for diagnostics and observability.\u003C/p\u003E\n\u003Cp\u003EApplications should not require a specific successful outcome such as \u003Ccode\u003ERotated\u003C/code\u003E or \u003Ccode\u003ETouched\u003C/code\u003E to consider refresh successful.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EIsSuccess\u003C/code\u003E for the primary success decision.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022manual-and-automatic-refresh\u0022\u003EManual and Automatic Refresh\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshAsync\u003C/code\u003E has an optional \u003Ccode\u003EisAuto\u003C/code\u003E argument.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E// Manual refresh\nawait UAuthClient.Flows.RefreshAsync();\n\n// Refresh initiated by automatic coordination\nawait UAuthClient.Flows.RefreshAsync(isAuto: true);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe parameter distinguishes automatic refresh activity for client diagnostics.\u003C/p\u003E\n\u003Cp\u003EIt does not select a different authentication mode or override the server\u0027s refresh policy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-configuration\u0022\u003E10. Automatic Refresh Configuration\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth exposes client-side automatic refresh options through \u003Ccode\u003EAutoRefresh\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoRefresh.Enabled = true;\noptions.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EEnabled\u003C/code\u003E controls background refresh coordination.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EInterval\u003C/code\u003E specifies the interval used for background refresh attempts.\u003C/p\u003E\n\u003Cp\u003EThe effective defaults and registration behavior depend on the client integration. The options documentation identifies Blazor Server as the environment where background refresh is enabled by default.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-is-not-a-security-guarantee\u0022\u003EAutomatic Refresh Is Not a Security Guarantee\u003C/h3\u003E\n\u003Cp\u003EAutomatic refresh is a client-side convenience mechanism.\u003C/p\u003E\n\u003Cp\u003EIt does not guarantee that a session will remain valid indefinitely.\u003C/p\u003E\n\u003Cp\u003EAuthentication may still end because of:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EExpiration.\u003C/li\u003E\n\u003Cli\u003ERevocation.\u003C/li\u003E\n\u003Cli\u003EAccount security changes.\u003C/li\u003E\n\u003Cli\u003EInvalid refresh credentials.\u003C/li\u003E\n\u003Cli\u003EServer-side continuation restrictions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe client must remain prepared to handle \u003Ccode\u003EReauthRequired\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022validate-current-authentication\u0022\u003E11. Validate Current Authentication\u003C/h2\u003E\n\u003Cp\u003EUse \u003Ccode\u003EValidateAsync\u003C/code\u003E to ask the server to validate the current authentication state.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.ValidateAsync();\n\nif (result.IsValid)\n{\n // Current authentication is valid.\n}\nelse\n{\n // Authentication is not currently valid.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe method returns \u003Ccode\u003EAuthValidationResult\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIts properties include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EState\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECurrent session state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIsValid\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EWhether the state is \u003Ccode\u003EActive\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESnapshot\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional authentication state snapshot\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EChainId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional associated session chain\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERootId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional session root\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBoundDeviceId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional bound device identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-session-context\u0022\u003EInspect Session Context\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.ValidateAsync();\n\nif (result.IsValid \u0026amp;\u0026amp; result.ChainId is { } chainId)\n{\n // Use chainId for supported session-management operations.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENot every authentication mode necessarily provides all session hierarchy fields.\u003C/p\u003E\n\u003Cp\u003ETreat optional values as optional.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validateasync-versus-ui-authentication-state\u0022\u003EValidateAsync Versus UI Authentication State\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EValidateAsync\u003C/code\u003E performs an explicit server validation operation.\u003C/p\u003E\n\u003Cp\u003EIt should not be called on every UI render merely to determine whether a component should display authenticated content.\u003C/p\u003E\n\u003Cp\u003EFor UI authentication state, use the supported UltimateAuth state management integration, including \u003Ccode\u003EIUAuthStateManager\u003C/code\u003E where appropriate.\u003C/p\u003E\n\u003Cp\u003EExplicit validation is useful when an application needs to check current server-recognized authentication state.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout\u0022\u003E12. Logout\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ELogoutAsync\u003C/code\u003E performs the current logout flow.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.LogoutAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe method uses the configured logout endpoint and navigation transport.\u003C/p\u003E\n\u003Cp\u003EDepending on the application profile and configuration, logout may involve navigation and authentication state changes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-button\u0022\u003ELogout Button\u003C/h3\u003E\n\u003Cp\u003EA simple Blazor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\n\u0026lt;button @onclick=\u0026quot;LogoutAsync\u0026quot;\u0026gt;Logout\u0026lt;/button\u0026gt;\n\n@code {\n private async Task LogoutAsync()\n {\n await UAuthClient.Flows.LogoutAsync();\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ELogout is distinct from clearing local UI state.\u003C/p\u003E\n\u003Cp\u003ERemoving a local authentication indicator does not necessarily revoke authoritative server-managed authentication state.\u003C/p\u003E\n\u003Cp\u003EUse the supported logout flow to terminate authentication.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-a-specific-device\u0022\u003E13. Logout a Specific Device\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports revoking the session chain associated with a particular device context.\u003C/p\u003E\n\u003Cp\u003EThe relevant method is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ELogoutMyDeviceAsync(LogoutDeviceRequest request)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ELogoutDeviceRequest\u003C/code\u003E requires a \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new LogoutDeviceRequest\n{\n ChainId = chainId\n};\n\nvar result = await UAuthClient.Flows.LogoutMyDeviceAsync(request);\n\nif (result.IsSuccess)\n{\n // The requested device logout operation succeeded.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis operation targets a session chain, not an arbitrary individual session ID.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022current-device-behavior\u0022\u003ECurrent Device Behavior\u003C/h3\u003E\n\u003Cp\u003EThe returned \u003Ccode\u003ERevokeResult\u003C/code\u003E can indicate whether the affected chain is the current chain.\u003C/p\u003E\n\u003Cp\u003EWhen the operation succeeds and \u003Ccode\u003ECurrentChain\u003C/code\u003E is true, the client publishes a logout-related state event.\u003C/p\u003E\n\u003Cp\u003EThis allows the application to react when the currently authenticated device context has been revoked.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-other-devices\u0022\u003E14. Logout Other Devices\u003C/h2\u003E\n\u003Cp\u003EUse \u003Ccode\u003ELogoutMyOtherDevicesAsync\u003C/code\u003E to revoke other device-associated sessions while retaining the current one.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutMyOtherDevicesAsync();\n\nif (result.IsSuccess)\n{\n // Other devices were logged out.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is useful for account security pages that provide a \u003Cstrong\u003ELog out other devices\u003C/strong\u003E action.\u003C/p\u003E\n\u003Cp\u003EThe current authentication context is intended to remain active.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for identifying the current session or chain and enforcing the appropriate revocation scope.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-all-devices\u0022\u003E15. Logout All Devices\u003C/h2\u003E\n\u003Cp\u003EUse \u003Ccode\u003ELogoutAllMyDevicesAsync\u003C/code\u003E to revoke all applicable sessions for the current user.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutAllMyDevicesAsync();\n\nif (result.IsSuccess)\n{\n // All applicable device sessions were revoked.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EOn success, the client publishes a logout-related state event.\u003C/p\u003E\n\u003Cp\u003EThis operation is useful when a user suspects account compromise or wants to terminate existing authentication sessions across devices.\u003C/p\u003E\n\u003Cp\u003EIn JWT-based modes, previously issued access tokens may remain cryptographically valid until expiration unless additional revocation enforcement is configured.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022administrative-device-logout\u0022\u003E16. Administrative Device Logout\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth also exposes administrative session revocation operations.\u003C/p\u003E\n\u003Cp\u003EThese methods act on a specified user and require appropriate server-side authorization.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-one-user-device\u0022\u003ELogout One User Device\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutUserDeviceAsync(\n userKey,\n new LogoutDeviceRequest\n {\n ChainId = chainId\n });\n\nif (!result.IsSuccess)\n{\n // Handle the failure.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-other-devices-for-a-user\u0022\u003ELogout Other Devices for a User\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutUserOtherDevicesAsync(userKey, request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EHere, \u003Ccode\u003Erequest\u003C/code\u003E is a \u003Ccode\u003ELogoutOtherDevicesRequest\u003C/code\u003E identifying the chain to retain.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-all-devices-for-a-user\u0022\u003ELogout All Devices for a User\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutAllUserDevicesAsync(userKey);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAdministrative methods do not grant administrative privileges by themselves.\u003C/p\u003E\n\u003Cp\u003EThe server must authorize the actor and validate the target user and requested revocation scope.\u003C/p\u003E\n\u003Cp\u003EThese operations are particularly relevant to administration panels and account security workflows.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022building-login-forms-with-uauthloginform\u0022\u003E17. Building Login Forms with UAuthLoginForm\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E, a reusable Blazor component that handles authentication form submission without requiring developers to implement the underlying flow orchestration themselves.\u003C/p\u003E\n\u003Cp\u003EThe component supports password-based login, PKCE completion through UAuthHub, configurable submission modes, structured validation feedback, and customizable UI content.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EYou design the login interface. UltimateAuth handles the authentication submission workflow.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022basic-usage\u0022\u003EBasic Usage\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E provides a complete, ready-to-use login form out of the box. No additional markup or credential bindings are required.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThat\u0027s it. UltimateAuth automatically renders the identifier field, password field, and submit button, and handles the authentication submission workflow.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECustomizing the Form\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhen you need a custom layout or styling, simply provide your own form content:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client.Blazor\n\n\u0026lt;UAuthLoginForm\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; placeholder=\u0026quot;Email\u0026quot; autocomplete=\u0026quot;username\u0026quot; /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot; placeholder=\u0026quot;Password\u0026quot; autocomplete=\u0026quot;current-password\u0026quot; /\u0026gt;\n \u0026lt;button type=\u0026quot;submit\u0026quot;\u0026gt;Sign in\u0026lt;/button\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUltimateAuth handles the authentication workflow in both cases. Your custom fields only need the correct HTML \u003Ccode\u003Ename\u003C/code\u003E attributes; there is no need to bind credentials to Blazor component state.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-credential-submission\u0022\u003ENative Credential Submission\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E reads credentials directly from native browser form fields. It does not accept \u003Ccode\u003EIdentifier\u003C/code\u003E or \u003Ccode\u003ESecret\u003C/code\u003E component parameters.\u003C/p\u003E\n\u003Cp\u003EWhen providing custom \u003Ccode\u003EChildContent\u003C/code\u003E, the form must contain enabled input elements with the exact names \u003Ccode\u003EIdentifier\u003C/code\u003E and \u003Ccode\u003ESecret\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003ECredential values should not be bound to Blazor component state solely for submission. This is particularly important in Blazor Server, where interactive component bindings can transmit credential values over the SignalR connection.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant: Do Not Disable Credential Fields During Submission\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EHTML inputs marked as \u003Ccode\u003Edisabled\u003C/code\u003E are excluded from \u003Ccode\u003EFormData\u003C/code\u003E and native form submissions.\u003C/p\u003E\n\u003Cp\u003EDo not set \u003Ccode\u003EDisabled=\u0026quot;@isSubmitting\u0026quot;\u003C/code\u003E on the username or password fields. A login preview may succeed, but the subsequent native commit can fail because the credential fields are missing from the submitted form.\u003C/p\u003E\n\u003Cp\u003EInstead, disable the submit button while leaving the credential inputs enabled.\u003C/p\u003E\n\u003Cp\u003EIf you need to prevent editing during submission, consider \u003Ccode\u003Ereadonly\u003C/code\u003E where supported, while accounting for component behavior, browser autofill, and accessibility.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECustom Form Requirements\u003C/strong\u003E\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EUse \u003Ccode\u003Ename=\u0026quot;Identifier\u0026quot;\u003C/code\u003E and \u003Ccode\u003Ename=\u0026quot;Secret\u0026quot;\u003C/code\u003E exactly.\u003C/li\u003E\n\u003Cli\u003EKeep both credential inputs enabled throughout submission.\u003C/li\u003E\n\u003Cli\u003EAvoid duplicate inputs with these names.\u003C/li\u003E\n\u003Cli\u003EUse \u003Ccode\u003Etype=\u0026quot;password\u0026quot;\u003C/code\u003E and \u003Ccode\u003Eautocomplete=\u0026quot;current-password\u0026quot;\u003C/code\u003E for password fields.\u003C/li\u003E\n\u003Cli\u003EKeep custom submit controls inside \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EUse \u003Ccode\u003EOnSubmittingChanged\u003C/code\u003E to manage loading indicators and submit-button state.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E handles the try and commit orchestration. The native commit includes the browser form fields, device information, and antiforgery data required by the configured authentication flow.\u003C/p\u003E\n\u003Cp\u003EThe component automatically uses \u003Ccode\u003ETryAndCommit\u003C/code\u003E as its default submission mode.\u003C/p\u003E\n\u003Cp\u003EWhen submitted, it:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates that the identifier and secret are present.\u003C/li\u003E\n\u003Cli\u003ECreates the appropriate authentication request.\u003C/li\u003E\n\u003Cli\u003ECalls the UltimateAuth client flow.\u003C/li\u003E\n\u003Cli\u003EPerforms the configured try/commit behavior.\u003C/li\u003E\n\u003Cli\u003EExposes structured results through \u003Ccode\u003EOnTryResult\u003C/code\u003E.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe example assumes that UltimateAuth\u0027s Blazor services have already been registered and that the hosting environment permits the selected login flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022customizing-the-login-ui\u0022\u003ECustomizing the Login UI\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E uses \u003Ccode\u003EChildContent\u003C/code\u003E, allowing developers to use standard HTML elements or their preferred Blazor component library.\u003C/p\u003E\n\u003Cp\u003EFor example, with MudBlazor:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client.Blazor\n@using CodeBeam.UltimateAuth.Client\n\n\u0026lt;UAuthLoginForm SubmitMode=\u0026quot;UAuthSubmitMode.TryAndCommit\u0026quot; OnTryResult=\u0026quot;HandleLoginResult\u0026quot; OnSubmittingChanged=\u0026quot;HandleSubmittingChanged\u0026quot;\u0026gt;\n \u0026lt;MudStack Spacing=\u0026quot;3\u0026quot;\u0026gt;\n \u0026lt;MudText Typo=\u0026quot;Typo.h5\u0026quot;\u0026gt;Sign in\u0026lt;/MudText\u0026gt;\n \u0026lt;MudTextField name=\u0026quot;Identifier\u0026quot; Label=\u0026quot;Email\u0026quot; Variant=\u0026quot;Variant.Outlined\u0026quot; /\u0026gt;\n \u0026lt;MudTextField name=\u0026quot;Secret\u0026quot; Label=\u0026quot;Password\u0026quot; InputType=\u0026quot;InputType.Password\u0026quot; Variant=\u0026quot;Variant.Outlined\u0026quot; /\u0026gt;\n\n \u0026lt;MudButton ButtonType=\u0026quot;ButtonType.Submit\u0026quot; Disabled=\u0026quot;@_isSubmitting\u0026quot; Variant=\u0026quot;Variant.Filled\u0026quot; Color=\u0026quot;Color.Primary\u0026quot; FullWidth\u0026gt;Sign in\u0026lt;/MudButton\u0026gt;\n\n @if (!string.IsNullOrWhiteSpace(error))\n {\n \u0026lt;MudAlert Severity=\u0026quot;Severity.Error\u0026quot;\u0026gt;@error\u0026lt;/MudAlert\u0026gt;\n }\n \u0026lt;/MudStack\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\n@code {\n private bool _isSubmitting;\n private string? error;\n\n private Task HandleSubmittingChanged(bool submitting)\n {\n _isSubmitting = submitting;\n return Task.CompletedTask;\n }\n\n private Task HandleLoginResult(IUAuthTryResult result)\n {\n error = result.IsSuccess ? null : \u0026quot;Unable to sign in.\u0026quot;;\n return Task.CompletedTask;\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe form controls remain under your control.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth does not require a particular visual design, CSS framework, or component library.\u003C/p\u003E\n\u003Cp\u003EBecause the component renders an HTML form internally, place the submit button inside its child content and avoid nesting another HTML form within it.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022submission-modes\u0022\u003ESubmission Modes\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003ESubmitMode\u003C/code\u003E to control how the authentication attempt is executed.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm SubmitMode=\u0026quot;UAuthSubmitMode.TryAndCommit\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryOnly\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidates the authentication attempt without committing login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAttempts authentication and commits on success\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmits directly to the commit flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E is the default.\u003C/p\u003E\n\u003Cp\u003EFor interactive login forms that need validation feedback, it is generally the recommended choice.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E does not invoke \u003Ccode\u003EOnTryResult\u003C/code\u003E, because it does not perform the structured try operation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-authentication-results\u0022\u003EHandling Authentication Results\u003C/h3\u003E\n\u003Cp\u003EThe component exposes an \u003Ccode\u003EOnTryResult\u003C/code\u003E callback:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm OnTryResult=\u0026quot;HandleResult\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe callback receives \u003Ccode\u003EIUAuthTryResult\u003C/code\u003E, allowing the same component to report password login and PKCE completion results.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eprivate Task HandleResult(IUAuthTryResult result)\n{\n if (!result.IsSuccess)\n {\n errorMessage = \u0026quot;Authentication failed.\u0026quot;;\n }\n\n return Task.CompletedTask;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor flow-specific details, inspect the concrete result type:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eprivate Task HandleResult(IUAuthTryResult result)\n{\n if (result is TryLoginResult loginResult)\n {\n if (loginResult.LockoutUntilUtc is not null)\n {\n errorMessage = \u0026quot;Your account is temporarily locked.\u0026quot;;\n }\n else if (loginResult.RequiresMfa)\n {\n // Continue the supported additional authentication workflow.\n }\n else if (!loginResult.IsSuccess)\n {\n errorMessage = \u0026quot;Unable to sign in.\u0026quot;;\n }\n }\n else if (result is TryPkceLoginResult pkceResult)\n {\n if (pkceResult.RetryWithNewPkce)\n {\n errorMessage = \u0026quot;Please restart the authentication flow.\u0026quot;;\n }\n else if (!pkceResult.IsSuccess)\n {\n errorMessage = \u0026quot;Unable to complete authentication.\u0026quot;;\n }\n }\n\n return Task.CompletedTask;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe callback reports the structured try result. It does not replace authentication state management or server-side validation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-uauthloginform-with-pkce\u0022\u003EUsing UAuthLoginForm with PKCE\u003C/h3\u003E\n\u003Cp\u003EThe same component also supports PKCE login completion when hosted within a supported UAuthHub environment.\u003C/p\u003E\n\u003Cp\u003ESet \u003Ccode\u003ELoginType\u003C/code\u003E to \u003Ccode\u003EPkce\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm LoginType=\u0026quot;UAuthLoginType.Pkce\u0026quot; SubmitMode=\u0026quot;UAuthSubmitMode.TryAndCommit\u0026quot; OnTryResult=\u0026quot;HandleLoginResult\u0026quot;\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; placeholder=\u0026quot;Email\u0026quot; /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot; placeholder=\u0026quot;Password\u0026quot; /\u0026gt;\n \u0026lt;button type=\u0026quot;submit\u0026quot;\u0026gt;Continue\u0026lt;/button\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn PKCE mode, the component:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EResolves the relevant UAuthHub session context.\u003C/li\u003E\n\u003Cli\u003ERetrieves the authorization code and code verifier through the configured Hub services.\u003C/li\u003E\n\u003Cli\u003EBuilds a \u003Ccode\u003EPkceCompleteRequest\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EInvokes the corresponding PKCE completion flow.\u003C/li\u003E\n\u003Cli\u003EReports the structured result when a try-enabled submission mode is used.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe application does not need to manually construct the PKCE completion request for this form.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E PKCE mode requires a supported server-side UAuthHub environment. \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E checks the available Hub capabilities and throws when PKCE login is requested in an unsupported application profile.\u003C/p\u003E\n\u003Cp\u003EA Blazor WebAssembly application should initiate PKCE using \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E; the Hub-hosted login form handles the completion stage.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022return-url-handling\u0022\u003EReturn URL Handling\u003C/h3\u003E\n\u003Cp\u003EYou can provide an explicit return URL:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm ReturnUrl=\u0026quot;/dashboard\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe component resolves the effective return URL using the following precedence:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EExplicit \u003Ccode\u003EReturnUrl\u003C/code\u003E parameter.\u003C/li\u003E\n\u003Cli\u003EUAuthHub flow return URL when using PKCE.\u003C/li\u003E\n\u003Cli\u003ECurrent navigation URL.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThis allows a shared login component to participate in different authentication journeys without hardcoding navigation logic into the form.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-login-endpoints\u0022\u003ECustom Login Endpoints\u003C/h3\u003E\n\u003Cp\u003EFor advanced integrations, the \u003Ccode\u003EEndpoint\u003C/code\u003E parameter allows the form\u0027s HTML action endpoint to be overridden:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm Endpoint=\u0026quot;/custom-login\u0026quot; SubmitMode=\u0026quot;UAuthSubmitMode.DirectCommit\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe endpoint is resolved relative to the configured UltimateAuth endpoint base path and multi-tenant settings.\u003C/p\u003E\n\u003Cp\u003ENote that \u003Ccode\u003EEndpoint\u003C/code\u003E affects the form\u0027s HTML action. Try-based submissions invoke the configured \u003Ccode\u003EUAuthClient.Flows\u003C/code\u003E endpoints, so changing \u003Ccode\u003EEndpoint\u003C/code\u003E alone does not redirect those SDK requests to a custom endpoint.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022submit-the-form-programmatically\u0022\u003ESubmit the Form Programmatically\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E exposes \u003Ccode\u003ESubmitAsync\u003C/code\u003E, allowing submission through a component reference.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm @ref=\u0026quot;loginForm\u0026quot; AllowEnterKeyToSubmit=\u0026quot;false\u0026quot;\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; placeholder=\u0026quot;Email\u0026quot; /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot; /\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\n\u0026lt;button type=\u0026quot;button\u0026quot; @onclick=\u0026quot;SubmitLoginAsync\u0026quot;\u0026gt;\n Sign in\n\u0026lt;/button\u0026gt;\n\n@code {\n private UAuthLoginForm? loginForm;\n\n private async Task SubmitLoginAsync()\n {\n if (loginForm is not null)\n {\n await loginForm.SubmitAsync();\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ESubmitAsync\u003C/code\u003E must be called after the component has rendered.\u003C/p\u003E\n\u003Cp\u003EThis is useful when submission is initiated from a custom button, dialog, or application-specific interaction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022controlling-enter-key-submission\u0022\u003EControlling Enter-Key Submission\u003C/h3\u003E\n\u003Cp\u003EBy default, the component supports Enter-key submission.\u003C/p\u003E\n\u003Cp\u003EYou can disable its built-in hidden submit button:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm AllowEnterKeyToSubmit=\u0026quot;false\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis option controls the component\u0027s built-in Enter-key submit mechanism. Other submit buttons inside the form may still trigger normal browser form submission behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022reloading-pkce-context\u0022\u003EReloading PKCE Context\u003C/h3\u003E\n\u003Cp\u003EThe component exposes \u003Ccode\u003EReloadAsync\u003C/code\u003E to reload its Hub credentials and flow state.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm @ref=\u0026quot;loginForm\u0026quot; LoginType=\u0026quot;UAuthLoginType.Pkce\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\n@code {\n private UAuthLoginForm? loginForm;\n\n private async Task ReloadLoginContextAsync()\n {\n if (loginForm is not null)\n {\n await loginForm.ReloadAsync();\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an advanced capability intended for scenarios where the associated Hub state changes and the component must refresh its internal context.\u003C/p\u003E\n\u003Cp\u003EIt does not initiate a new PKCE authorization flow by itself.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022component-parameters\u0022\u003EComponent Parameters\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EParameter\u003C/th\u003E\n\u003Cth\u003EType\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthLoginType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPassword\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPassword or PKCE login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESubmitMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthSubmitMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmission strategy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Estring?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERedirect destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoint\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Estring?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECustom HTML form endpoint\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubSessionId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubSessionId?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExplicit Hub session context\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowEnterKeyToSubmit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ebool\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBuilt-in Enter-key submit support\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnTryResult\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EEventCallback\u0026lt;IUAuthTryResult\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u2014\u003C/td\u003E\n\u003Ctd\u003EStructured try result callback\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnSubmittingChanged\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EEventCallback\u0026lt;bool\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u2014\u003C/td\u003E\n\u003Ctd\u003ESubmission state change callback\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EChildContent\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERenderFragment?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u2014\u003C/td\u003E\n\u003Ctd\u003ECustom form content\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022when-to-use-uauthloginform\u0022\u003EWhen to Use UAuthLoginForm\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E when building a Blazor login interface that should integrate directly with UltimateAuth\u0027s supported authentication flows.\u003C/p\u003E\n\u003Cp\u003EIt is particularly useful when:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EYou want to use your own component library without implementing the authentication submission logic.\u003C/li\u003E\n\u003Cli\u003EYou need structured login validation feedback.\u003C/li\u003E\n\u003Cli\u003EYou want to switch between try-only and commit behavior.\u003C/li\u003E\n\u003Cli\u003EYou are building a UAuthHub login page that completes PKCE.\u003C/li\u003E\n\u003Cli\u003EYou want to share login UI across supported Blazor hosting environments.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor application-specific workflows that cannot be expressed through the component, use \u003Ccode\u003EUAuthClient.Flows\u003C/code\u003E directly.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe component handles the login workflow, while your application retains control over presentation, user experience, and surrounding application logic.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-integration-mistakes\u0022\u003E18. Common Integration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022calling-direct-login-from-a-public-client\u0022\u003ECalling Direct Login from a Public Client\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E \u003Ccode\u003ELoginAsync\u003C/code\u003E throws because direct credential posting is disabled.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Use \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E and the supported PKCE completion flow. Do not enable \u003Ccode\u003EAllowCredentialPost\u003C/code\u003E to bypass the public-client restriction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-tryonly-as-authentication\u0022\u003ETreating TryOnly as Authentication\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E The application receives \u003Ccode\u003EIsSuccess = true\u003C/code\u003E from \u003Ccode\u003ETryOnly\u003C/code\u003E and assumes the user is logged in.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E A successful try result does not commit authentication. Use \u003Ccode\u003ETryAndCommit\u003C/code\u003E or the appropriate commit flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-directcommit-skips-server-validation\u0022\u003EAssuming DirectCommit Skips Server Validation\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E DirectCommit is interpreted as a faster but less secure authentication mode.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E DirectCommit skips the separate client try stage. The server still validates the actual authentication request.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-every-refresh-rotates-tokens\u0022\u003EAssuming Every Refresh Rotates Tokens\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E The application requires \u003Ccode\u003ERefreshOutcome.Rotated\u003C/code\u003E for refresh success.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Check \u003Ccode\u003ERefreshResult.IsSuccess\u003C/code\u003E. Rotation, touch, and no-op behavior depend on the authentication mode and refresh strategy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-a-session-id-for-device-logout\u0022\u003EUsing a Session ID for Device Logout\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E A session identifier is passed to a device logout operation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E \u003Ccode\u003ELogoutMyDeviceAsync\u003C/code\u003E requires \u003Ccode\u003ELogoutDeviceRequest\u003C/code\u003E with a \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-logout-immediately-invalidates-all-jwts\u0022\u003EAssuming Logout Immediately Invalidates All JWTs\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E An application expects every issued JWT access token to become unusable immediately after server-side logout.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Understand the enforcement behavior of SemiHybrid and PureJwt. Local JWT validation may continue accepting previously issued tokens until expiration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-validateasync-on-every-render\u0022\u003EUsing ValidateAsync on Every Render\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E Components repeatedly make validation requests just to display authenticated UI.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Use the appropriate authentication state integration for UI rendering, and reserve explicit validation for operations that require it.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client-sdk/session-management\u0022\u003ESession Management\u003C/a\u003E \u2014 Inspect and manage session and device information.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/security/token-security\u0022\u003EToken Security\u003C/a\u003E \u2014 Understand token validity, refresh behavior, and revocation.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/security/refresh-rotation\u0022\u003ERefresh Rotation \u0026amp; Replay Protection\u003C/a\u003E \u2014 Explore refresh concurrency and reuse security.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E \u2014 Compare authentication behavior across modes.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/sessions-devices/device-management\u0022\u003EDevice Management\u003C/a\u003E \u2014 Understand device-associated session chains.\u003C/li\u003E\n\u003C/ul\u003E\n", + "Html": "\n\u003Cp\u003EThe UltimateAuth Client SDK provides a high-level API for authentication workflows, including login, PKCE, session validation, refresh, logout, and device-specific session revocation.\u003C/p\u003E\n\u003Cp\u003EThese operations are exposed through \u003Ccode\u003EUAuthClient.Flows\u003C/code\u003E, which implements the \u003Ccode\u003EIFlowClient\u003C/code\u003E contract.\u003C/p\u003E\n\u003Cp\u003EThis guide shows how to use the authentication client in application code, handle structured results, configure interactive behavior, and choose the correct flow for different client environments.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022accessing-the-authentication-client\u0022\u003E1. Accessing the Authentication Client\u003C/h2\u003E\n\u003Cp\u003EIn a Blazor component, inject \u003Ccode\u003EIUAuthClient\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAuthentication operations are available through the \u003Ccode\u003EFlows\u003C/code\u003E property.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.RefreshAsync();\nawait UAuthClient.Flows.ValidateAsync();\nawait UAuthClient.Flows.LogoutAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe relevant methods are defined by \u003Ccode\u003EIFlowClient\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMethod\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmit a direct login flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryLoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAttempt login with configurable try/commit behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBeginPkceAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EStart a PKCE authentication flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECompletePkceLoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EComplete a PKCE login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryCompletePkceLoginAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EComplete PKCE with structured try/commit behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh or continue authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValidateAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidate current authentication state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELog out the current session\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutMyDeviceAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke a selected device-associated chain\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutMyOtherDevicesAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke other devices while retaining the current one\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogoutAllMyDevicesAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke all devices for the current user\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EAdministrative device logout operations are also available and covered later in this guide.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-the-correct-login-flow\u0022\u003E2. Choosing the Correct Login Flow\u003C/h2\u003E\n\u003Cp\u003EBefore implementing login, determine whether your application is a trusted server-hosted client or a public client.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EClient environment\u003C/th\u003E\n\u003Cth\u003ERecommended flow\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003EDirect login or supported interactive login flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUAuthHub\u003C/td\u003E\n\u003Ctd\u003EServer-hosted authentication flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WebAssembly\u003C/td\u003E\n\u003Ctd\u003EPKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBrowser SPA\u003C/td\u003E\n\u003Ctd\u003EPKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPublic native application\u003C/td\u003E\n\u003Ctd\u003EPKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EPublic clients must not rely on embedding a secret or trusting browser-executed code to protect credentials.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth restricts direct credential posting based on the configured application profile and login options.\u003C/p\u003E\n\u003Cp\u003EFor public clients, use the PKCE flow instead of enabling direct credential posting.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-login\u0022\u003E3. Direct Login\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ELoginAsync\u003C/code\u003E performs a direct login submission.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new LoginRequest\n{\n Identifier = \u0026quot;user@example.com\u0026quot;,\n Secret = \u0026quot;password\u0026quot;\n};\n\nawait UAuthClient.Flows.LoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ELoginAsync\u003C/code\u003E returns a structured login result describing the outcome of the submission.\u003C/p\u003E\n\u003Cp\u003EThe client discovers the effective login transport supported by the server.\u003C/p\u003E\n\u003Cp\u003EDepending on the authentication mode, credential delivery configuration, and return URL, login may use browser navigation or a fetch-based request.\u003C/p\u003E\n\u003Cp\u003EA navigation submission does not itself confirm successful server-side authentication. A fetch-based submission allows the client to observe the server response and process delivered credentials.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-transport-selection\u0022\u003ELogin Transport Selection\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth supports three login transport strategies:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ETransport\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatically selects a compatible transport\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENavigation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmits the login through browser navigation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EFetch\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmits the login through an HTTP request and processes the response\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAuto\u003C/code\u003E is the default and recommended strategy.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LoginAsync(\n request,\n returnUrl: \u0026quot;/dashboard\u0026quot;,\n transport: UAuthLoginTransport.Auto);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENavigation is suitable when the effective credential delivery configuration supports browser-managed authentication credentials.\u003C/p\u003E\n\u003Cp\u003EFetch is required when the client must observe a header-delivered access token.\u003C/p\u003E\n\u003Cp\u003EApplications can explicitly request fetch-based login:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LoginAsync(\n request,\n transport: UAuthLoginTransport.Fetch);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn explicitly requested transport must be compatible with the effective server configuration.\u003C/p\u003E\n\u003Cp\u003EThe client does not silently downgrade an incompatible explicit navigation request.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022processing-header-delivered-access-tokens\u0022\u003EProcessing Header-Delivered Access Tokens\u003C/h3\u003E\n\u003Cp\u003EWhen login delivers an access token through a response header, UltimateAuth processes the token and stores it in the client-side token store.\u003C/p\u003E\n\u003Cp\u003EThe default token store is in-memory.\u003C/p\u003E\n\u003Cp\u003EApplications using the UltimateAuth client do not need to manually extract JWTs from login responses or construct authorization headers.\u003C/p\u003E\n\u003Cp\u003EThe client attaches the access token to supported authenticated requests and clears expired credentials from the token store.\u003C/p\u003E\n\u003Cp\u003EIn-memory storage does not persist access tokens across a full application reload.\u003C/p\u003E\n\u003Cp\u003EAuthentication continuation after a reload depends on the available refresh credential and the effective server configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022loginrequest-properties\u0022\u003ELoginRequest Properties\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ELoginRequest\u003C/code\u003E supports the following properties:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESecret\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential secret\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential type; defaults to \u003Ccode\u003EPassword\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMetadata\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional request metadata\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERequestTokens\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHint to request tokens when supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreviewReceipt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional receipt associated with a prior login preview\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EExample:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new LoginRequest\n{\n Identifier = email,\n Secret = password,\n CredentialType = CredentialType.Password,\n RequestTokens = true\n};\n\nawait UAuthClient.Flows.LoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ERequestTokens\u003C/code\u003E is a hint, not a guarantee that tokens will be issued. The server\u0027s authentication mode and policy remain authoritative.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022redirect-after-login\u0022\u003ERedirect After Login\u003C/h3\u003E\n\u003Cp\u003EProvide an explicit return URL when necessary:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.LoginAsync(request, returnUrl: \u0026quot;/dashboard\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe direct login flow resolves its return URL in the following order:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EThe explicit \u003Ccode\u003EreturnUrl\u003C/code\u003E argument.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ELogin.ReturnUrl\u003C/code\u003E option.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E option.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor example, client options can specify a default:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe return URL is part of the login workflow. It should not be treated as an authorization grant.\u003C/p\u003E\n\u003Cp\u003EApplications and servers must still enforce their redirect validation rules.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022interactive-login-with-tryloginasync\u0022\u003E4. Interactive Login with TryLoginAsync\u003C/h2\u003E\n\u003Cp\u003EFor interactive forms, \u003Ccode\u003ETryLoginAsync\u003C/code\u003E provides structured feedback before or during the authentication commit process.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.TryAndCommit);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is generally the more useful API for a login form that needs to display validation feedback.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022submit-modes\u0022\u003ESubmit Modes\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthSubmitMode\u003C/code\u003E defines three submission behaviors.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryOnly\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExecute the try operation and return its result without committing authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmit directly to the commit endpoint without a separate try operation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETry first, then commit when the try operation succeeds\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese modes control client workflow, not whether the server validates authentication.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDirectCommit does not bypass credential verification or server security requirements.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022tryonly-validate-without-login\u0022\u003ETryOnly: Validate Without Login\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003ETryOnly\u003C/code\u003E when you want structured feedback without establishing an authenticated session.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.TryOnly);\n\nif (result.IsSuccess)\n{\n // The try operation succeeded.\n // Authentication has not been committed.\n}\nelse\n{\n // Display the appropriate feedback.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis can be useful for a custom interactive workflow.\u003C/p\u003E\n\u003Cp\u003EA successful try result must not be interpreted as an authenticated application session.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022tryandcommit-interactive-login\u0022\u003ETryAndCommit: Interactive Login\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003ETryAndCommit\u003C/code\u003E to combine structured validation with authentication commit.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.TryAndCommit,\n returnUrl: \u0026quot;/dashboard\u0026quot;);\n\nif (!result.IsSuccess)\n{\n // Show validation feedback.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen the try stage succeeds, the client proceeds to the commit operation through its configured transport.\u003C/p\u003E\n\u003Cp\u003EThis can involve navigation, so application code should not assume that execution always continues within the same component instance.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022directcommit-single-commit-submission\u0022\u003EDirectCommit: Single Commit Submission\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.TryLoginAsync(\n new LoginRequest\n {\n Identifier = email,\n Secret = password\n },\n UAuthSubmitMode.DirectCommit);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this mode, the SDK submits the commit operation directly.\u003C/p\u003E\n\u003Cp\u003EThe method returns a \u003Ccode\u003ETryLoginResult\u003C/code\u003E with \u003Ccode\u003EIsSuccess = true\u003C/code\u003E after the navigation submission completes, but this is not a structured server-side authentication success confirmation.\u003C/p\u003E\n\u003Cp\u003EIf you need structured credential validation feedback, prefer \u003Ccode\u003ETryAndCommit\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-login-results\u0022\u003E5. Handling Login Results\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ETryLoginAsync\u003C/code\u003E returns \u003Ccode\u003ETryLoginResult\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIts available properties include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIsSuccess\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EWhether the try operation succeeded\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReason\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional authentication failure reason\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERemainingAttempts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERemaining attempts, when provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELockoutUntilUtc\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELockout expiration, when provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERequiresMfa\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EWhether additional authentication is required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreviewReceipt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional receipt for subsequent flow handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EExample:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryLoginAsync(request, UAuthSubmitMode.TryOnly);\n\nif (!result.IsSuccess)\n{\n if (result.LockoutUntilUtc is not null)\n {\n errorMessage = $\u0026quot;Login temporarily unavailable until {result.LockoutUntilUtc:u}\u0026quot;;\n }\n else\n {\n errorMessage = \u0026quot;Unable to sign in.\u0026quot;;\n }\n\n return;\n}\n\nif (result.RequiresMfa)\n{\n // Continue with the supported additional authentication flow.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not expose sensitive internal authentication details unnecessarily.\u003C/p\u003E\n\u003Cp\u003EFor public-facing login forms, generic failure messages may be preferable to displaying every failure reason.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-transport-and-protocol-errors\u0022\u003EHandling Transport and Protocol Errors\u003C/h3\u003E\n\u003Cp\u003EA structured authentication failure is different from a network or protocol failure.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Etry\n{\n var result = await UAuthClient.Flows.TryLoginAsync(request, UAuthSubmitMode.TryAndCommit);\n\n if (!result.IsSuccess)\n {\n errorMessage = \u0026quot;Unable to sign in.\u0026quot;;\n }\n}\ncatch (UAuthTransportException)\n{\n errorMessage = \u0026quot;Authentication service is unavailable.\u0026quot;;\n}\ncatch (UAuthProtocolException)\n{\n errorMessage = \u0026quot;An authentication protocol error occurred.\u0026quot;;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUse the corresponding UltimateAuth client error namespace when referencing these exception types.\u003C/p\u003E\n\u003Cp\u003EA failed authentication attempt should normally be handled through the structured try result where supported. Transport and protocol exceptions indicate different failure categories.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pkce-authentication\u0022\u003E6. PKCE Authentication\u003C/h2\u003E\n\u003Cp\u003EPKCE provides a proof mechanism for authorization-code-based authentication flows.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports PKCE using an S256 code challenge.\u003C/p\u003E\n\u003Cp\u003EThe SDK generates a cryptographically random verifier, derives its challenge, and coordinates the authorization flow.\u003C/p\u003E\n\u003Cp\u003EPublic clients such as Blazor WebAssembly should use PKCE rather than direct credential posting.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022start-pkce\u0022\u003EStart PKCE\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.BeginPkceAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EYou can provide a return URL:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.BeginPkceAsync(returnUrl: \u0026quot;/dashboard\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client performs the following operations:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EGenerates a PKCE code verifier.\u003C/li\u003E\n\u003Cli\u003EDerives an S256 code challenge.\u003C/li\u003E\n\u003Cli\u003ESends the authorization request.\u003C/li\u003E\n\u003Cli\u003EReceives an authorization code.\u003C/li\u003E\n\u003Cli\u003EInvokes the configured authorization callback, if any.\u003C/li\u003E\n\u003Cli\u003ENavigates to the configured UAuthHub login flow when automatic redirection is enabled.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe authorization code and verifier are used later to complete the flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-pkce\u0022\u003EConfigure PKCE\u003C/h3\u003E\n\u003Cp\u003EThe relevant client options include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.Enabled = true;\noptions.Pkce.AutoRedirect = true;\noptions.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EPKCE is enabled by default in \u003Ccode\u003EUAuthClientPkceLoginFlowOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EAutomatic redirection is also enabled by default.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022observe-authorization\u0022\u003EObserve Authorization\u003C/h3\u003E\n\u003Cp\u003EYou can register a callback that runs after the authorization code is received and before the automatic Hub redirect.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.OnAuthorized = async response =\u0026gt;\n{\n // Observe the authorization response.\n await Task.CompletedTask;\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis callback is useful for application-specific coordination.\u003C/p\u003E\n\u003Cp\u003EDo not log authorization codes or expose them to unrelated components.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-redirection\u0022\u003EDisable Automatic Redirection\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.AutoRedirect = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith this configuration, \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E still performs the authorization request and invokes \u003Ccode\u003EOnAuthorized\u003C/code\u003E, but it does not automatically navigate to the Hub login endpoint.\u003C/p\u003E\n\u003Cp\u003EThe application becomes responsible for coordinating the remaining flow.\u003C/p\u003E\n\u003Cp\u003EThis is an advanced integration option.\u003C/p\u003E\n\u003Cp\u003EA custom implementation must preserve the authorization code, verifier, and relevant context securely and complete the flow using the supported protocol.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-pkce-login\u0022\u003E7. Complete PKCE Login\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ECompletePkceLoginAsync\u003C/code\u003E submits the PKCE completion request.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new PkceCompleteRequest\n{\n AuthorizationCode = authorizationCode,\n CodeVerifier = codeVerifier,\n Identifier = email,\n Secret = password,\n ReturnUrl = \u0026quot;/dashboard\u0026quot;\n};\n\nawait UAuthClient.Flows.CompletePkceLoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe request model includes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthorizationCode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECode obtained from the authorization step\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECodeVerifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOriginal PKCE verifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESecret\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin credential\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional post-login destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubSessionId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional Hub session context\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe authorization code and verifier must correspond to the same PKCE flow.\u003C/p\u003E\n\u003Cp\u003EDo not generate a new verifier when completing an existing authorization.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022interactive-pkce-completion\u0022\u003EInteractive PKCE Completion\u003C/h3\u003E\n\u003Cp\u003EFor structured feedback, use \u003Ccode\u003ETryCompletePkceLoginAsync\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryCompletePkceLoginAsync(\n request,\n UAuthSubmitMode.TryAndCommit);\n\nif (!result.IsSuccess)\n{\n // Display PKCE login feedback.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe same submit modes are supported:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003ETryOnly\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022try-pkce-without-commit\u0022\u003ETry PKCE Without Commit\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.TryCompletePkceLoginAsync(request, UAuthSubmitMode.TryOnly);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis returns a \u003Ccode\u003ETryPkceLoginResult\u003C/code\u003E without committing a successful login.\u003C/p\u003E\n\u003Cp\u003EThe result includes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eresult.IsSuccess;\nresult.Reason;\nresult.RemainingAttempts;\nresult.LockoutUntilUtc;\nresult.RequiresMfa;\nresult.RetryWithNewPkce;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022retrywithnewpkce\u0022\u003ERetryWithNewPkce\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ERetryWithNewPkce\u003C/code\u003E indicates that the client should begin a new PKCE authorization sequence rather than continuing with the existing authorization material.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eif (result.RetryWithNewPkce)\n{\n await UAuthClient.Flows.BeginPkceAsync(\u0026quot;/login\u0026quot;);\n return;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is useful when the current PKCE context can no longer be used.\u003C/p\u003E\n\u003Cp\u003EThe application should not repeatedly resubmit the same invalid authorization code and verifier.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022uauthhub-handoff-and-credential-ownership\u0022\u003EUAuthHub Handoff and Credential Ownership\u003C/h3\u003E\n\u003Cp\u003EA PKCE flow initiated by an application retains the initiating application\u0027s authentication context.\u003C/p\u003E\n\u003Cp\u003EWhen the user completes login through UAuthHub, the resulting credentials belong to the initiating application, not to the Hub\u0027s interactive login interface.\u003C/p\u003E\n\u003Cp\u003EThe Hub completes the authentication flow and returns the user to the validated application return URL.\u003C/p\u003E\n\u003Cp\u003EHeader-delivered access tokens associated with the initiating application must not be installed into the Hub\u0027s local authentication state.\u003C/p\u003E\n\u003Cp\u003EAfter returning to the initiating application, the client can restore authentication through the available session or refresh credentials.\u003C/p\u003E\n\u003Cp\u003EThis behavior preserves the original application and device context throughout the authentication journey.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-recovery\u0022\u003EAuthentication Recovery\u003C/h3\u003E\n\u003Cp\u003EThe client may recover a header-delivered access token when the application starts without a usable token but a compatible refresh credential remains available.\u003C/p\u003E\n\u003Cp\u003EThis allows authentication to continue after a full application reload or a supported UAuthHub handoff.\u003C/p\u003E\n\u003Cp\u003ERecovery does not bypass refresh-token validation, device binding, expiration, rotation, or server-side authentication policies.\u003C/p\u003E\n\u003Cp\u003ERecovery can fail when the refresh credential has expired, has been revoked, or is unavailable because of browser cookie restrictions.\u003C/p\u003E\n\u003Cp\u003ECross-site browser deployments must not assume that refresh cookies will always be available.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-credential-posting-restrictions\u0022\u003E8. Direct Credential Posting Restrictions\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth restricts direct credential posting according to the configured application profile.\u003C/p\u003E\n\u003Cp\u003EThe client option is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.AllowCredentialPost = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is the default.\u003C/p\u003E\n\u003Cp\u003EIf the current profile is not permitted to post credentials directly and the option has not enabled that capability, direct login methods throw an \u003Ccode\u003EInvalidOperationException\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor example, attempting direct login from a public client may produce an error indicating that PKCE is required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022trusted-server-hosted-clients\u0022\u003ETrusted Server-Hosted Clients\u003C/h3\u003E\n\u003Cp\u003EThe option can be explicitly configured for a trusted server-hosted integration where direct credential posting is appropriate:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.AllowCredentialPost = true;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis must not be used to bypass PKCE requirements in a public browser application.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDo not enable direct credential posting in production Blazor WebAssembly or SPA clients.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn application profile is an integration descriptor, not cryptographic proof that the caller is trusted.\u003C/p\u003E\n\u003Cp\u003EServer-side security requirements remain authoritative.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-authentication\u0022\u003E9. Refresh Authentication\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshAsync\u003C/code\u003E requests continuation of the current authentication state.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.RefreshAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe method returns \u003Ccode\u003ERefreshResult\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed record RefreshResult\n{\n public bool IsSuccess { get; init; }\n public int Status { get; init; }\n public RefreshOutcome Outcome { get; init; }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERefresh behavior depends on the authentication mode.\u003C/p\u003E\n\u003Cp\u003EA refresh operation may update session activity, rotate authentication material, or determine that reauthentication is required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-refresh-results\u0022\u003EHandling Refresh Results\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.RefreshAsync();\n\nif (result.IsSuccess)\n{\n // Authentication continuation succeeded.\n}\nelse if (result.Outcome == RefreshOutcome.ReauthRequired)\n{\n // The current authentication can no longer continue.\n // Direct the user to the appropriate login flow.\n}\nelse\n{\n // Handle another unsuccessful refresh result.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA \u003Ccode\u003E401 Unauthorized\u003C/code\u003E refresh response is handled as a normal reauthentication outcome.\u003C/p\u003E\n\u003Cp\u003EIt returns:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Enew RefreshResult\n{\n IsSuccess = false,\n Status = 401,\n Outcome = RefreshOutcome.ReauthRequired\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENetwork and unexpected protocol failures can still produce exceptions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-outcomes\u0022\u003ERefresh Outcomes\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshOutcome\u003C/code\u003E defines the following values:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOutcome\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENone\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENo specific semantic outcome\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESuccess\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EGeneric successful refresh\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENoOp\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENo refresh state change was necessary\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETouched\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApplicable session activity was updated\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERotated\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERotation occurred\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauthRequired\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication continuation is no longer permitted\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.RefreshAsync();\n\nif (!result.IsSuccess)\n{\n return;\n}\n\nswitch (result.Outcome)\n{\n case RefreshOutcome.Rotated:\n // Authentication material was rotated.\n break;\n\n case RefreshOutcome.Touched:\n // Applicable session activity was updated.\n break;\n\n case RefreshOutcome.NoOp:\n // Successful refresh and no state change was required.\n break;\n\n case RefreshOutcome.Success:\n // Refresh succeeded without a more specific outcome.\n break;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022detailed-refresh-diagnostics\u0022\u003EDetailed Refresh Diagnostics\u003C/h3\u003E\n\u003Cp\u003EThe server may return a generic success outcome rather than exposing the internal refresh action.\u003C/p\u003E\n\u003Cp\u003EWhere supported, detailed refresh outcomes can be enabled through server diagnostics:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Diagnostics.EnableRefreshDetails = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis setting is intended for diagnostics and observability.\u003C/p\u003E\n\u003Cp\u003EApplications should not require a specific successful outcome such as \u003Ccode\u003ERotated\u003C/code\u003E or \u003Ccode\u003ETouched\u003C/code\u003E to consider refresh successful.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EIsSuccess\u003C/code\u003E for the primary success decision.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022manual-and-automatic-refresh\u0022\u003EManual and Automatic Refresh\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ERefreshAsync\u003C/code\u003E has an optional \u003Ccode\u003EisAuto\u003C/code\u003E argument.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E// Manual refresh\nawait UAuthClient.Flows.RefreshAsync();\n\n// Refresh initiated by automatic coordination\nawait UAuthClient.Flows.RefreshAsync(isAuto: true);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe parameter distinguishes automatic refresh activity for client diagnostics.\u003C/p\u003E\n\u003Cp\u003EIt does not select a different authentication mode or override the server\u0027s refresh policy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-configuration\u0022\u003E10. Automatic Refresh Configuration\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth exposes client-side automatic refresh options through \u003Ccode\u003EAutoRefresh\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoRefresh.Enabled = true;\noptions.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EEnabled\u003C/code\u003E controls background refresh coordination.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EInterval\u003C/code\u003E specifies the interval used for background refresh attempts.\u003C/p\u003E\n\u003Cp\u003EThe effective defaults and registration behavior depend on the client integration. The options documentation identifies Blazor Server as the environment where background refresh is enabled by default.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-is-not-a-security-guarantee\u0022\u003EAutomatic Refresh Is Not a Security Guarantee\u003C/h3\u003E\n\u003Cp\u003EAutomatic refresh is a client-side convenience mechanism.\u003C/p\u003E\n\u003Cp\u003EIt does not guarantee that a session will remain valid indefinitely.\u003C/p\u003E\n\u003Cp\u003EAuthentication may still end because of:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EExpiration.\u003C/li\u003E\n\u003Cli\u003ERevocation.\u003C/li\u003E\n\u003Cli\u003EAccount security changes.\u003C/li\u003E\n\u003Cli\u003EInvalid refresh credentials.\u003C/li\u003E\n\u003Cli\u003EServer-side continuation restrictions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe client must remain prepared to handle \u003Ccode\u003EReauthRequired\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022validate-current-authentication\u0022\u003E11. Validate Current Authentication\u003C/h2\u003E\n\u003Cp\u003EUse \u003Ccode\u003EValidateAsync\u003C/code\u003E to ask the server to validate the current authentication state.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.ValidateAsync();\n\nif (result.IsValid)\n{\n // Current authentication is valid.\n}\nelse\n{\n // Authentication is not currently valid.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe method returns \u003Ccode\u003EAuthValidationResult\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIts properties include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EState\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECurrent session state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIsValid\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EWhether the state is \u003Ccode\u003EActive\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESnapshot\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional authentication state snapshot\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EChainId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional associated session chain\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERootId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional session root\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBoundDeviceId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional bound device identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-session-context\u0022\u003EInspect Session Context\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.ValidateAsync();\n\nif (result.IsValid \u0026amp;\u0026amp; result.ChainId is { } chainId)\n{\n // Use chainId for supported session-management operations.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENot every authentication mode necessarily provides all session hierarchy fields.\u003C/p\u003E\n\u003Cp\u003ETreat optional values as optional.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validateasync-versus-ui-authentication-state\u0022\u003EValidateAsync Versus UI Authentication State\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EValidateAsync\u003C/code\u003E performs an explicit server validation operation.\u003C/p\u003E\n\u003Cp\u003EIt should not be called on every UI render merely to determine whether a component should display authenticated content.\u003C/p\u003E\n\u003Cp\u003EFor UI authentication state, use the supported UltimateAuth state management integration, including \u003Ccode\u003EIUAuthStateManager\u003C/code\u003E where appropriate.\u003C/p\u003E\n\u003Cp\u003EExplicit validation is useful when an application needs to check current server-recognized authentication state.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout\u0022\u003E12. Logout\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003ELogoutAsync\u003C/code\u003E performs the current logout flow.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.LogoutAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe method submits logout to the configured endpoint and observes the server response before clearing the local access token and publishing the logout event.\u003C/p\u003E\n\u003Cp\u003EAutomatic navigation can be disabled without disabling server-side logout.\u003C/p\u003E\n\u003Cp\u003EA failed logout response does not represent a successfully terminated authentication context.\u003C/p\u003E\n\u003Cp\u003EDepending on the application profile and configuration, logout may involve navigation and authentication state changes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-button\u0022\u003ELogout Button\u003C/h3\u003E\n\u003Cp\u003EA simple Blazor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\n\u0026lt;button @onclick=\u0026quot;LogoutAsync\u0026quot;\u0026gt;Logout\u0026lt;/button\u0026gt;\n\n@code {\n private async Task LogoutAsync()\n {\n await UAuthClient.Flows.LogoutAsync();\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ELogout is distinct from clearing local UI state.\u003C/p\u003E\n\u003Cp\u003ERemoving a local authentication indicator does not necessarily revoke authoritative server-managed authentication state.\u003C/p\u003E\n\u003Cp\u003EUse the supported logout flow to terminate authentication.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-a-specific-device\u0022\u003E13. Logout a Specific Device\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports revoking the session chain associated with a particular device context.\u003C/p\u003E\n\u003Cp\u003EThe relevant method is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ELogoutMyDeviceAsync(LogoutDeviceRequest request)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ELogoutDeviceRequest\u003C/code\u003E requires a \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar request = new LogoutDeviceRequest\n{\n ChainId = chainId\n};\n\nvar result = await UAuthClient.Flows.LogoutMyDeviceAsync(request);\n\nif (result.IsSuccess)\n{\n // The requested device logout operation succeeded.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis operation targets a session chain, not an arbitrary individual session ID.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022current-device-behavior\u0022\u003ECurrent Device Behavior\u003C/h3\u003E\n\u003Cp\u003EThe returned \u003Ccode\u003ERevokeResult\u003C/code\u003E can indicate whether the affected chain is the current chain.\u003C/p\u003E\n\u003Cp\u003EWhen the operation succeeds and \u003Ccode\u003ECurrentChain\u003C/code\u003E is true, the client publishes a logout-related state event.\u003C/p\u003E\n\u003Cp\u003EThis allows the application to react when the currently authenticated device context has been revoked.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-other-devices\u0022\u003E14. Logout Other Devices\u003C/h2\u003E\n\u003Cp\u003EUse \u003Ccode\u003ELogoutMyOtherDevicesAsync\u003C/code\u003E to revoke other device-associated sessions while retaining the current one.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutMyOtherDevicesAsync();\n\nif (result.IsSuccess)\n{\n // Other devices were logged out.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is useful for account security pages that provide a \u003Cstrong\u003ELog out other devices\u003C/strong\u003E action.\u003C/p\u003E\n\u003Cp\u003EThe current authentication context is intended to remain active.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for identifying the current session or chain and enforcing the appropriate revocation scope.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-all-devices\u0022\u003E15. Logout All Devices\u003C/h2\u003E\n\u003Cp\u003EUse \u003Ccode\u003ELogoutAllMyDevicesAsync\u003C/code\u003E to revoke all applicable sessions for the current user.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutAllMyDevicesAsync();\n\nif (result.IsSuccess)\n{\n // All applicable device sessions were revoked.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EOn success, the client publishes a logout-related state event.\u003C/p\u003E\n\u003Cp\u003EThis operation is useful when a user suspects account compromise or wants to terminate existing authentication sessions across devices.\u003C/p\u003E\n\u003Cp\u003EIn JWT-based modes, previously issued access tokens may remain cryptographically valid until expiration unless additional revocation enforcement is configured.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022administrative-device-logout\u0022\u003E16. Administrative Device Logout\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth also exposes administrative session revocation operations.\u003C/p\u003E\n\u003Cp\u003EThese methods act on a specified user and require appropriate server-side authorization.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-one-user-device\u0022\u003ELogout One User Device\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutUserDeviceAsync(\n userKey,\n new LogoutDeviceRequest\n {\n ChainId = chainId\n });\n\nif (!result.IsSuccess)\n{\n // Handle the failure.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-other-devices-for-a-user\u0022\u003ELogout Other Devices for a User\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutUserOtherDevicesAsync(userKey, request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EHere, \u003Ccode\u003Erequest\u003C/code\u003E is a \u003Ccode\u003ELogoutOtherDevicesRequest\u003C/code\u003E identifying the chain to retain.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-all-devices-for-a-user\u0022\u003ELogout All Devices for a User\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LogoutAllUserDevicesAsync(userKey);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAdministrative methods do not grant administrative privileges by themselves.\u003C/p\u003E\n\u003Cp\u003EThe server must authorize the actor and validate the target user and requested revocation scope.\u003C/p\u003E\n\u003Cp\u003EThese operations are particularly relevant to administration panels and account security workflows.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022building-login-forms-with-uauthloginform\u0022\u003E17. Building Login Forms with UAuthLoginForm\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E, a reusable Blazor component that handles authentication form submission without requiring developers to implement the underlying flow orchestration themselves.\u003C/p\u003E\n\u003Cp\u003EThe component supports password-based login, PKCE completion through UAuthHub, configurable submission modes, structured validation feedback, and customizable UI content.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EYou design the login interface. UltimateAuth handles the authentication submission workflow.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022basic-usage\u0022\u003EBasic Usage\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E provides a complete, ready-to-use login form out of the box. No additional markup or credential bindings are required.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThat\u0027s it. UltimateAuth automatically renders the identifier field, password field, and submit button, and handles the authentication submission workflow.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECustomizing the Form\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhen you need a custom layout or styling, simply provide your own form content:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client.Blazor\n\n\u0026lt;UAuthLoginForm\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; placeholder=\u0026quot;Email\u0026quot; autocomplete=\u0026quot;username\u0026quot; /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot; placeholder=\u0026quot;Password\u0026quot; autocomplete=\u0026quot;current-password\u0026quot; /\u0026gt;\n \u0026lt;button type=\u0026quot;submit\u0026quot;\u0026gt;Sign in\u0026lt;/button\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUltimateAuth handles the authentication workflow in both cases. Your custom fields only need the correct HTML \u003Ccode\u003Ename\u003C/code\u003E attributes; there is no need to bind credentials to Blazor component state.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-credential-submission\u0022\u003ENative Credential Submission\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E reads credentials directly from native browser form fields. It does not accept \u003Ccode\u003EIdentifier\u003C/code\u003E or \u003Ccode\u003ESecret\u003C/code\u003E component parameters.\u003C/p\u003E\n\u003Cp\u003EWhen providing custom \u003Ccode\u003EChildContent\u003C/code\u003E, the form must contain enabled input elements with the exact names \u003Ccode\u003EIdentifier\u003C/code\u003E and \u003Ccode\u003ESecret\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003ECredential values should not be bound to Blazor component state solely for submission. This is particularly important in Blazor Server, where interactive component bindings can transmit credential values over the SignalR connection.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant: Do Not Disable Credential Fields During Submission\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EHTML inputs marked as \u003Ccode\u003Edisabled\u003C/code\u003E are excluded from \u003Ccode\u003EFormData\u003C/code\u003E and native form submissions.\u003C/p\u003E\n\u003Cp\u003EDo not set \u003Ccode\u003EDisabled=\u0026quot;@isSubmitting\u0026quot;\u003C/code\u003E on the username or password fields. A login preview may succeed, but the subsequent native commit can fail because the credential fields are missing from the submitted form.\u003C/p\u003E\n\u003Cp\u003EInstead, disable the submit button while leaving the credential inputs enabled.\u003C/p\u003E\n\u003Cp\u003EIf you need to prevent editing during submission, consider \u003Ccode\u003Ereadonly\u003C/code\u003E where supported, while accounting for component behavior, browser autofill, and accessibility.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECustom Form Requirements\u003C/strong\u003E\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EUse \u003Ccode\u003Ename=\u0026quot;Identifier\u0026quot;\u003C/code\u003E and \u003Ccode\u003Ename=\u0026quot;Secret\u0026quot;\u003C/code\u003E exactly.\u003C/li\u003E\n\u003Cli\u003EKeep both credential inputs enabled throughout submission.\u003C/li\u003E\n\u003Cli\u003EAvoid duplicate inputs with these names.\u003C/li\u003E\n\u003Cli\u003EUse \u003Ccode\u003Etype=\u0026quot;password\u0026quot;\u003C/code\u003E and \u003Ccode\u003Eautocomplete=\u0026quot;current-password\u0026quot;\u003C/code\u003E for password fields.\u003C/li\u003E\n\u003Cli\u003EKeep custom submit controls inside \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EUse \u003Ccode\u003EOnSubmittingChanged\u003C/code\u003E to manage loading indicators and submit-button state.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E handles the try and commit orchestration. The native commit includes the browser form fields, device information, and antiforgery data required by the configured authentication flow.\u003C/p\u003E\n\u003Cp\u003EThe component automatically uses \u003Ccode\u003ETryAndCommit\u003C/code\u003E as its default submission mode.\u003C/p\u003E\n\u003Cp\u003EWhen submitted, it:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates that the identifier and secret are present.\u003C/li\u003E\n\u003Cli\u003ECreates the appropriate authentication request.\u003C/li\u003E\n\u003Cli\u003ECalls the UltimateAuth client flow.\u003C/li\u003E\n\u003Cli\u003EPerforms the configured try/commit behavior.\u003C/li\u003E\n\u003Cli\u003EExposes structured results through \u003Ccode\u003EOnTryResult\u003C/code\u003E.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe example assumes that UltimateAuth\u0027s Blazor services have already been registered and that the hosting environment permits the selected login flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022customizing-the-login-ui\u0022\u003ECustomizing the Login UI\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E uses \u003Ccode\u003EChildContent\u003C/code\u003E, allowing developers to use standard HTML elements or their preferred Blazor component library.\u003C/p\u003E\n\u003Cp\u003EFor example, with MudBlazor:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client.Blazor\n@using CodeBeam.UltimateAuth.Client\n\n\u0026lt;UAuthLoginForm SubmitMode=\u0026quot;UAuthSubmitMode.TryAndCommit\u0026quot; OnTryResult=\u0026quot;HandleLoginResult\u0026quot; OnSubmittingChanged=\u0026quot;HandleSubmittingChanged\u0026quot;\u0026gt;\n \u0026lt;MudStack Spacing=\u0026quot;3\u0026quot;\u0026gt;\n \u0026lt;MudText Typo=\u0026quot;Typo.h5\u0026quot;\u0026gt;Sign in\u0026lt;/MudText\u0026gt;\n \u0026lt;MudTextField name=\u0026quot;Identifier\u0026quot; Label=\u0026quot;Email\u0026quot; Variant=\u0026quot;Variant.Outlined\u0026quot; /\u0026gt;\n \u0026lt;MudTextField name=\u0026quot;Secret\u0026quot; Label=\u0026quot;Password\u0026quot; InputType=\u0026quot;InputType.Password\u0026quot; Variant=\u0026quot;Variant.Outlined\u0026quot; /\u0026gt;\n\n \u0026lt;MudButton ButtonType=\u0026quot;ButtonType.Submit\u0026quot; Disabled=\u0026quot;@_isSubmitting\u0026quot; Variant=\u0026quot;Variant.Filled\u0026quot; Color=\u0026quot;Color.Primary\u0026quot; FullWidth\u0026gt;Sign in\u0026lt;/MudButton\u0026gt;\n\n @if (!string.IsNullOrWhiteSpace(error))\n {\n \u0026lt;MudAlert Severity=\u0026quot;Severity.Error\u0026quot;\u0026gt;@error\u0026lt;/MudAlert\u0026gt;\n }\n \u0026lt;/MudStack\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\n@code {\n private bool _isSubmitting;\n private string? error;\n\n private Task HandleSubmittingChanged(bool submitting)\n {\n _isSubmitting = submitting;\n return Task.CompletedTask;\n }\n\n private Task HandleLoginResult(IUAuthTryResult result)\n {\n error = result.IsSuccess ? null : \u0026quot;Unable to sign in.\u0026quot;;\n return Task.CompletedTask;\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe form controls remain under your control.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth does not require a particular visual design, CSS framework, or component library.\u003C/p\u003E\n\u003Cp\u003EBecause the component renders an HTML form internally, place the submit button inside its child content and avoid nesting another HTML form within it.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022submission-modes\u0022\u003ESubmission Modes\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003ESubmitMode\u003C/code\u003E to control how the authentication attempt is executed.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm SubmitMode=\u0026quot;UAuthSubmitMode.TryAndCommit\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryOnly\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidates the authentication attempt without committing login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAttempts authentication and commits on success\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmits directly to the commit flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E is the default.\u003C/p\u003E\n\u003Cp\u003EFor interactive login forms that need validation feedback, it is generally the recommended choice.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EDirectCommit\u003C/code\u003E does not invoke \u003Ccode\u003EOnTryResult\u003C/code\u003E, because it does not perform the structured try operation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-authentication-results\u0022\u003EHandling Authentication Results\u003C/h3\u003E\n\u003Cp\u003EThe component exposes an \u003Ccode\u003EOnTryResult\u003C/code\u003E callback:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm OnTryResult=\u0026quot;HandleResult\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe callback receives \u003Ccode\u003EIUAuthTryResult\u003C/code\u003E, allowing the same component to report password login and PKCE completion results.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eprivate Task HandleResult(IUAuthTryResult result)\n{\n if (!result.IsSuccess)\n {\n errorMessage = \u0026quot;Authentication failed.\u0026quot;;\n }\n\n return Task.CompletedTask;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor flow-specific details, inspect the concrete result type:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eprivate Task HandleResult(IUAuthTryResult result)\n{\n if (result is TryLoginResult loginResult)\n {\n if (loginResult.LockoutUntilUtc is not null)\n {\n errorMessage = \u0026quot;Your account is temporarily locked.\u0026quot;;\n }\n else if (loginResult.RequiresMfa)\n {\n // Continue the supported additional authentication workflow.\n }\n else if (!loginResult.IsSuccess)\n {\n errorMessage = \u0026quot;Unable to sign in.\u0026quot;;\n }\n }\n else if (result is TryPkceLoginResult pkceResult)\n {\n if (pkceResult.RetryWithNewPkce)\n {\n errorMessage = \u0026quot;Please restart the authentication flow.\u0026quot;;\n }\n else if (!pkceResult.IsSuccess)\n {\n errorMessage = \u0026quot;Unable to complete authentication.\u0026quot;;\n }\n }\n\n return Task.CompletedTask;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe callback reports the structured try result. It does not replace authentication state management or server-side validation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-uauthloginform-with-pkce\u0022\u003EUsing UAuthLoginForm with PKCE\u003C/h3\u003E\n\u003Cp\u003EThe same component also supports PKCE login completion when hosted within a supported UAuthHub environment.\u003C/p\u003E\n\u003Cp\u003ESet \u003Ccode\u003ELoginType\u003C/code\u003E to \u003Ccode\u003EPkce\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm LoginType=\u0026quot;UAuthLoginType.Pkce\u0026quot; SubmitMode=\u0026quot;UAuthSubmitMode.TryAndCommit\u0026quot; OnTryResult=\u0026quot;HandleLoginResult\u0026quot;\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; placeholder=\u0026quot;Email\u0026quot; /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot; placeholder=\u0026quot;Password\u0026quot; /\u0026gt;\n \u0026lt;button type=\u0026quot;submit\u0026quot;\u0026gt;Continue\u0026lt;/button\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn PKCE mode, the component:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EResolves the relevant UAuthHub session context.\u003C/li\u003E\n\u003Cli\u003ERetrieves the authorization code and code verifier through the configured Hub services.\u003C/li\u003E\n\u003Cli\u003EBuilds a \u003Ccode\u003EPkceCompleteRequest\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EInvokes the corresponding PKCE completion flow.\u003C/li\u003E\n\u003Cli\u003EReports the structured result when a try-enabled submission mode is used.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe application does not need to manually construct the PKCE completion request for this form.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E PKCE mode requires a supported server-side UAuthHub environment. \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E checks the available Hub capabilities and throws when PKCE login is requested in an unsupported application profile.\u003C/p\u003E\n\u003Cp\u003EA Blazor WebAssembly application should initiate PKCE using \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E; the Hub-hosted login form handles the completion stage.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022return-url-handling\u0022\u003EReturn URL Handling\u003C/h3\u003E\n\u003Cp\u003EYou can provide an explicit return URL:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm ReturnUrl=\u0026quot;/dashboard\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe component resolves the effective return URL using the following precedence:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EExplicit \u003Ccode\u003EReturnUrl\u003C/code\u003E parameter.\u003C/li\u003E\n\u003Cli\u003EUAuthHub flow return URL when using PKCE.\u003C/li\u003E\n\u003Cli\u003ECurrent navigation URL.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThis allows a shared login component to participate in different authentication journeys without hardcoding navigation logic into the form.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-login-endpoints\u0022\u003ECustom Login Endpoints\u003C/h3\u003E\n\u003Cp\u003EFor advanced integrations, the \u003Ccode\u003EEndpoint\u003C/code\u003E parameter allows the form\u0027s HTML action endpoint to be overridden:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm Endpoint=\u0026quot;/custom-login\u0026quot; SubmitMode=\u0026quot;UAuthSubmitMode.DirectCommit\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe endpoint is resolved relative to the configured UltimateAuth endpoint base path and multi-tenant settings.\u003C/p\u003E\n\u003Cp\u003ENote that \u003Ccode\u003EEndpoint\u003C/code\u003E affects the form\u0027s HTML action. Try-based submissions invoke the configured \u003Ccode\u003EUAuthClient.Flows\u003C/code\u003E endpoints, so changing \u003Ccode\u003EEndpoint\u003C/code\u003E alone does not redirect those SDK requests to a custom endpoint.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022submit-the-form-programmatically\u0022\u003ESubmit the Form Programmatically\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E exposes \u003Ccode\u003ESubmitAsync\u003C/code\u003E, allowing submission through a component reference.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm @ref=\u0026quot;loginForm\u0026quot; AllowEnterKeyToSubmit=\u0026quot;false\u0026quot;\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; placeholder=\u0026quot;Email\u0026quot; /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot; /\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\n\u0026lt;button type=\u0026quot;button\u0026quot; @onclick=\u0026quot;SubmitLoginAsync\u0026quot;\u0026gt;\n Sign in\n\u0026lt;/button\u0026gt;\n\n@code {\n private UAuthLoginForm? loginForm;\n\n private async Task SubmitLoginAsync()\n {\n if (loginForm is not null)\n {\n await loginForm.SubmitAsync();\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ESubmitAsync\u003C/code\u003E must be called after the component has rendered.\u003C/p\u003E\n\u003Cp\u003EThis is useful when submission is initiated from a custom button, dialog, or application-specific interaction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022controlling-enter-key-submission\u0022\u003EControlling Enter-Key Submission\u003C/h3\u003E\n\u003Cp\u003EBy default, the component supports Enter-key submission.\u003C/p\u003E\n\u003Cp\u003EYou can disable its built-in hidden submit button:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm AllowEnterKeyToSubmit=\u0026quot;false\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis option controls the component\u0027s built-in Enter-key submit mechanism. Other submit buttons inside the form may still trigger normal browser form submission behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022reloading-pkce-context\u0022\u003EReloading PKCE Context\u003C/h3\u003E\n\u003Cp\u003EThe component exposes \u003Ccode\u003EReloadAsync\u003C/code\u003E to reload its Hub credentials and flow state.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm @ref=\u0026quot;loginForm\u0026quot; LoginType=\u0026quot;UAuthLoginType.Pkce\u0026quot;\u0026gt;\n ...\n\u0026lt;/UAuthLoginForm\u0026gt;\n\n@code {\n private UAuthLoginForm? loginForm;\n\n private async Task ReloadLoginContextAsync()\n {\n if (loginForm is not null)\n {\n await loginForm.ReloadAsync();\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an advanced capability intended for scenarios where the associated Hub state changes and the component must refresh its internal context.\u003C/p\u003E\n\u003Cp\u003EIt does not initiate a new PKCE authorization flow by itself.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022component-parameters\u0022\u003EComponent Parameters\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EParameter\u003C/th\u003E\n\u003Cth\u003EType\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthLoginType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPassword\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPassword or PKCE login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESubmitMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthSubmitMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryAndCommit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESubmission strategy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Estring?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERedirect destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoint\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Estring?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECustom HTML form endpoint\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubSessionId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubSessionId?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExplicit Hub session context\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowEnterKeyToSubmit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ebool\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBuilt-in Enter-key submit support\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnTryResult\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EEventCallback\u0026lt;IUAuthTryResult\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u2014\u003C/td\u003E\n\u003Ctd\u003EStructured try result callback\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnSubmittingChanged\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EEventCallback\u0026lt;bool\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u2014\u003C/td\u003E\n\u003Ctd\u003ESubmission state change callback\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EChildContent\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERenderFragment?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u2014\u003C/td\u003E\n\u003Ctd\u003ECustom form content\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022when-to-use-uauthloginform\u0022\u003EWhen to Use UAuthLoginForm\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003EUAuthLoginForm\u003C/code\u003E when building a Blazor login interface that should integrate directly with UltimateAuth\u0027s supported authentication flows.\u003C/p\u003E\n\u003Cp\u003EIt is particularly useful when:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EYou want to use your own component library without implementing the authentication submission logic.\u003C/li\u003E\n\u003Cli\u003EYou need structured login validation feedback.\u003C/li\u003E\n\u003Cli\u003EYou want to switch between try-only and commit behavior.\u003C/li\u003E\n\u003Cli\u003EYou are building a UAuthHub login page that completes PKCE.\u003C/li\u003E\n\u003Cli\u003EYou want to share login UI across supported Blazor hosting environments.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor application-specific workflows that cannot be expressed through the component, use \u003Ccode\u003EUAuthClient.Flows\u003C/code\u003E directly.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe component handles the login workflow, while your application retains control over presentation, user experience, and surrounding application logic.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-integration-mistakes\u0022\u003E18. Common Integration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022calling-direct-login-from-a-public-client\u0022\u003ECalling Direct Login from a Public Client\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E \u003Ccode\u003ELoginAsync\u003C/code\u003E throws because direct credential posting is disabled.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Use \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E and the supported PKCE completion flow. Do not enable \u003Ccode\u003EAllowCredentialPost\u003C/code\u003E to bypass the public-client restriction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-tryonly-as-authentication\u0022\u003ETreating TryOnly as Authentication\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E The application receives \u003Ccode\u003EIsSuccess = true\u003C/code\u003E from \u003Ccode\u003ETryOnly\u003C/code\u003E and assumes the user is logged in.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E A successful try result does not commit authentication. Use \u003Ccode\u003ETryAndCommit\u003C/code\u003E or the appropriate commit flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-directcommit-skips-server-validation\u0022\u003EAssuming DirectCommit Skips Server Validation\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E DirectCommit is interpreted as a faster but less secure authentication mode.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E DirectCommit skips the separate client try stage. The server still validates the actual authentication request.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-every-refresh-rotates-tokens\u0022\u003EAssuming Every Refresh Rotates Tokens\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E The application requires \u003Ccode\u003ERefreshOutcome.Rotated\u003C/code\u003E for refresh success.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Check \u003Ccode\u003ERefreshResult.IsSuccess\u003C/code\u003E. Rotation, touch, and no-op behavior depend on the authentication mode and refresh strategy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-a-session-id-for-device-logout\u0022\u003EUsing a Session ID for Device Logout\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E A session identifier is passed to a device logout operation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E \u003Ccode\u003ELogoutMyDeviceAsync\u003C/code\u003E requires \u003Ccode\u003ELogoutDeviceRequest\u003C/code\u003E with a \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-logout-immediately-invalidates-all-jwts\u0022\u003EAssuming Logout Immediately Invalidates All JWTs\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E An application expects every issued JWT access token to become unusable immediately after server-side logout.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Understand the enforcement behavior of SemiHybrid and PureJwt. Local JWT validation may continue accepting previously issued tokens until expiration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-validateasync-on-every-render\u0022\u003EUsing ValidateAsync on Every Render\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EProblem:\u003C/strong\u003E Components repeatedly make validation requests just to display authenticated UI.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESolution:\u003C/strong\u003E Use the appropriate authentication state integration for UI rendering, and reserve explicit validation for operations that require it.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client-sdk/session-management\u0022\u003ESession Management\u003C/a\u003E \u2014 Inspect and manage session and device information.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/security/token-security\u0022\u003EToken Security\u003C/a\u003E \u2014 Understand token validity, refresh behavior, and revocation.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/security/refresh-rotation\u0022\u003ERefresh Rotation \u0026amp; Replay Protection\u003C/a\u003E \u2014 Explore refresh concurrency and reuse security.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E \u2014 Compare authentication behavior across modes.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/sessions-devices/device-management\u0022\u003EDevice Management\u003C/a\u003E \u2014 Understand device-associated session chains.\u003C/li\u003E\n\u003C/ul\u003E\n", "Headings": [ { "Id": "accessing-the-authentication-client", @@ -18,6 +18,16 @@ "Text": "3. Direct Login", "Level": 0 }, + { + "Id": "login-transport-selection", + "Text": "Login Transport Selection", + "Level": 1 + }, + { + "Id": "processing-header-delivered-access-tokens", + "Text": "Processing Header-Delivered Access Tokens", + "Level": 1 + }, { "Id": "loginrequest-properties", "Text": "LoginRequest Properties", @@ -108,6 +118,16 @@ "Text": "RetryWithNewPkce", "Level": 1 }, + { + "Id": "uauthhub-handoff-and-credential-ownership", + "Text": "UAuthHub Handoff and Credential Ownership", + "Level": 1 + }, + { + "Id": "authentication-recovery", + "Text": "Authentication Recovery", + "Level": 1 + }, { "Id": "direct-credential-posting-restrictions", "Text": "8. Direct Credential Posting Restrictions", @@ -334,6 +354,6 @@ "Level": 0 } ], - "SourceHash": "D75866D2011603A6FEAA81BF5BF5197600E97F76FCC929C306EBFE03B5642F4E", + "SourceHash": "18F45A750C6125AF97026AE10D04E24F8C45DCB3A65DC9C8F04B3F0875FE0412", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/resource-api-requests.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/resource-api-requests.json index ddc378fa..b5d128a4 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/resource-api-requests.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/client-sdk/resource-api-requests.json @@ -1,7 +1,7 @@ { "Slug": "client-sdk/resource-api-requests", "Title": "Resource API Requests", - "Html": "\n\u003Cp\u003E\u003Cstrong\u003EAuthenticate once. Access your application resources through the same unified client.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAuthentication is only the beginning of an application.\u003C/p\u003E\n\u003Cp\u003EOnce a user signs in, the application still needs to retrieve data, create records, update resources, and communicate with protected APIs.\u003C/p\u003E\n\u003Cp\u003ETraditionally, this introduces another layer of integration work.\u003C/p\u003E\n\u003Cp\u003EDevelopers configure authentication through one library, then build a separate HTTP client to access their application APIs. They must handle credentials, browser restrictions, response parsing, errors, and differences between hosting environments.\u003C/p\u003E\n\u003Cp\u003EThe result is often two separate programming models: one for authentication and another for everything that comes after it.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth brings these operations together through \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EInstead of introducing another client abstraction, applications can use the same UltimateAuth entry point for authentication, identity management, and protected resource requests.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource\n .GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENo custom JavaScript wrapper. No application-specific response type. No separate HTTP client configuration for ordinary authenticated resource requests.\u003C/p\u003E\n\u003Cp\u003EThe goal is straightforward: \u003Cstrong\u003Emake accessing protected application resources feel like a natural continuation of authentication.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022the-problem-authentication-ends-integration-work-begins\u0022\u003E1. The Problem: Authentication Ends, Integration Work Begins\u003C/h2\u003E\n\u003Cp\u003EConsider a typical application with three components:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Application\n |\n \u002B----\u0026gt; UAuthHub\n | Authentication\n | Sessions\n | Identity\n |\n \u002B----\u0026gt; Resource API\n Products\n Orders\n Application Data\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUltimateAuth handles authentication and identity operations.\u003C/p\u003E\n\u003Cp\u003EBut the application also needs to communicate with its Resource API.\u003C/p\u003E\n\u003Cp\u003EWithout a unified resource client, developers typically need to:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EConfigure an additional HTTP client.\u003C/li\u003E\n\u003Cli\u003EDetermine how authentication credentials should accompany requests.\u003C/li\u003E\n\u003Cli\u003EHandle browser credential policies and cross-origin restrictions.\u003C/li\u003E\n\u003Cli\u003EMaintain device and application profile metadata where applicable.\u003C/li\u003E\n\u003Cli\u003EDeserialize successful responses.\u003C/li\u003E\n\u003Cli\u003ETranslate unsuccessful HTTP responses into application-friendly results.\u003C/li\u003E\n\u003Cli\u003EImplement similar request handling across multiple components.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThese responsibilities are not necessarily complicated individually.\u003C/p\u003E\n\u003Cp\u003EThe problem is their repetition.\u003C/p\u003E\n\u003Cp\u003EA framework that simplifies authentication should not require developers to rebuild the surrounding integration layer every time they need application data.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-unified-client-model\u0022\u003EA Unified Client Model\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth already exposes specialized operations through \u003Ccode\u003EIUAuthClient\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClient.Flows\nUAuthClient.Users\nUAuthClient.Sessions\nUAuthClient.Credentials\nUAuthClient.Authorization\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResource requests follow the same model:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClient.Resource\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis preserves a consistent entry point without mixing application-specific business operations into UltimateAuth\u0027s authentication services.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth does not need to know what a \u003Ccode\u003EProduct\u003C/code\u003E, \u003Ccode\u003EOrder\u003C/code\u003E, or \u003Ccode\u003EInvoice\u003C/code\u003E represents.\u003C/p\u003E\n\u003Cp\u003EIt only needs to provide a predictable way to communicate with the API that owns those resources.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022getting-started\u0022\u003E2. Getting Started\u003C/h2\u003E\n\u003Cp\u003EThe Resource API client is available through the UltimateAuth Client SDK.\u003C/p\u003E\n\u003Cp\u003EFor Blazor applications, register the Blazor client integration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe registration includes the shared client services and the browser-specific resource transport.\u003C/p\u003E\n\u003Cp\u003EYou do not need to register a separate Resource Client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inject-iuauthclient\u0022\u003EInject IUAuthClient\u003C/h3\u003E\n\u003Cp\u003EIn a Blazor component:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen call a protected application endpoint:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is not null)\n{\n products = result.Value;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe response uses the same structured result model found throughout UltimateAuth.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-happens-behind-the-call\u0022\u003EWhat Happens Behind the Call?\u003C/h3\u003E\n\u003Cp\u003EFor the Blazor integration, the request follows this path:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Component\n |\n v\nIUAuthClient.Resource\n |\n v\nResource Client\n |\n v\nUltimateAuth Browser Transport\n |\n v\nProtected Resource API\n |\n v\nUAuthResult\u0026lt;T\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe browser transport handles request construction and browser-specific behavior.\u003C/p\u003E\n\u003Cp\u003EThe Resource API remains responsible for validating authentication and enforcing authorization.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EA successful client request does not bypass server-side security.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022supported-http-operations\u0022\u003E3. Supported HTTP Operations\u003C/h2\u003E\n\u003Cp\u003EThe Resource Client provides five standard HTTP operations.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMethod\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003Cth\u003EReturn type\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EGetAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERetrieve a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPostAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECreate or submit a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPutAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReplace or update a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPatchAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPartially update a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeleteAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDelete a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EAll methods accept a relative endpoint and support cancellation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022get\u0022\u003EGET\u003C/h3\u003E\n\u003Cp\u003ERetrieve application data:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is not null)\n{\n products = result.Value;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERetrieve a single resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{productId}\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022post\u0022\u003EPOST\u003C/h3\u003E\n\u003Cp\u003ESubmit a new resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar product = new Product\n{\n Name = \u0026quot;Example Product\u0026quot;,\n Price = 29.99m\n};\n\nvar result = await UAuthClient.Resource.PostAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products\u0026quot;, product);\n\nif (result.IsSuccess)\n{\n // Product created successfully.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe request payload is serialized for transport.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022put\u0022\u003EPUT\u003C/h3\u003E\n\u003Cp\u003EUpdate a resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource\n .PutAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{product.Id}\u0026quot;, product);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022patch\u0022\u003EPATCH\u003C/h3\u003E\n\u003Cp\u003ESubmit a partial update:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar changes = new\n{\n Price = 24.99m\n};\n\nvar result = await UAuthClient.Resource\n .PatchAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{productId}\u0026quot;, changes);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client sends the request payload.\u003C/p\u003E\n\u003Cp\u003EThe receiving API determines which partial-update formats and operations it supports.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022delete\u0022\u003EDELETE\u003C/h3\u003E\n\u003Cp\u003EDelete a resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.DeleteAsync($\u0026quot;/api/products/{productId}\u0026quot;);\n\nif (result.IsSuccess)\n{\n // Resource deleted successfully.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUnlike the other methods, \u003Ccode\u003EDeleteAsync\u003C/code\u003E returns the non-generic \u003Ccode\u003EUAuthResult\u003C/code\u003E because the operation does not require a response value.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022consistent-results-with-uauthresult\u0022\u003E4. Consistent Results with UAuthResult\u003C/h2\u003E\n\u003Cp\u003EA common source of unnecessary complexity is response handling.\u003C/p\u003E\n\u003Cp\u003EOne API client returns \u003Ccode\u003EHttpResponseMessage\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EAnother returns a custom response wrapper.\u003C/p\u003E\n\u003Cp\u003EA third throws exceptions for ordinary HTTP failures.\u003C/p\u003E\n\u003Cp\u003EApplications then need different handling logic for operations that are conceptually similar.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth uses \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E to provide a consistent response contract.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products/42\u0026quot;);\n\nif (result.IsSuccess)\n{\n var product = result.Value;\n}\nelse\n{\n var status = result.Status;\n var problem = result.Problem;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022result-properties\u0022\u003EResult Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIsSuccess\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIndicates whether the HTTP operation succeeded\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EStatus\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHTTP response status code\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDeserialized response value for successful generic operations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EProblem\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EStructured problem information when available\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EA failed HTTP response does not automatically mean a transport exception.\u003C/p\u003E\n\u003Cp\u003EFor example, an API may return:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003E400 Bad Request\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E401 Unauthorized\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E403 Forbidden\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E404 Not Found\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E409 Conflict\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese responses can be represented through \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe application can inspect the status and decide how to respond.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022structured-problems\u0022\u003EStructured Problems\u003C/h3\u003E\n\u003Cp\u003EWhen an unsuccessful response contains a compatible UltimateAuth problem payload, the Resource Client attempts to deserialize it into \u003Ccode\u003EUAuthProblem\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eif (!result.IsSuccess)\n{\n if (result.Problem is not null)\n {\n // Handle the structured API problem.\n }\n else\n {\n // Handle the HTTP status without a structured problem.\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENot every API returns a compatible problem body.\u003C/p\u003E\n\u003Cp\u003ETherefore, \u003Ccode\u003EProblem\u003C/code\u003E may be \u003Ccode\u003Enull\u003C/code\u003E even when the request failed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022transport-failures-are-different\u0022\u003ETransport Failures Are Different\u003C/h3\u003E\n\u003Cp\u003ENetwork failures, protocol errors, and request cancellation are different from ordinary unsuccessful HTTP responses.\u003C/p\u003E\n\u003Cp\u003EFor example, an unreachable API does not necessarily produce an HTTP status code.\u003C/p\u003E\n\u003Cp\u003EApplications should distinguish transport exceptions from valid HTTP responses indicating failure.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E standardizes HTTP response handling; it does not guarantee that every network or runtime failure becomes a result object.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-configuration\u0022\u003E5. Resource API Configuration\u003C/h2\u003E\n\u003Cp\u003EResource API configuration is part of \u003Ccode\u003EUAuthClientOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe \u003Ccode\u003EResource\u003C/code\u003E options are separate from the authentication endpoint configuration.\u003C/p\u003E\n\u003Cp\u003EThis distinction allows applications to authenticate against one server while accessing resources hosted elsewhere.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022baseaddress\u0022\u003EBaseAddress\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EBaseAddress\u003C/code\u003E identifies the Resource API origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIf \u003Ccode\u003EBaseAddress\u003C/code\u003E is not configured, requests use the application\u0027s current origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA call such as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Ethen targets the application\u0027s origin.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022baseaddress-validation\u0022\u003EBaseAddress Validation\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth validates the configured Resource API address.\u003C/p\u003E\n\u003Cp\u003EThe address must:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBe an absolute HTTP or HTTPS URL.\u003C/li\u003E\n\u003Cli\u003EUse HTTPS, except for loopback development addresses.\u003C/li\u003E\n\u003Cli\u003ERepresent an origin without an additional path.\u003C/li\u003E\n\u003Cli\u003EExclude embedded credentials, query strings, and fragments.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EValid examples:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Ehttps://api.example.com\nhttps://localhost:7001\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EInvalid examples:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Ehttps://api.example.com/api\nhttps://api.example.com?version=1\nhttp://api.example.com\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EKeep endpoint paths in individual Resource Client calls:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis separates deployment configuration from application resource paths.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-credential-handling\u0022\u003E6. Browser Credential Handling\u003C/h2\u003E\n\u003Cp\u003EBrowser-based applications do not have unrestricted control over authentication credentials.\u003C/p\u003E\n\u003Cp\u003ECookies, origins, cross-origin requests, and browser security policies all influence how requests are sent.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth exposes credential handling through \u003Ccode\u003EUAuthResourceCredentialsMode\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELet UltimateAuth select the appropriate browser credential policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESameOrigin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESend browser credentials only for same-origin requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EInclude\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude browser credentials for the configured Resource API origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOmit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDo not send browser credentials\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022same-origin-resource-api\u0022\u003ESame-Origin Resource API\u003C/h3\u003E\n\u003Cp\u003EWhen the application and Resource API share an origin:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Ehttps://app.example.com\nhttps://app.example.com/api/products\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Eyou can use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.SameOrigin;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is appropriate when the Resource API relies on browser credentials available to the application origin.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022separate-resource-api\u0022\u003ESeparate Resource API\u003C/h3\u003E\n\u003Cp\u003EConsider:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EApplication: https://app.example.com\nResource API: https://api.example.com\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor a cross-origin API that requires browser cookies, configure:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Include;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe receiving API must also support the relevant browser security requirements.\u003C/p\u003E\n\u003Cp\u003EFor credentialed cross-origin requests, this typically includes:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EExplicitly permitted origins.\u003C/li\u003E\n\u003Cli\u003EAppropriate CORS configuration.\u003C/li\u003E\n\u003Cli\u003ECompatible cookie attributes and browser policies.\u003C/li\u003E\n\u003Cli\u003EServer-side authentication and authorization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EConfiguring \u003Ccode\u003EInclude\u003C/code\u003E does not override browser restrictions or guarantee that a cookie is available for the destination.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022when-to-use-omit\u0022\u003EWhen to Use Omit\u003C/h3\u003E\n\u003Cp\u003ESome resource endpoints do not require browser cookies.\u003C/p\u003E\n\u003Cp\u003EFor those cases:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.Omit;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis prevents browser credentials from being included in the resource request.\u003C/p\u003E\n\u003Cp\u003EThe API must still enforce whichever authentication mechanism it requires.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECredential transmission is not the same as authorization.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022separate-uauthhub-and-resource-api\u0022\u003E7. Separate UAuthHub and Resource API\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports architectures where authentication and application resources are hosted independently.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Blazor Application\n |\n \u002B------------\u002B------------\u002B\n | |\n v v\n UAuthHub Resource API\n auth.example.com api.example.com\n | |\n v v\n Authentication Application Data\n Sessions Business Operations\n Identity Authorization\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client can configure both destinations independently:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAuthentication operations use the configured authentication endpoints.\u003C/p\u003E\n\u003Cp\u003EResource operations use the configured Resource API origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar profile = await UAuthClient.Users.GetMeAsync();\n\nvar products = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EBoth operations are accessed through \u003Ccode\u003EIUAuthClient\u003C/code\u003E, but they serve different purposes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-does-not-automatically-protect-an-api\u0022\u003EAuthentication Does Not Automatically Protect an API\u003C/h3\u003E\n\u003Cp\u003EConfiguring a Resource API address does not automatically enable authentication or authorization on that API.\u003C/p\u003E\n\u003Cp\u003EThe Resource API must independently validate incoming requests and enforce its access rules.\u003C/p\u003E\n\u003Cp\u003EFor separate deployments, the Resource API must also be configured to accept and validate the authentication material associated with the selected UltimateAuth authentication mode.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client simplifies communication.\u003C/p\u003E\n\u003Cp\u003EIt does not replace the receiving server\u0027s security responsibilities.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-mode-compatibility\u0022\u003EAuthentication Mode Compatibility\u003C/h3\u003E\n\u003Cp\u003EUAuthHub and Resource APIs are configured independently.\u003C/p\u003E\n\u003Cp\u003EUAuthHub determines which authentication credentials are issued to a client. A Resource API determines which credentials it accepts and how they are validated.\u003C/p\u003E\n\u003Cp\u003EUsing the same UltimateAuth infrastructure does not automatically make all authentication modes interchangeable.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EClient Credential\u003C/th\u003E\n\u003Cth\u003EResource API Validation\u003C/th\u003E\n\u003Cth\u003ECurrent Support\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureOpaque session\u003C/td\u003E\n\u003Ctd\u003ERemote session validation\u003C/td\u003E\n\u003Ctd\u003ESupported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureJwt access token\u003C/td\u003E\n\u003Ctd\u003ELocal JWT validation\u003C/td\u003E\n\u003Ctd\u003ESupported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid session credential\u003C/td\u003E\n\u003Ctd\u003ERemote session validation\u003C/td\u003E\n\u003Ctd\u003ESupported when correctly configured\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid JWT access token\u003C/td\u003E\n\u003Ctd\u003EHybrid-aware JWT validation\u003C/td\u003E\n\u003Ctd\u003ENot yet implemented\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureOpaque session\u003C/td\u003E\n\u003Ctd\u003EPureJwt-only validation\u003C/td\u003E\n\u003Ctd\u003ENot supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EA PureJwt Resource API cannot authenticate an opaque session credential as a JWT.\u003C/p\u003E\n\u003Cp\u003ELikewise, configuring a Resource API URL in the client SDK does not automatically exchange session credentials for JWT access tokens.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery\u0022\u003ECredential Delivery\u003C/h3\u003E\n\u003Cp\u003EThe client and Resource API must agree on how the credential is transported.\u003C/p\u003E\n\u003Cp\u003EFor header delivery, the API must read the configured access-token header and format.\u003C/p\u003E\n\u003Cp\u003EFor cookie delivery, the API must read the configured access-token cookie. Browser origin, cookie scope, SameSite, Secure, and CORS settings must permit the credential to reach the API.\u003C/p\u003E\n\u003Cp\u003EThe Resource API must independently validate the credential and enforce authorization policies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-and-uauthhub-connectivity\u0022\u003EPureJwt and UAuthHub Connectivity\u003C/h3\u003E\n\u003Cp\u003EA PureJwt Resource API does not need to contact UAuthHub to validate each JWT.\u003C/p\u003E\n\u003Cp\u003EHowever, clients still use UAuthHub for login, refresh, and logout operations.\u003C/p\u003E\n\u003Cp\u003EThis separation allows protected APIs to validate access tokens independently while the authentication authority manages refresh-token state.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022device-and-application-profile-metadata\u0022\u003E8. Device and Application Profile Metadata\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth maintains a distinction between user identity, device identity, and client environment.\u003C/p\u003E\n\u003Cp\u003EFor browser resource requests, the transport can propagate UltimateAuth metadata, including:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EX-UDID\nX-UAuth-ApplicationProfile\nX-Requested-With\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis keeps resource requests consistent with the UltimateAuth application environment without requiring every application component to construct these headers manually.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Edoes not require the developer to manually retrieve and attach the device identifier.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022metadata-is-not-proof-of-identity\u0022\u003EMetadata Is Not Proof of Identity\u003C/h3\u003E\n\u003Cp\u003EDevice identifiers and application profile values describe request context.\u003C/p\u003E\n\u003Cp\u003EThey are not independent authentication credentials.\u003C/p\u003E\n\u003Cp\u003EA receiving API must not grant access solely because a request declares a particular device identifier or application profile.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for validating the user\u0027s authentication state and permissions.\u003C/p\u003E\n\u003Cp\u003EFor more information, see \u003Ca href=\u0022/docs/fundamentals/application-profiles\u0022\u003EApplication Profiles\u003C/a\u003E.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-transport-and-security\u0022\u003E9. Browser Transport and Security\u003C/h2\u003E\n\u003Cp\u003EThe Blazor Resource Client uses UltimateAuth\u0027s browser transport.\u003C/p\u003E\n\u003Cp\u003EThis allows UltimateAuth to apply consistent request behavior without requiring developers to write a separate JavaScript module for their application.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022origin-validation\u0022\u003EOrigin Validation\u003C/h3\u003E\n\u003Cp\u003EResource requests are constrained by the configured Resource API origin.\u003C/p\u003E\n\u003Cp\u003EThe transport validates request destinations rather than allowing arbitrary URLs to bypass the configured resource boundary.\u003C/p\u003E\n\u003Cp\u003EThis helps prevent application code from unintentionally sending credentials or UltimateAuth request metadata to unrelated destinations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022redirect-protection\u0022\u003ERedirect Protection\u003C/h3\u003E\n\u003Cp\u003EResource requests use redirect protection.\u003C/p\u003E\n\u003Cp\u003EA request should not silently follow a redirect to an unexpected destination while carrying authentication-related context.\u003C/p\u003E\n\u003Cp\u003EApplications should handle unexpected redirects as transport failures rather than assuming the request succeeded.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022request-cancellation\u0022\u003ERequest Cancellation\u003C/h3\u003E\n\u003Cp\u003EResource operations support \u003Ccode\u003ECancellationToken\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));\n\nvar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;, cts.Token);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Blazor transport coordinates cancellation with the underlying browser request.\u003C/p\u003E\n\u003Cp\u003ECancellation is particularly useful when a user navigates away from a page or starts another operation before the previous request completes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-security-still-applies\u0022\u003EBrowser Security Still Applies\u003C/h3\u003E\n\u003Cp\u003EThe Resource Client does not disable browser security mechanisms.\u003C/p\u003E\n\u003Cp\u003ECross-origin requests remain subject to CORS and browser credential policies.\u003C/p\u003E\n\u003Cp\u003ELikewise, origin validation and redirect protection do not replace:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication validation.\u003C/li\u003E\n\u003Cli\u003EAuthorization policies.\u003C/li\u003E\n\u003Cli\u003ECSRF protection where applicable.\u003C/li\u003E\n\u003Cli\u003EInput validation.\u003C/li\u003E\n\u003Cli\u003EServer-side resource ownership checks.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese responsibilities remain part of the receiving API\u0027s security model.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-vs.blazor-webassembly\u0022\u003E10. Blazor Server vs. Blazor WebAssembly\u003C/h2\u003E\n\u003Cp\u003EOne of UltimateAuth\u0027s design goals is to provide a consistent client API across supported application environments.\u003C/p\u003E\n\u003Cp\u003EHowever, different hosting models have different execution characteristics.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-webassembly\u0022\u003EBlazor WebAssembly\u003C/h3\u003E\n\u003Cp\u003EBlazor WebAssembly executes application code in the browser.\u003C/p\u003E\n\u003Cp\u003EIt cannot directly invoke server-side application services or access a server database.\u003C/p\u003E\n\u003Cp\u003EA typical application architecture is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor WebAssembly\n |\n v\nIUAuthClient.Resource\n |\n v\nResource API\n |\n v\nApplication Services\n |\n v\nDatabase\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client provides a natural way to access protected application data from this environment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server\u0022\u003EBlazor Server\u003C/h3\u003E\n\u003Cp\u003EBlazor Server executes component logic on the server.\u003C/p\u003E\n\u003Cp\u003EWhen the application service is available in the same process, a direct service call is often more appropriate.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Server Component\n |\n v\nApplication Service\n |\n v\nDatabase\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar products = await productService.GetAllAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThere is no requirement to introduce an HTTP request simply to use the Resource Client.\u003C/p\u003E\n\u003Cp\u003EHowever, when a Blazor Server application needs to communicate with a separate protected Resource API, it can use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E The current Blazor Resource Client uses browser-based transport, including in Blazor Server applications.\u003C/p\u003E\n\u003Cp\u003EThe HTTP request is initiated by the user\u0027s browser, not by a server-side \u003Ccode\u003EHttpClient\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor server-to-server communication, use an appropriate server-side HTTP integration and authentication mechanism.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022the-same-client-api-different-application-architectures\u0022\u003EThe Same Client API, Different Application Architectures\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth aims to make client integration consistent without forcing every application into the same deployment model.\u003C/p\u003E\n\u003Cp\u003EThe goal is not to replace direct application service calls.\u003C/p\u003E\n\u003Cp\u003EThe goal is to remove unnecessary integration work whenever an HTTP resource request is actually needed.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-unauthorized-responses\u0022\u003E11. Handling Unauthorized Responses\u003C/h2\u003E\n\u003Cp\u003EAn authenticated session may expire or become invalid while an application is running.\u003C/p\u003E\n\u003Cp\u003EWhen a Resource API returns \u003Ccode\u003E401 Unauthorized\u003C/code\u003E, the Resource Client exposes the unsuccessful HTTP response through its standard result contract.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (!result.IsSuccess \u0026amp;\u0026amp; result.Status == 401)\n{\n // Authentication may need to be renewed.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-and-retry\u0022\u003EAutomatic Refresh and Retry\u003C/h3\u003E\n\u003Cp\u003EThe current Resource Client does not automatically refresh authentication and retry a request after receiving a \u003Ccode\u003E401\u003C/code\u003E response.\u003C/p\u003E\n\u003Cp\u003EThis behavior is intentionally outside the initial Resource API implementation.\u003C/p\u003E\n\u003Cp\u003EApplications should not assume that an unsuccessful request has been retried.\u003C/p\u003E\n\u003Cp\u003EAuthentication renewal and retry policies require careful handling, particularly for requests that modify application state.\u003C/p\u003E\n\u003Cp\u003EFuture improvements may provide additional coordination between resource requests and authentication lifecycle management.\u003C/p\u003E\n\u003Cp\u003EUntil then, applications should handle unauthorized responses according to their authentication flow and UI requirements.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022organizing-application-resource-services\u0022\u003E12. Organizing Application Resource Services\u003C/h2\u003E\n\u003Cp\u003EAlthough Resource Client operations can be called directly from components, larger applications often benefit from small, domain-specific services.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\nusing CodeBeam.UltimateAuth.Core.Contracts;\n\npublic sealed class ProductApiService(IUAuthClient client)\n{\n public Task\u0026lt;UAuthResult\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;\u0026gt; GetAllAsync()\n =\u0026gt; client.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; GetAsync(int id)\n =\u0026gt; client.Resource.GetAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{id}\u0026quot;);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; CreateAsync(Product product)\n =\u0026gt; client.Resource.PostAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products\u0026quot;, product);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; UpdateAsync(int id, Product product)\n =\u0026gt; client.Resource.PutAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{id}\u0026quot;, product);\n\n public Task\u0026lt;UAuthResult\u0026gt; DeleteAsync(int id)\n =\u0026gt; client.Resource.DeleteAsync($\u0026quot;/api/products/{id}\u0026quot;);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis approach keeps application-specific endpoints and operations in one place.\u003C/p\u003E\n\u003Cp\u003EThe service does not need to implement:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EA custom HTTP transport.\u003C/li\u003E\n\u003Cli\u003EBrowser credential handling.\u003C/li\u003E\n\u003Cli\u003EDevice metadata propagation.\u003C/li\u003E\n\u003Cli\u003EJSON response deserialization.\u003C/li\u003E\n\u003Cli\u003EA separate response wrapper.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThose responsibilities remain with UltimateAuth.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022keep-the-standard-result\u0022\u003EKeep the Standard Result\u003C/h3\u003E\n\u003Cp\u003ENotice that \u003Ccode\u003EProductApiService\u003C/code\u003E returns \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E directly.\u003C/p\u003E\n\u003Cp\u003EThere is no need to create another response type merely to wrap the same status, value, and problem information.\u003C/p\u003E\n\u003Cp\u003EThis keeps the application aligned with the UltimateAuth SDK.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-services-still-own-business-logic\u0022\u003EApplication Services Still Own Business Logic\u003C/h3\u003E\n\u003Cp\u003EThe Resource Client does not attempt to understand application-specific business rules.\u003C/p\u003E\n\u003Cp\u003EA \u003Ccode\u003EProductApiService\u003C/code\u003E can organize product-related operations, but the Resource API remains responsible for validating product data, enforcing ownership, and authorizing changes.\u003C/p\u003E\n\u003Cp\u003EThis separation keeps UltimateAuth focused on the infrastructure it can provide consistently.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022design-philosophy\u0022\u003E13. Design Philosophy\u003C/h2\u003E\n\u003Cp\u003EThe Resource Client follows the same principle as the rest of UltimateAuth:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EComplexity should be handled by the framework when it is common, predictable, and independent of application business logic.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EDevelopers should not need to repeatedly solve browser transport, credential configuration, device metadata, and response handling simply because their application has its own API.\u003C/p\u003E\n\u003Cp\u003EAt the same time, a framework should not hide important security boundaries or take ownership of application-specific decisions.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth therefore provides:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EA unified client entry point.\u003C/li\u003E\n\u003Cli\u003EFamiliar HTTP operations.\u003C/li\u003E\n\u003Cli\u003EConsistent result contracts.\u003C/li\u003E\n\u003Cli\u003EConfigurable resource origins and credential policies.\u003C/li\u003E\n\u003Cli\u003EBrowser-aware transport behavior.\u003C/li\u003E\n\u003Cli\u003EExplicit server-side security responsibilities.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe result is a simpler developer experience without requiring applications to abandon their existing architecture.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E// Authentication\nawait UAuthClient.Flows.RefreshAsync();\n\n// Identity\nvar user = await UAuthClient.Users.GetMeAsync();\n\n// Sessions\nvar sessions = await UAuthClient.Sessions.GetMyChainsAsync(\n new PageRequest\n {\n PageNumber = 1,\n PageSize = 10\n });\n\n// Application resources\nvar products = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDifferent responsibilities. One consistent client model.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth does not stop at authentication. It helps applications use authentication without rebuilding the integration layer around it.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022related-documentation\u0022\u003ERelated Documentation\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client-sdk/overview\u0022\u003EClient SDK Overview\u003C/a\u003E \u2014 Understand the unified client architecture.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure application profiles, authentication endpoints, and resource options.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client-sdk/authentication\u0022\u003EAuthentication\u003C/a\u003E \u2014 Work with authentication flows and session renewal.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/application-profiles\u0022\u003EApplication Profiles\u003C/a\u003E \u2014 Understand runtime-specific authentication behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/getting-started/real-world-setup\u0022\u003EReal-World Setup\u003C/a\u003E \u2014 Configure Blazor applications, UAuthHub, and separate Resource APIs.\u003C/li\u003E\n\u003C/ul\u003E\n", + "Html": "\n\u003Cp\u003E\u003Cstrong\u003EAuthenticate once. Access your application resources through the same unified client.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAuthentication is only the beginning of an application.\u003C/p\u003E\n\u003Cp\u003EOnce a user signs in, the application still needs to retrieve data, create records, update resources, and communicate with protected APIs.\u003C/p\u003E\n\u003Cp\u003ETraditionally, this introduces another layer of integration work.\u003C/p\u003E\n\u003Cp\u003EDevelopers configure authentication through one library, then build a separate HTTP client to access their application APIs. They must handle credentials, browser restrictions, response parsing, errors, and differences between hosting environments.\u003C/p\u003E\n\u003Cp\u003EThe result is often two separate programming models: one for authentication and another for everything that comes after it.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth brings these operations together through \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EInstead of introducing another client abstraction, applications can use the same UltimateAuth entry point for authentication, identity management, and protected resource requests.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource\n .GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENo custom JavaScript wrapper. No application-specific response type. No separate HTTP client configuration for ordinary authenticated resource requests.\u003C/p\u003E\n\u003Cp\u003EThe goal is straightforward: \u003Cstrong\u003Emake accessing protected application resources feel like a natural continuation of authentication.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022the-problem-authentication-ends-integration-work-begins\u0022\u003E1. The Problem: Authentication Ends, Integration Work Begins\u003C/h2\u003E\n\u003Cp\u003EConsider a typical application with three components:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Application\n |\n \u002B----\u0026gt; UAuthHub\n | Authentication\n | Sessions\n | Identity\n |\n \u002B----\u0026gt; Resource API\n Products\n Orders\n Application Data\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUltimateAuth handles authentication and identity operations.\u003C/p\u003E\n\u003Cp\u003EBut the application also needs to communicate with its Resource API.\u003C/p\u003E\n\u003Cp\u003EWithout a unified resource client, developers typically need to:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EConfigure an additional HTTP client.\u003C/li\u003E\n\u003Cli\u003EDetermine how authentication credentials should accompany requests.\u003C/li\u003E\n\u003Cli\u003EHandle browser credential policies and cross-origin restrictions.\u003C/li\u003E\n\u003Cli\u003EMaintain device and application profile metadata where applicable.\u003C/li\u003E\n\u003Cli\u003EDeserialize successful responses.\u003C/li\u003E\n\u003Cli\u003ETranslate unsuccessful HTTP responses into application-friendly results.\u003C/li\u003E\n\u003Cli\u003EImplement similar request handling across multiple components.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThese responsibilities are not necessarily complicated individually.\u003C/p\u003E\n\u003Cp\u003EThe problem is their repetition.\u003C/p\u003E\n\u003Cp\u003EA framework that simplifies authentication should not require developers to rebuild the surrounding integration layer every time they need application data.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-unified-client-model\u0022\u003EA Unified Client Model\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth already exposes specialized operations through \u003Ccode\u003EIUAuthClient\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClient.Flows\nUAuthClient.Users\nUAuthClient.Sessions\nUAuthClient.Credentials\nUAuthClient.Authorization\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResource requests follow the same model:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClient.Resource\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis preserves a consistent entry point without mixing application-specific business operations into UltimateAuth\u0027s authentication services.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth does not need to know what a \u003Ccode\u003EProduct\u003C/code\u003E, \u003Ccode\u003EOrder\u003C/code\u003E, or \u003Ccode\u003EInvoice\u003C/code\u003E represents.\u003C/p\u003E\n\u003Cp\u003EIt only needs to provide a predictable way to communicate with the API that owns those resources.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022getting-started\u0022\u003E2. Getting Started\u003C/h2\u003E\n\u003Cp\u003EThe Resource API client is available through the UltimateAuth Client SDK.\u003C/p\u003E\n\u003Cp\u003EFor Blazor applications, register the Blazor client integration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe registration includes the shared client services and the browser-specific resource transport.\u003C/p\u003E\n\u003Cp\u003EYou do not need to register a separate Resource Client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inject-iuauthclient\u0022\u003EInject IUAuthClient\u003C/h3\u003E\n\u003Cp\u003EIn a Blazor component:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen call a protected application endpoint:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is not null)\n{\n products = result.Value;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe response uses the same structured result model found throughout UltimateAuth.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-happens-behind-the-call\u0022\u003EWhat Happens Behind the Call?\u003C/h3\u003E\n\u003Cp\u003EFor the Blazor integration, the request follows this path:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Component\n |\n v\nIUAuthClient.Resource\n |\n v\nResource Client\n |\n v\nUltimateAuth Browser Transport\n |\n v\nProtected Resource API\n |\n v\nUAuthResult\u0026lt;T\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe browser transport handles request construction and browser-specific behavior.\u003C/p\u003E\n\u003Cp\u003EThe Resource API remains responsible for validating authentication and enforcing authorization.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EA successful client request does not bypass server-side security.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022supported-http-operations\u0022\u003E3. Supported HTTP Operations\u003C/h2\u003E\n\u003Cp\u003EThe Resource Client provides five standard HTTP operations.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMethod\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003Cth\u003EReturn type\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EGetAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERetrieve a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPostAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECreate or submit a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPutAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReplace or update a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPatchAsync\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPartially update a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeleteAsync\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDelete a resource\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthResult\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EAll methods accept a relative endpoint and support cancellation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022get\u0022\u003EGET\u003C/h3\u003E\n\u003Cp\u003ERetrieve application data:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is not null)\n{\n products = result.Value;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERetrieve a single resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{productId}\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022post\u0022\u003EPOST\u003C/h3\u003E\n\u003Cp\u003ESubmit a new resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar product = new Product\n{\n Name = \u0026quot;Example Product\u0026quot;,\n Price = 29.99m\n};\n\nvar result = await UAuthClient.Resource.PostAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products\u0026quot;, product);\n\nif (result.IsSuccess)\n{\n // Product created successfully.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe request payload is serialized for transport.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022put\u0022\u003EPUT\u003C/h3\u003E\n\u003Cp\u003EUpdate a resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource\n .PutAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{product.Id}\u0026quot;, product);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022patch\u0022\u003EPATCH\u003C/h3\u003E\n\u003Cp\u003ESubmit a partial update:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar changes = new\n{\n Price = 24.99m\n};\n\nvar result = await UAuthClient.Resource\n .PatchAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{productId}\u0026quot;, changes);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client sends the request payload.\u003C/p\u003E\n\u003Cp\u003EThe receiving API determines which partial-update formats and operations it supports.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022delete\u0022\u003EDELETE\u003C/h3\u003E\n\u003Cp\u003EDelete a resource:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.DeleteAsync($\u0026quot;/api/products/{productId}\u0026quot;);\n\nif (result.IsSuccess)\n{\n // Resource deleted successfully.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUnlike the other methods, \u003Ccode\u003EDeleteAsync\u003C/code\u003E returns the non-generic \u003Ccode\u003EUAuthResult\u003C/code\u003E because the operation does not require a response value.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022consistent-results-with-uauthresult\u0022\u003E4. Consistent Results with UAuthResult\u003C/h2\u003E\n\u003Cp\u003EA common source of unnecessary complexity is response handling.\u003C/p\u003E\n\u003Cp\u003EOne API client returns \u003Ccode\u003EHttpResponseMessage\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EAnother returns a custom response wrapper.\u003C/p\u003E\n\u003Cp\u003EA third throws exceptions for ordinary HTTP failures.\u003C/p\u003E\n\u003Cp\u003EApplications then need different handling logic for operations that are conceptually similar.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth uses \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E to provide a consistent response contract.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products/42\u0026quot;);\n\nif (result.IsSuccess)\n{\n var product = result.Value;\n}\nelse\n{\n var status = result.Status;\n var problem = result.Problem;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022result-properties\u0022\u003EResult Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIsSuccess\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIndicates whether the HTTP operation succeeded\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EStatus\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHTTP response status code\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDeserialized response value for successful generic operations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EProblem\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EStructured problem information when available\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EA failed HTTP response does not automatically mean a transport exception.\u003C/p\u003E\n\u003Cp\u003EFor example, an API may return:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003E400 Bad Request\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E401 Unauthorized\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E403 Forbidden\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E404 Not Found\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003E409 Conflict\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese responses can be represented through \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe application can inspect the status and decide how to respond.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022structured-problems\u0022\u003EStructured Problems\u003C/h3\u003E\n\u003Cp\u003EWhen an unsuccessful response contains a compatible UltimateAuth problem payload, the Resource Client attempts to deserialize it into \u003Ccode\u003EUAuthProblem\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eif (!result.IsSuccess)\n{\n if (result.Problem is not null)\n {\n // Handle the structured API problem.\n }\n else\n {\n // Handle the HTTP status without a structured problem.\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENot every API returns a compatible problem body.\u003C/p\u003E\n\u003Cp\u003ETherefore, \u003Ccode\u003EProblem\u003C/code\u003E may be \u003Ccode\u003Enull\u003C/code\u003E even when the request failed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022transport-failures-are-different\u0022\u003ETransport Failures Are Different\u003C/h3\u003E\n\u003Cp\u003ENetwork failures, protocol errors, and request cancellation are different from ordinary unsuccessful HTTP responses.\u003C/p\u003E\n\u003Cp\u003EFor example, an unreachable API does not necessarily produce an HTTP status code.\u003C/p\u003E\n\u003Cp\u003EApplications should distinguish transport exceptions from valid HTTP responses indicating failure.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003E\u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E standardizes HTTP response handling; it does not guarantee that every network or runtime failure becomes a result object.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-configuration\u0022\u003E5. Resource API Configuration\u003C/h2\u003E\n\u003Cp\u003EResource API configuration is part of \u003Ccode\u003EUAuthClientOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe \u003Ccode\u003EResource\u003C/code\u003E options are separate from the authentication endpoint configuration.\u003C/p\u003E\n\u003Cp\u003EThis distinction allows applications to authenticate against one server while accessing resources hosted elsewhere.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022baseaddress\u0022\u003EBaseAddress\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EBaseAddress\u003C/code\u003E identifies the Resource API origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIf \u003Ccode\u003EBaseAddress\u003C/code\u003E is not configured, requests use the application\u0027s current origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA call such as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Ethen targets the application\u0027s origin.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022baseaddress-validation\u0022\u003EBaseAddress Validation\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth validates the configured Resource API address.\u003C/p\u003E\n\u003Cp\u003EThe address must:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBe an absolute HTTP or HTTPS URL.\u003C/li\u003E\n\u003Cli\u003EUse HTTPS, except for loopback development addresses.\u003C/li\u003E\n\u003Cli\u003ERepresent an origin without an additional path.\u003C/li\u003E\n\u003Cli\u003EExclude embedded credentials, query strings, and fragments.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EValid examples:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Ehttps://api.example.com\nhttps://localhost:7001\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EInvalid examples:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Ehttps://api.example.com/api\nhttps://api.example.com?version=1\nhttp://api.example.com\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EKeep endpoint paths in individual Resource Client calls:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis separates deployment configuration from application resource paths.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-credential-handling\u0022\u003E6. Browser Credential Handling\u003C/h2\u003E\n\u003Cp\u003EBrowser-based applications do not have unrestricted control over authentication credentials.\u003C/p\u003E\n\u003Cp\u003ECookies, origins, cross-origin requests, and browser security policies all influence how requests are sent.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth exposes credential handling through \u003Ccode\u003EUAuthResourceCredentialsMode\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELet UltimateAuth select the appropriate browser credential policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESameOrigin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESend browser credentials only for same-origin requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EInclude\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude browser credentials for the configured Resource API origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOmit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDo not send browser credentials\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022same-origin-resource-api\u0022\u003ESame-Origin Resource API\u003C/h3\u003E\n\u003Cp\u003EWhen the application and Resource API share an origin:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Ehttps://app.example.com\nhttps://app.example.com/api/products\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Eyou can use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.SameOrigin;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is appropriate when the Resource API relies on browser credentials available to the application origin.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022separate-resource-api\u0022\u003ESeparate Resource API\u003C/h3\u003E\n\u003Cp\u003EConsider:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EApplication: https://app.example.com\nResource API: https://api.example.com\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor a cross-origin API that requires browser cookies, configure:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Include;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe receiving API must also support the relevant browser security requirements.\u003C/p\u003E\n\u003Cp\u003EFor credentialed cross-origin requests, this typically includes:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EExplicitly permitted origins.\u003C/li\u003E\n\u003Cli\u003EAppropriate CORS configuration.\u003C/li\u003E\n\u003Cli\u003ECompatible cookie attributes and browser policies.\u003C/li\u003E\n\u003Cli\u003EServer-side authentication and authorization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EConfiguring \u003Ccode\u003EInclude\u003C/code\u003E does not override browser restrictions or guarantee that a cookie is available for the destination.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022when-to-use-omit\u0022\u003EWhen to Use Omit\u003C/h3\u003E\n\u003Cp\u003ESome resource endpoints do not require browser cookies.\u003C/p\u003E\n\u003Cp\u003EFor those cases:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.Omit;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis prevents browser credentials from being included in the resource request.\u003C/p\u003E\n\u003Cp\u003EThe API must still enforce whichever authentication mechanism it requires.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECredential transmission is not the same as authorization.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022separate-uauthhub-and-resource-api\u0022\u003E7. Separate UAuthHub and Resource API\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports architectures where authentication and application resources are hosted independently.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Blazor Application\n |\n \u002B------------\u002B------------\u002B\n | |\n v v\n UAuthHub Resource API\n auth.example.com api.example.com\n | |\n v v\n Authentication Application Data\n Sessions Business Operations\n Identity Authorization\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client can configure both destinations independently:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAuthentication operations use the configured authentication endpoints.\u003C/p\u003E\n\u003Cp\u003EResource operations use the configured Resource API origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar profile = await UAuthClient.Users.GetMeAsync();\n\nvar products = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EBoth operations are accessed through \u003Ccode\u003EIUAuthClient\u003C/code\u003E, but they serve different purposes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-does-not-automatically-protect-an-api\u0022\u003EAuthentication Does Not Automatically Protect an API\u003C/h3\u003E\n\u003Cp\u003EConfiguring a Resource API address does not automatically enable authentication or authorization on that API.\u003C/p\u003E\n\u003Cp\u003EThe Resource API must independently validate incoming requests and enforce its access rules.\u003C/p\u003E\n\u003Cp\u003EFor separate deployments, the Resource API must also be configured to accept and validate the authentication material associated with the selected UltimateAuth authentication mode.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client simplifies communication.\u003C/p\u003E\n\u003Cp\u003EIt does not replace the receiving server\u0027s security responsibilities.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-mode-compatibility\u0022\u003EAuthentication Mode Compatibility\u003C/h3\u003E\n\u003Cp\u003EUAuthHub and Resource APIs are configured independently.\u003C/p\u003E\n\u003Cp\u003EUAuthHub determines which authentication credentials are issued to a client. A Resource API determines which credentials it accepts and how they are validated.\u003C/p\u003E\n\u003Cp\u003EUsing the same UltimateAuth infrastructure does not automatically make all authentication modes interchangeable.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EClient Credential\u003C/th\u003E\n\u003Cth\u003EResource API Validation\u003C/th\u003E\n\u003Cth\u003ECurrent Support\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureOpaque session\u003C/td\u003E\n\u003Ctd\u003ERemote session validation\u003C/td\u003E\n\u003Ctd\u003ESupported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureJwt access token\u003C/td\u003E\n\u003Ctd\u003ELocal JWT validation\u003C/td\u003E\n\u003Ctd\u003ESupported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid session credential\u003C/td\u003E\n\u003Ctd\u003ERemote session validation\u003C/td\u003E\n\u003Ctd\u003ESupported when correctly configured\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid JWT access token\u003C/td\u003E\n\u003Ctd\u003EHybrid-aware JWT validation\u003C/td\u003E\n\u003Ctd\u003ENot yet implemented\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureOpaque session\u003C/td\u003E\n\u003Ctd\u003EPureJwt-only validation\u003C/td\u003E\n\u003Ctd\u003ENot supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EA PureJwt Resource API cannot authenticate an opaque session credential as a JWT.\u003C/p\u003E\n\u003Cp\u003ELikewise, configuring a Resource API URL in the client SDK does not automatically exchange session credentials for JWT access tokens.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery\u0022\u003ECredential Delivery\u003C/h3\u003E\n\u003Cp\u003EThe client and Resource API must agree on the credential used for authentication and its transport.\u003C/p\u003E\n\u003Ch4 id=\u0022session-based-resource-apis\u0022\u003ESession-based Resource APIs\u003C/h4\u003E\n\u003Cp\u003EPureOpaque and Hybrid Resource APIs use opaque session credentials.\u003C/p\u003E\n\u003Cp\u003ECookie delivery is the default for incoming session credentials.\u003C/p\u003E\n\u003Cp\u003EThe Resource API validates the selected session through UAuthHub using the configured Hub address.\u003C/p\u003E\n\u003Cp\u003EThe browser must be able to send the session cookie to the Resource API.\u003C/p\u003E\n\u003Ch4 id=\u0022jwt-based-resource-apis\u0022\u003EJWT-based Resource APIs\u003C/h4\u003E\n\u003Cp\u003EPureJwt Resource APIs use JWT access tokens.\u003C/p\u003E\n\u003Cp\u003EThe default Blazor Resource Client attaches the current access token using:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EHTTP\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-http\u0022\u003EAuthorization: Bearer \u0026lt;access-token\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor a Resource API that exclusively uses header-based JWT authentication, browser cookies can be omitted:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.Omit;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EOmitting browser cookies does not prevent the client from attaching its access-token authorization header.\u003C/p\u003E\n\u003Cp\u003EThis option affects Resource API requests, not authentication or refresh requests sent to UAuthHub.\u003C/p\u003E\n\u003Ch4 id=\u0022credential-compatibility\u0022\u003ECredential compatibility\u003C/h4\u003E\n\u003Cp\u003EA JWT issued in Hybrid mode is not interchangeable with a PureJwt access token.\u003C/p\u003E\n\u003Cp\u003EHybrid-aware JWT validation in separate Resource APIs is not currently implemented.\u003C/p\u003E\n\u003Cp\u003EAuthentication mode selection and credential compatibility remain explicit configuration responsibilities.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-and-uauthhub-connectivity\u0022\u003EPureJwt and UAuthHub Connectivity\u003C/h3\u003E\n\u003Cp\u003EA PureJwt Resource API does not need to contact UAuthHub to validate each JWT.\u003C/p\u003E\n\u003Cp\u003EHowever, clients still use UAuthHub for login, refresh, and logout operations.\u003C/p\u003E\n\u003Cp\u003EThis separation allows protected APIs to validate access tokens independently while the authentication authority manages refresh-token state.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022device-and-application-profile-metadata\u0022\u003E8. Device and Application Profile Metadata\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth maintains a distinction between user identity, device identity, and client environment.\u003C/p\u003E\n\u003Cp\u003EFor browser resource requests, the transport can propagate UltimateAuth metadata, including:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EX-UDID\nX-UAuth-ApplicationProfile\nX-Requested-With\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis keeps resource requests consistent with the UltimateAuth application environment without requiring every application component to construct these headers manually.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Edoes not require the developer to manually retrieve and attach the device identifier.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022metadata-is-not-proof-of-identity\u0022\u003EMetadata Is Not Proof of Identity\u003C/h3\u003E\n\u003Cp\u003EDevice identifiers and application profile values describe request context.\u003C/p\u003E\n\u003Cp\u003EThey are not independent authentication credentials.\u003C/p\u003E\n\u003Cp\u003EA receiving API must not grant access solely because a request declares a particular device identifier or application profile.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for validating the user\u0027s authentication state and permissions.\u003C/p\u003E\n\u003Cp\u003EFor more information, see \u003Ca href=\u0022/docs/fundamentals/application-profiles\u0022\u003EApplication Profiles\u003C/a\u003E.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-transport-and-security\u0022\u003E9. Browser Transport and Security\u003C/h2\u003E\n\u003Cp\u003EThe Blazor Resource Client uses UltimateAuth\u0027s browser transport.\u003C/p\u003E\n\u003Cp\u003EThis allows UltimateAuth to apply consistent request behavior without requiring developers to write a separate JavaScript module for their application.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022origin-validation\u0022\u003EOrigin Validation\u003C/h3\u003E\n\u003Cp\u003EResource requests are constrained by the configured Resource API origin.\u003C/p\u003E\n\u003Cp\u003EThe transport validates request destinations rather than allowing arbitrary URLs to bypass the configured resource boundary.\u003C/p\u003E\n\u003Cp\u003EThis helps prevent application code from unintentionally sending credentials or UltimateAuth request metadata to unrelated destinations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022redirect-protection\u0022\u003ERedirect Protection\u003C/h3\u003E\n\u003Cp\u003EResource requests use redirect protection.\u003C/p\u003E\n\u003Cp\u003EA request should not silently follow a redirect to an unexpected destination while carrying authentication-related context.\u003C/p\u003E\n\u003Cp\u003EApplications should handle unexpected redirects as transport failures rather than assuming the request succeeded.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022request-cancellation\u0022\u003ERequest Cancellation\u003C/h3\u003E\n\u003Cp\u003EResource operations support \u003Ccode\u003ECancellationToken\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));\n\nvar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;, cts.Token);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Blazor transport coordinates cancellation with the underlying browser request.\u003C/p\u003E\n\u003Cp\u003ECancellation is particularly useful when a user navigates away from a page or starts another operation before the previous request completes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-security-still-applies\u0022\u003EBrowser Security Still Applies\u003C/h3\u003E\n\u003Cp\u003EThe Resource Client does not disable browser security mechanisms.\u003C/p\u003E\n\u003Cp\u003ECross-origin requests remain subject to CORS and browser credential policies.\u003C/p\u003E\n\u003Cp\u003ELikewise, origin validation and redirect protection do not replace:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication validation.\u003C/li\u003E\n\u003Cli\u003EAuthorization policies.\u003C/li\u003E\n\u003Cli\u003ECSRF protection where applicable.\u003C/li\u003E\n\u003Cli\u003EInput validation.\u003C/li\u003E\n\u003Cli\u003EServer-side resource ownership checks.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese responsibilities remain part of the receiving API\u0027s security model.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-vs.blazor-webassembly\u0022\u003E10. Blazor Server vs. Blazor WebAssembly\u003C/h2\u003E\n\u003Cp\u003EOne of UltimateAuth\u0027s design goals is to provide a consistent client API across supported application environments.\u003C/p\u003E\n\u003Cp\u003EHowever, different hosting models have different execution characteristics.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-webassembly\u0022\u003EBlazor WebAssembly\u003C/h3\u003E\n\u003Cp\u003EBlazor WebAssembly executes application code in the browser.\u003C/p\u003E\n\u003Cp\u003EIt cannot directly invoke server-side application services or access a server database.\u003C/p\u003E\n\u003Cp\u003EA typical application architecture is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor WebAssembly\n |\n v\nIUAuthClient.Resource\n |\n v\nResource API\n |\n v\nApplication Services\n |\n v\nDatabase\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client provides a natural way to access protected application data from this environment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server\u0022\u003EBlazor Server\u003C/h3\u003E\n\u003Cp\u003EBlazor Server executes component logic on the server.\u003C/p\u003E\n\u003Cp\u003EWhen the application service is available in the same process, a direct service call is often more appropriate.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Server Component\n |\n v\nApplication Service\n |\n v\nDatabase\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar products = await productService.GetAllAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThere is no requirement to introduce an HTTP request simply to use the Resource Client.\u003C/p\u003E\n\u003Cp\u003EHowever, when a Blazor Server application needs to communicate with a separate protected Resource API, it can use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E The current Blazor Resource Client uses browser-based transport, including in Blazor Server applications.\u003C/p\u003E\n\u003Cp\u003EThe HTTP request is initiated by the user\u0027s browser, not by a server-side \u003Ccode\u003EHttpClient\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor server-to-server communication, use an appropriate server-side HTTP integration and authentication mechanism.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022the-same-client-api-different-application-architectures\u0022\u003EThe Same Client API, Different Application Architectures\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth aims to make client integration consistent without forcing every application into the same deployment model.\u003C/p\u003E\n\u003Cp\u003EThe goal is not to replace direct application service calls.\u003C/p\u003E\n\u003Cp\u003EThe goal is to remove unnecessary integration work whenever an HTTP resource request is actually needed.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022handling-unauthorized-responses\u0022\u003E11. Handling Unauthorized Responses\u003C/h2\u003E\n\u003Cp\u003EAn authenticated session may expire or become invalid while an application is running.\u003C/p\u003E\n\u003Cp\u003EWhen a Resource API returns \u003Ccode\u003E401 Unauthorized\u003C/code\u003E, the Resource Client exposes the unsuccessful HTTP response through its standard result contract.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (!result.IsSuccess \u0026amp;\u0026amp; result.Status == 401)\n{\n // Authentication may need to be renewed.\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-and-retry\u0022\u003EAutomatic Refresh and Retry\u003C/h3\u003E\n\u003Cp\u003EThe current Resource Client does not automatically refresh authentication and retry a request after receiving a \u003Ccode\u003E401\u003C/code\u003E response.\u003C/p\u003E\n\u003Cp\u003EThis behavior is intentionally outside the initial Resource API implementation.\u003C/p\u003E\n\u003Cp\u003EApplications should not assume that an unsuccessful request has been retried.\u003C/p\u003E\n\u003Cp\u003EAuthentication renewal and retry policies require careful handling, particularly for requests that modify application state.\u003C/p\u003E\n\u003Cp\u003EFuture improvements may provide additional coordination between resource requests and authentication lifecycle management.\u003C/p\u003E\n\u003Cp\u003EUntil then, applications should handle unauthorized responses according to their authentication flow and UI requirements.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022organizing-application-resource-services\u0022\u003E12. Organizing Application Resource Services\u003C/h2\u003E\n\u003Cp\u003EAlthough Resource Client operations can be called directly from components, larger applications often benefit from small, domain-specific services.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\nusing CodeBeam.UltimateAuth.Core.Contracts;\n\npublic sealed class ProductApiService(IUAuthClient client)\n{\n public Task\u0026lt;UAuthResult\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;\u0026gt; GetAllAsync()\n =\u0026gt; client.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; GetAsync(int id)\n =\u0026gt; client.Resource.GetAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{id}\u0026quot;);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; CreateAsync(Product product)\n =\u0026gt; client.Resource.PostAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products\u0026quot;, product);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; UpdateAsync(int id, Product product)\n =\u0026gt; client.Resource.PutAsync\u0026lt;Product\u0026gt;($\u0026quot;/api/products/{id}\u0026quot;, product);\n\n public Task\u0026lt;UAuthResult\u0026gt; DeleteAsync(int id)\n =\u0026gt; client.Resource.DeleteAsync($\u0026quot;/api/products/{id}\u0026quot;);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis approach keeps application-specific endpoints and operations in one place.\u003C/p\u003E\n\u003Cp\u003EThe service does not need to implement:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EA custom HTTP transport.\u003C/li\u003E\n\u003Cli\u003EBrowser credential handling.\u003C/li\u003E\n\u003Cli\u003EDevice metadata propagation.\u003C/li\u003E\n\u003Cli\u003EJSON response deserialization.\u003C/li\u003E\n\u003Cli\u003EA separate response wrapper.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThose responsibilities remain with UltimateAuth.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022keep-the-standard-result\u0022\u003EKeep the Standard Result\u003C/h3\u003E\n\u003Cp\u003ENotice that \u003Ccode\u003EProductApiService\u003C/code\u003E returns \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E directly.\u003C/p\u003E\n\u003Cp\u003EThere is no need to create another response type merely to wrap the same status, value, and problem information.\u003C/p\u003E\n\u003Cp\u003EThis keeps the application aligned with the UltimateAuth SDK.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-services-still-own-business-logic\u0022\u003EApplication Services Still Own Business Logic\u003C/h3\u003E\n\u003Cp\u003EThe Resource Client does not attempt to understand application-specific business rules.\u003C/p\u003E\n\u003Cp\u003EA \u003Ccode\u003EProductApiService\u003C/code\u003E can organize product-related operations, but the Resource API remains responsible for validating product data, enforcing ownership, and authorizing changes.\u003C/p\u003E\n\u003Cp\u003EThis separation keeps UltimateAuth focused on the infrastructure it can provide consistently.\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022design-philosophy\u0022\u003E13. Design Philosophy\u003C/h2\u003E\n\u003Cp\u003EThe Resource Client follows the same principle as the rest of UltimateAuth:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EComplexity should be handled by the framework when it is common, predictable, and independent of application business logic.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EDevelopers should not need to repeatedly solve browser transport, credential configuration, device metadata, and response handling simply because their application has its own API.\u003C/p\u003E\n\u003Cp\u003EAt the same time, a framework should not hide important security boundaries or take ownership of application-specific decisions.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth therefore provides:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EA unified client entry point.\u003C/li\u003E\n\u003Cli\u003EFamiliar HTTP operations.\u003C/li\u003E\n\u003Cli\u003EConsistent result contracts.\u003C/li\u003E\n\u003Cli\u003EConfigurable resource origins and credential policies.\u003C/li\u003E\n\u003Cli\u003EBrowser-aware transport behavior.\u003C/li\u003E\n\u003Cli\u003EExplicit server-side security responsibilities.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe result is a simpler developer experience without requiring applications to abandon their existing architecture.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E// Authentication\nawait UAuthClient.Flows.RefreshAsync();\n\n// Identity\nvar user = await UAuthClient.Users.GetMeAsync();\n\n// Sessions\nvar sessions = await UAuthClient.Sessions.GetMyChainsAsync(\n new PageRequest\n {\n PageNumber = 1,\n PageSize = 10\n });\n\n// Application resources\nvar products = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDifferent responsibilities. One consistent client model.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth does not stop at authentication. It helps applications use authentication without rebuilding the integration layer around it.\u003C/strong\u003E\u003C/p\u003E\n\u003Chr\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022related-documentation\u0022\u003ERelated Documentation\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client-sdk/overview\u0022\u003EClient SDK Overview\u003C/a\u003E \u2014 Understand the unified client architecture.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure application profiles, authentication endpoints, and resource options.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client-sdk/authentication\u0022\u003EAuthentication\u003C/a\u003E \u2014 Work with authentication flows and session renewal.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/application-profiles\u0022\u003EApplication Profiles\u003C/a\u003E \u2014 Understand runtime-specific authentication behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/getting-started/real-world-setup\u0022\u003EReal-World Setup\u003C/a\u003E \u2014 Configure Blazor applications, UAuthHub, and separate Resource APIs.\u003C/li\u003E\n\u003C/ul\u003E\n", "Headings": [ { "Id": "the-problem-authentication-ends-integration-work-begins", @@ -229,6 +229,6 @@ "Level": 0 } ], - "SourceHash": "0ECD3DDDBD48AC37F3DB7D1EFC072463972F3373DF5C1F8589412E3BFF276A27", + "SourceHash": "E8CF8E1910155437F76F1463EAD34E2887C402EE836B582E4EA2834CE0AE5A30", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/advanced-configuration.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/advanced-configuration.json index 4eadfbaa..3302bc99 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/advanced-configuration.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/advanced-configuration.json @@ -1,7 +1,7 @@ { "Slug": "configuration/advanced-configuration", "Title": "Advanced Configuration", - "Html": "\n\u003Cp\u003EUltimateAuth supports advanced customization of authentication behavior through effective server options, authentication mode resolution, dependency injection, custom infrastructure, and lifecycle events.\u003C/p\u003E\n\u003Cp\u003EThese mechanisms serve different purposes:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EOptions\u003C/strong\u003E define configurable behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EEffective options\u003C/strong\u003E adapt that behavior to the selected authentication mode.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EResolvers\u003C/strong\u003E determine information required by authentication flows.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EAuthorities and validators\u003C/strong\u003E participate in security decisions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EStores\u003C/strong\u003E persist authentication and application state.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EEvents\u003C/strong\u003E allow applications to react to completed operations.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EMost applications should begin with the standard Server and Client options. Advanced customization becomes useful when an application needs specialized authentication behavior, custom infrastructure, or integration with existing systems.\u003C/p\u003E\n\u003Cp\u003EThis guide explains the supported extension mechanisms, their execution order, and the security boundaries developers must preserve.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-versus-extensibility\u0022\u003E1. Configuration Versus Extensibility\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth distinguishes between configuring existing behavior and replacing an implementation.\u003C/p\u003E\n\u003Cp\u003EFor example, changing a session lifetime is configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromHours(8);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EProviding a custom clock is an infrastructure extension:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;IClock, ApplicationClock\u0026gt;();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EApplicationClock\u003C/code\u003E is an implementation supplied by your application.\u003C/p\u003E\n\u003Cp\u003EThese approaches are not interchangeable.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ERequirement\u003C/th\u003E\n\u003Cth\u003ERecommended mechanism\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EChange session lifetime\u003C/td\u003E\n\u003Ctd\u003EServer options\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EChange token lifetime for a specific mode\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESelect authentication mode differently\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EResolve tenants from a custom source\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EITenantIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECustomize login decisions\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EILoginAuthority\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESupply signing keys\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIJwtSigningKeyProvider\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPersist sessions in another backend\u003C/td\u003E\n\u003Ctd\u003EStore implementation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EReact to successful login\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthEvents\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAdd application-specific access rules\u003C/td\u003E\n\u003Ctd\u003EPolicies\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EPrefer the most specific supported mechanism rather than replacing an entire authentication component.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022understanding-effective-server-options\u0022\u003E2. Understanding Effective Server Options\u003C/h2\u003E\n\u003Cp\u003EThe server does not necessarily use the original \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E instance unchanged for every authentication flow.\u003C/p\u003E\n\u003Cp\u003EInstead, UltimateAuth can resolve an effective configuration based on the application profile and authentication mode.\u003C/p\u003E\n\u003Cp\u003EThe relevant types are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIEffectiveServerOptionsProvider\nEffectiveUAuthServerOptions\nIEffectiveAuthModeResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configured-options\u0022\u003EConfigured Options\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E represents the application\u0027s configured server settings.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromHours(8);\n options.Token.Issuer = \u0026quot;MyApplication\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings form the base configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022effective-options\u0022\u003EEffective Options\u003C/h3\u003E\n\u003Cp\u003EThe provider produces an \u003Ccode\u003EEffectiveUAuthServerOptions\u003C/code\u003E instance containing:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed class EffectiveUAuthServerOptions\n{\n public UAuthMode Mode { get; init; }\n public UAuthServerOptions Options { get; init; } = default!;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EMode\u003C/code\u003E identifies the resolved authentication mode.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EOptions\u003C/code\u003E contains the effective server configuration for that mode.\u003C/p\u003E\n\u003Cp\u003EThe effective configuration is derived from the original settings rather than replacing the application\u0027s registered options globally.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022effective-configuration-resolution\u0022\u003E3. Effective Configuration Resolution\u003C/h2\u003E\n\u003Cp\u003EThe current \u003Ccode\u003EEffectiveServerOptionsProvider\u003C/code\u003E follows this sequence:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EConfigured UAuthServerOptions\n |\n v\n Resolve mode\n |\n v\n Clone base options\n |\n v\n Apply mode defaults\n |\n v\n Apply ConfigureMode override\n |\n v\n EffectiveUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn simplified form:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar original = baseOptions.Value;\n\nvar mode = modeResolver.Resolve(applicationProfile);\n\nvar options = original.Clone();\n\nConfigureDefaults.ApplyModeDefaults(mode, options);\n\nif (original.ModeConfigurations.TryGetValue(mode, out var configure))\n{\n configure(options);\n}\n\nreturn new EffectiveUAuthServerOptions\n{\n Mode = mode,\n Options = options\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis execution order is important.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EMode defaults are applied after the original configuration is cloned.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EConsequently, certain values configured globally may be replaced by mode-specific defaults.\u003C/p\u003E\n\u003Cp\u003EExplicit mode overrides are applied last.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-changes-between-requests\u0022\u003EWhat Changes Between Requests?\u003C/h3\u003E\n\u003Cp\u003EDifferent application profiles can resolve to different authentication modes.\u003C/p\u003E\n\u003Cp\u003EThe provider therefore can produce different effective configurations for different application profiles.\u003C/p\u003E\n\u003Cp\u003EHowever, this does not mean every setting is independently recalculated from arbitrary request data.\u003C/p\u003E\n\u003Cp\u003EIn the current implementation, mode selection is based on the supplied \u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe provider also accepts tenant context, but the default effective-options construction does not apply an additional tenant-specific configuration override.\u003C/p\u003E\n\u003Cp\u003EApplications should not assume that per-tenant options customization exists automatically.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-authentication-mode-resolution\u0022\u003E4. Default Authentication Mode Resolution\u003C/h2\u003E\n\u003Cp\u003EThe default \u003Ccode\u003EEffectiveAuthModeResolver\u003C/code\u003E maps application profiles to authentication modes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication profile\u003C/th\u003E\n\u003Cth\u003EResolved mode\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EWebServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorWasm\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaui\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EOther / unknown\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese mappings describe the current default resolver.\u003C/p\u003E\n\u003Cp\u003EThey do not imply that every resolved mode is fully supported in the current release.\u003C/p\u003E\n\u003Cp\u003EIn particular, the current server options validator rejects explicit activation of \u003Ccode\u003ESemiHybrid\u003C/code\u003E and \u003Ccode\u003EPureJwt\u003C/code\u003E through \u003Ccode\u003EAllowedModes\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EApplications should verify that their application profiles resolve to a supported authentication mode before deploying.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022allowedmodes-is-not-a-mode-selector\u0022\u003EAllowedModes Is Not a Mode Selector\u003C/h3\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis restricts which modes are allowed.\u003C/p\u003E\n\u003Cp\u003EIt does not instruct the resolver to choose \u003Ccode\u003EHybrid\u003C/code\u003E for every client.\u003C/p\u003E\n\u003Cp\u003EMode selection and mode restrictions are separate responsibilities.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-authentication-modes\u0022\u003E5. Configure Authentication Modes\u003C/h2\u003E\n\u003Cp\u003EUse the public \u003Ccode\u003EConfigureMode()\u003C/code\u003E extension to customize settings for a particular authentication mode.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis configuration changes the effective access token lifetime for \u003Ccode\u003EHybrid\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIt does not change the effective \u003Ccode\u003EPureOpaque\u003C/code\u003E configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-configuremode-matters\u0022\u003EWhy ConfigureMode Matters\u003C/h3\u003E\n\u003Cp\u003EConsider this configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Token.AccessTokenLifetime = TimeSpan.FromMinutes(30);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current \u003Ccode\u003EHybrid\u003C/code\u003E mode defaults explicitly set:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EBecause mode defaults are applied after the base options are cloned, the effective \u003Ccode\u003EHybrid\u003C/code\u003E access token lifetime becomes ten minutes rather than thirty.\u003C/p\u003E\n\u003Cp\u003ETo override that behavior, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(30);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe explicit mode override is applied after the mode defaults.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-multiple-modes\u0022\u003EConfigure Multiple Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n });\n\n options.ConfigureMode(UAuthMode.PureOpaque, mode =\u0026gt;\n {\n mode.Session.IdleTimeout = TimeSpan.FromDays(3);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEach override is associated with its specified mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-limitations\u0022\u003EImportant Limitations\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E configures the effective options for a mode.\u003C/p\u003E\n\u003Cp\u003EIt does not:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EEnable an unsupported authentication mode.\u003C/li\u003E\n\u003Cli\u003EBypass the server\u0027s allowed-mode restrictions.\u003C/li\u003E\n\u003Cli\u003EReplace the authentication mode resolver.\u003C/li\u003E\n\u003Cli\u003EAutomatically create a tenant-specific configuration.\u003C/li\u003E\n\u003Cli\u003EGuarantee that every combination of effective settings is safe.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe current implementation applies mode overrides during effective-options resolution.\u003C/p\u003E\n\u003Cp\u003EDo not assume that every mode-specific combination receives the same startup validation as the original \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E instance.\u003C/p\u003E\n\u003Cp\u003ETest mode overrides carefully, especially when changing token issuance, session lifetimes, or credential delivery.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-defaults\u0022\u003E6. Mode Defaults\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides mode-specific defaults for authentication behavior.\u003C/p\u003E\n\u003Cp\u003EThe current implementation includes templates for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ESemiHybrid\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese templates configure relevant token, session, cookie, and response behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque\u0022\u003EPureOpaque\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EPureOpaque\u003C/code\u003E defaults include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.IssueJwt = false;\nToken.IssueOpaque = false;\nToken.IssueRefresh = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this mode, the session identifier is the primary opaque authentication credential.\u003C/p\u003E\n\u003Cp\u003EThe defaults also configure a longer idle timeout and session touch interval where no explicit values were supplied.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid\u0022\u003EHybrid\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EHybrid\u003C/code\u003E defaults include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.IssueJwt = true;\nToken.IssueOpaque = true;\nToken.AccessTokenLifetime = TimeSpan.FromMinutes(10);\nToken.RefreshTokenLifetime = TimeSpan.FromDays(7);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EHybrid also configures refresh-token delivery through a cookie.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022unsupported-modes\u0022\u003EUnsupported Modes\u003C/h3\u003E\n\u003Cp\u003EAlthough default templates exist for \u003Ccode\u003ESemiHybrid\u003C/code\u003E and \u003Ccode\u003EPureJwt\u003C/code\u003E, their presence does not mean those modes are ready for production use.\u003C/p\u003E\n\u003Cp\u003EThe server\u0027s current validator explicitly rejects these modes when they are enabled through \u003Ccode\u003EAllowedModes\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EOnly use modes supported by the current release.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-effective-options\u0022\u003E7. Inspect Effective Options\u003C/h2\u003E\n\u003Cp\u003EAdvanced integrations can use \u003Ccode\u003EIEffectiveServerOptionsProvider\u003C/code\u003E to inspect configured and effective server options.\u003C/p\u003E\n\u003Cp\u003EThe interface exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic interface IEffectiveServerOptionsProvider\n{\n UAuthServerOptions GetOriginal(HttpContext context);\n EffectiveUAuthServerOptions GetEffective(HttpContext context, UAuthApplicationProfile applicationProfile);\n EffectiveUAuthServerOptions GetEffective(TenantKey tenant, UAuthApplicationProfile applicationProfile);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-the-original-configuration\u0022\u003EInspect the Original Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar original = provider.GetOriginal(httpContext);\nvar configuredLifetime = original.Token.AccessTokenLifetime;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-the-effective-configuration\u0022\u003EInspect the Effective Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar effective = provider.GetEffective(httpContext, UAuthApplicationProfile.BlazorWasm);\nvar mode = effective.Mode;\nvar lifetime = effective.Options.Token.AccessTokenLifetime;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is useful when diagnosing unexpected differences between configured and runtime behavior.\u003C/p\u003E\n\u003Cp\u003EFor example, a globally configured access token lifetime may differ from the effective value because a mode template overrides it.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022do-not-mutate-the-original-options\u0022\u003EDo Not Mutate the Original Options\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EGetOriginal()\u003C/code\u003E returns the original options instance.\u003C/p\u003E\n\u003Cp\u003ETreat it as read-only application configuration.\u003C/p\u003E\n\u003Cp\u003ERuntime customization should use the supported configuration mechanisms rather than mutating registered options during requests.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-authentication-mode-resolution\u0022\u003E8. Custom Authentication Mode Resolution\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIEffectiveAuthModeResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe interface contains:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic interface IEffectiveAuthModeResolver\n{\n UAuthMode Resolve(UAuthApplicationProfile applicationProfile);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe default implementation selects the mode using the application profile.\u003C/p\u003E\n\u003Cp\u003EAn application can provide its own resolver when the default mapping does not meet its requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-resolver-example\u0022\u003ECustom Resolver Example\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed class ApplicationAuthModeResolver : IEffectiveAuthModeResolver\n{\n public UAuthMode Resolve(UAuthApplicationProfile applicationProfile)\n {\n return applicationProfile switch\n {\n UAuthApplicationProfile.BlazorServer =\u0026gt; UAuthMode.PureOpaque,\n UAuthApplicationProfile.BlazorWasm =\u0026gt; UAuthMode.Hybrid,\n UAuthApplicationProfile.Maui =\u0026gt; UAuthMode.Hybrid,\n\n _ =\u0026gt; UAuthMode.Hybrid\n };\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister the implementation:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;IEffectiveAuthModeResolver, ApplicationAuthModeResolver\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server registers its default resolver using \u003Ccode\u003ETryAddSingleton\u003C/code\u003E, so an existing registration can take precedence.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003EThe custom resolver must return a mode compatible with the server\u0027s supported modes and security requirements.\u003C/p\u003E\n\u003Cp\u003EDo not choose authentication modes based solely on untrusted client-provided values without appropriate validation.\u003C/p\u003E\n\u003Cp\u003EAlso note that the current resolver interface receives an application profile, not an arbitrary HTTP request context.\u003C/p\u003E\n\u003Cp\u003EFor more complex context-dependent selection, additional application integration may be necessary.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022dependency-injection-extension-points\u0022\u003E9. Dependency Injection Extension Points\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth registers many internal services through dependency injection.\u003C/p\u003E\n\u003Cp\u003ESeveral default registrations use \u003Ccode\u003ETryAddScoped\u003C/code\u003E or \u003Ccode\u003ETryAddSingleton\u003C/code\u003E, allowing applications to supply an implementation before the default registration is added.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ISessionValidator, ApplicationSessionValidator\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe application-defined validator is registered before the UltimateAuth server\u0027s default registration.\u003C/p\u003E\n\u003Cp\u003EBecause the server uses \u003Ccode\u003ETryAddScoped\u003C/code\u003E for this service, it does not add its default implementation when an existing registration is present.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022registration-order-matters\u0022\u003ERegistration Order Matters\u003C/h3\u003E\n\u003Cp\u003EFor services registered using \u003Ccode\u003ETryAdd...\u003C/code\u003E, prefer:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ISessionValidator, ApplicationSessionValidator\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not assume that registering a replacement after the server will always produce the same behavior.\u003C/p\u003E\n\u003Cp\u003EThe result depends on the service\u0027s registration pattern and how it is resolved.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022not-every-service-is-replaceable-in-the-same-way\u0022\u003ENot Every Service Is Replaceable in the Same Way\u003C/h3\u003E\n\u003Cp\u003ESome UltimateAuth services use ordinary \u003Ccode\u003EAddSingleton\u003C/code\u003E or \u003Ccode\u003EAddScoped\u003C/code\u003E registrations.\u003C/p\u003E\n\u003Cp\u003EOthers use \u003Ccode\u003ETryAdd...\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003ESome are registered as collections.\u003C/p\u003E\n\u003Cp\u003EThese patterns have different override semantics.\u003C/p\u003E\n\u003Cp\u003ETherefore, do not assume that every internal service can be replaced safely or that every replacement preserves the intended security behavior.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-login-authority\u0022\u003E10. Custom Login Authority\u003C/h2\u003E\n\u003Cp\u003EThe login authority participates in deciding whether a login attempt is permitted.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EILoginAuthority\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe interface is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic interface ILoginAuthority\n{\n LoginDecision Decide(LoginDecisionContext context);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn application can implement its own login decision logic.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed class ApplicationLoginAuthority : ILoginAuthority\n{\n public LoginDecision Decide(LoginDecisionContext context)\n {\n // Evaluate application-specific login rules.\n // Return a valid LoginDecision.\n throw new NotImplementedException();\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe example illustrates the extension contract; it is not a usable implementation.\u003C/p\u003E\n\u003Cp\u003ERegister the implementation:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ILoginAuthority, ApplicationLoginAuthority\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-security-boundary\u0022\u003EImportant Security Boundary\u003C/h3\u003E\n\u003Cp\u003EReplacing the login authority changes a security decision component.\u003C/p\u003E\n\u003Cp\u003EThe replacement must preserve required authentication checks and correctly handle all decision outcomes.\u003C/p\u003E\n\u003Cp\u003EDo not replace the authority merely to add logging, notifications, or metrics.\u003C/p\u003E\n\u003Cp\u003EUse lifecycle events for those purposes.\u003C/p\u003E\n\u003Cp\u003EIf the application only needs additional access rules, consider the policy system before replacing a core authority.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorities-policies-and-invariants\u0022\u003E11. Authorities, Policies, and Invariants\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates different responsibilities within its security architecture.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorities\u0022\u003EAuthorities\u003C/h3\u003E\n\u003Cp\u003EAuthorities evaluate security decisions.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIAuthAuthority\nIAccessAuthority\nILoginAuthority\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022policies\u0022\u003EPolicies\u003C/h3\u003E\n\u003Cp\u003EPolicies define application-specific rules used by the authorization system.\u003C/p\u003E\n\u003Cp\u003EThey should be the preferred extension mechanism when the requirement is to add or refine access rules.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022invariants\u0022\u003EInvariants\u003C/h3\u003E\n\u003Cp\u003EInvariants enforce foundational security requirements.\u003C/p\u003E\n\u003Cp\u003EThe server registers invariants including:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EDeviceRequiredInvariant\nExpiredSessionInvariant\nInvalidOrRevokedSessionInvariant\nTenantResolvedInvariant\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese are registered as a collection of \u003Ccode\u003EIAuthorityInvariant\u003C/code\u003E implementations.\u003C/p\u003E\n\u003Cp\u003EUnlike ordinary application policies, security invariants protect fundamental authentication requirements.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDo not remove or bypass invariants to make a custom authentication flow succeed.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EFor example, an expired or revoked session should not become valid merely because a custom access policy grants permission.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-tenant-resolution\u0022\u003E12. Custom Tenant Resolution\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports route, header, and host-based tenant resolution.\u003C/p\u003E\n\u003Cp\u003EThese mechanisms are controlled through server options.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.EnableHeader = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor applications with a different tenant identification strategy, UltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EITenantIdResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server\u0027s default registration uses \u003Ccode\u003ETryAddSingleton\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EA custom resolver can therefore be registered before the server:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;ITenantIdResolver, ApplicationTenantIdResolver\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EApplicationTenantIdResolver\u003C/code\u003E represents an application-defined implementation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022when-to-use-a-custom-resolver\u0022\u003EWhen to Use a Custom Resolver\u003C/h3\u003E\n\u003Cp\u003EA custom tenant resolver may be appropriate when tenants are identified through:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAn application-specific host naming convention.\u003C/li\u003E\n\u003Cli\u003EA trusted gateway-provided tenant identifier.\u003C/li\u003E\n\u003Cli\u003EA custom routing structure.\u003C/li\u003E\n\u003Cli\u003EAn existing tenant management system.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations-1\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003ETenant identification is not the same as tenant authorization.\u003C/p\u003E\n\u003Cp\u003EThe server must still verify that the authenticated user or application is allowed to access the resolved tenant.\u003C/p\u003E\n\u003Cp\u003ENever trust arbitrary tenant identifiers supplied by clients without applying the required validation and isolation rules.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-session-and-device-resolution\u0022\u003E13. Custom Session and Device Resolution\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates session identifier resolution from session validation.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EISessionIdResolver\nISessionValidator\nIDeviceResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese interfaces have different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EComponent\u003C/th\u003E\n\u003Cth\u003EResponsibility\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDetermine which session identifier is supplied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionValidator\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidate the session\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIDeviceResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve device information\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe server supports multiple session identifier sources through internal resolvers, including cookies, bearer credentials, headers, and query parameters.\u003C/p\u003E\n\u003Cp\u003EThe active resolution behavior is controlled by the configured session resolution options.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-session-validator\u0022\u003ECustom Session Validator\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ISessionValidator, ApplicationSessionValidator\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA custom validator must preserve the relevant expiration, revocation, and security-state checks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-device-resolver\u0022\u003ECustom Device Resolver\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;IDeviceResolver, ApplicationDeviceResolver\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDevice resolution may affect session identification and security decisions.\u003C/p\u003E\n\u003Cp\u003ECustom implementations should produce consistent, trustworthy device information.\u003C/p\u003E\n\u003Cp\u003EAvoid replacing these services unless the application\u0027s requirements cannot be met through standard options.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-stores\u0022\u003E14. Custom Stores\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates domain behavior from persistence through store interfaces.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EISessionStore\nIRefreshTokenStore\nIRoleStore\nIUserRoleStore\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ESome stores are resolved through corresponding factory interfaces.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides persistence implementations in separate packages, including in-memory and Entity Framework Core implementations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-a-store-implementation\u0022\u003EChoosing a Store Implementation\u003C/h3\u003E\n\u003Cp\u003EUse in-memory implementations for suitable development, testing, or demonstration scenarios.\u003C/p\u003E\n\u003Cp\u003EUse durable persistence for production authentication state that must survive process restarts or be shared across application instances.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-store-requirements\u0022\u003ECustom Store Requirements\u003C/h3\u003E\n\u003Cp\u003EA custom store must preserve the semantics expected by the authentication services.\u003C/p\u003E\n\u003Cp\u003EDepending on the store, these may include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ECorrect session expiration handling.\u003C/li\u003E\n\u003Cli\u003EReliable revocation state.\u003C/li\u003E\n\u003Cli\u003ERefresh token consumption and replay protection.\u003C/li\u003E\n\u003Cli\u003EConsistent user and tenant scoping.\u003C/li\u003E\n\u003Cli\u003EAppropriate concurrency behavior.\u003C/li\u003E\n\u003Cli\u003EAtomic state transitions where required.\u003C/li\u003E\n\u003Cli\u003ECorrect deletion and lifecycle behavior.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example, refresh token rotation may depend on preventing two concurrent requests from successfully consuming the same token.\u003C/p\u003E\n\u003Cp\u003EA store implementation that does not enforce the required concurrency semantics can undermine the security of the refresh flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022store-registration\u0022\u003EStore Registration\u003C/h3\u003E\n\u003Cp\u003ECustom store registration depends on the specific store interface and its factory.\u003C/p\u003E\n\u003Cp\u003EDo not assume that replacing one store interface is sufficient when the runtime resolves stores through a factory.\u003C/p\u003E\n\u003Cp\u003EUse the relevant domain package\u0027s documented registration pattern.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-lifecycle-events\u0022\u003E15. Authentication Lifecycle Events\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides application-wide authentication event hooks through:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthEvents\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese hooks allow applications to react to authentication lifecycle events without replacing the authentication flow.\u003C/p\u003E\n\u003Cp\u003EThe current event options expose:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EOnAnyEvent\nOnUserLoggedIn\nOnUserLoggedOut\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-event\u0022\u003ELogin Event\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnUserLoggedIn = context =\u0026gt;\n {\n // Record a successful login.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-event\u0022\u003ELogout Event\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnUserLoggedOut = context =\u0026gt;\n {\n // Record a logout event.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022global-event-hook\u0022\u003EGlobal Event Hook\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnAnyEvent = context =\u0026gt;\n {\n // Process an authentication event.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe global hook receives an \u003Ccode\u003EIAuthEventContext\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022appropriate-event-uses\u0022\u003EAppropriate Event Uses\u003C/h3\u003E\n\u003Cp\u003ELifecycle events are suitable for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAudit logging.\u003C/li\u003E\n\u003Cli\u003EApplication metrics.\u003C/li\u003E\n\u003Cli\u003EMonitoring.\u003C/li\u003E\n\u003Cli\u003ENotifications.\u003C/li\u003E\n\u003Cli\u003ELightweight post-operation integration.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThey should not be used to implement critical authentication checks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022events-are-not-decision-hooks\u0022\u003EEvents Are Not Decision Hooks\u003C/h3\u003E\n\u003Cp\u003EThe documented event delegates run after their corresponding successful operations.\u003C/p\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EOnUserLoggedIn\u003C/code\u003E is not the place to decide whether the login should have been permitted.\u003C/p\u003E\n\u003Cp\u003EUse an appropriate authority or policy for security decisions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022avoid-complex-work-inside-events\u0022\u003EAvoid Complex Work Inside Events\u003C/h3\u003E\n\u003Cp\u003ELong-running or failure-prone external operations should generally be delegated to a reliable application service or message-processing mechanism.\u003C/p\u003E\n\u003Cp\u003EDo not make critical authentication behavior depend on an unreliable external notification system.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-jwt-signing-keys\u0022\u003E16. Custom JWT Signing Keys\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIJwtSigningKeyProvider\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server registers a development signing key provider as its default implementation.\u003C/p\u003E\n\u003Cp\u003EProduction applications should supply an appropriate signing key strategy.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;IJwtSigningKeyProvider, ApplicationJwtSigningKeyProvider\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EApplicationJwtSigningKeyProvider\u003C/code\u003E is an implementation supplied by the application.\u003C/p\u003E\n\u003Cp\u003EA production implementation should use appropriately protected signing keys and support the application\u0027s operational requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022signing-key-responsibilities\u0022\u003ESigning Key Responsibilities\u003C/h3\u003E\n\u003Cp\u003EConsider:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EKey confidentiality.\u003C/li\u003E\n\u003Cli\u003EKey rotation.\u003C/li\u003E\n\u003Cli\u003EKey identification.\u003C/li\u003E\n\u003Cli\u003EConsistent validation across resource servers.\u003C/li\u003E\n\u003Cli\u003ESecure key storage.\u003C/li\u003E\n\u003Cli\u003ERecovery and deployment procedures.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EDo not use development signing keys as a production security strategy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-customization\u0022\u003E17. Endpoint Customization\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides an advanced endpoint configuration hook:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.OnConfigureEndpoints\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe hook receives:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIEndpointRouteBuilder\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.OnConfigureEndpoints = endpoints =\u0026gt;\n {\n // Apply supported application-specific\n // endpoint configuration here.\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe hook is invoked after UltimateAuth registers its default endpoints.\u003C/p\u003E\n\u003Cp\u003EIt can support advanced endpoint integration, but it should not be used to remove, remap, or weaken the security requirements of UltimateAuth endpoints.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022prefer-endpoint-options-first\u0022\u003EPrefer Endpoint Options First\u003C/h3\u003E\n\u003Cp\u003EFor ordinary endpoint configuration, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Endpoints\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.Authentication = true;\n options.Endpoints.Credentials = true;\n options.Endpoints.Authorization = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe advanced endpoint hook is intended for cases that cannot be addressed through the supported endpoint options.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-sources-and-precedence\u0022\u003E18. Configuration Sources and Precedence\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth integrates with the standard ASP.NET Core configuration system.\u003C/p\u003E\n\u003Cp\u003EFor the server, the configuration section is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Server\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor the client:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Client\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor Resource APIs:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:ResourceApi\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022registration-order\u0022\u003ERegistration Order\u003C/h3\u003E\n\u003Cp\u003EThe standard server registration applies:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EOption type defaults.\u003C/li\u003E\n\u003Cli\u003EThe \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E configuration delegate.\u003C/li\u003E\n\u003Cli\u003EValues bound from \u003Ccode\u003EUltimateAuth:Server\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EPost-configuration processing.\u003C/li\u003E\n\u003Cli\u003ERegistered options validation.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Server\u0026quot;: {\n \u0026quot;Login\u0026quot;: {\n \u0026quot;MaxFailedAttempts\u0026quot;: 3\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe effective configured value is \u003Ccode\u003E3\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe configuration binding occurs after the registration delegate.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022environment-variables\u0022\u003EEnvironment Variables\u003C/h3\u003E\n\u003Cp\u003EASP.NET Core supports hierarchical configuration keys through double underscores.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Server__Login__MaxFailedAttempts=3\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis corresponds to:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Server:Login:MaxFailedAttempts\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEnvironment-specific configuration can therefore override values without requiring changes to application code.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022environment-specific-files\u0022\u003EEnvironment-Specific Files\u003C/h3\u003E\n\u003Cp\u003EStandard ASP.NET Core applications commonly use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Eappsettings.json\nappsettings.Development.json\nappsettings.Staging.json\nappsettings.Production.json\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe active environment determines which environment-specific file is loaded.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EASPNETCORE_ENVIRONMENT=Production\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe final value depends on the configured ASP.NET Core configuration providers and their precedence.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-binding-does-not-replace-mode-resolution\u0022\u003EConfiguration Binding Does Not Replace Mode Resolution\u003C/h3\u003E\n\u003Cp\u003EA value supplied through \u003Ccode\u003Eappsettings.json\u003C/code\u003E becomes part of the configured options.\u003C/p\u003E\n\u003Cp\u003EIt may still be replaced later when UltimateAuth applies mode defaults.\u003C/p\u003E\n\u003Cp\u003EFor settings explicitly controlled by mode templates, use \u003Ccode\u003EConfigureMode()\u003C/code\u003E when the desired behavior must apply to a specific mode.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022startup-validation-and-runtime-safety\u0022\u003E19. Startup Validation and Runtime Safety\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth validates server options through registered \u003Ccode\u003EIValidateOptions\u0026lt;UAuthServerOptions\u0026gt;\u003C/code\u003E implementations.\u003C/p\u003E\n\u003Cp\u003EThe server uses:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EValidateOnStart()\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows many invalid configurations to fail during application startup.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EInvalid endpoint base paths.\u003C/li\u003E\n\u003Cli\u003EInvalid or unsupported allowed modes.\u003C/li\u003E\n\u003Cli\u003EInvalid session lifetimes.\u003C/li\u003E\n\u003Cli\u003EIncompatible token and session lifetime constraints.\u003C/li\u003E\n\u003Cli\u003EInvalid login settings.\u003C/li\u003E\n\u003Cli\u003EInvalid tenant configuration.\u003C/li\u003E\n\u003Cli\u003EInvalid pagination settings.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-has-boundaries\u0022\u003EValidation Has Boundaries\u003C/h3\u003E\n\u003Cp\u003EStartup validation applies to the configured options according to the registered validators.\u003C/p\u003E\n\u003Cp\u003EIt does not automatically prove that every custom dependency injection replacement is safe.\u003C/p\u003E\n\u003Cp\u003EIt also does not guarantee that every mode-specific override has been validated against all possible security invariants.\u003C/p\u003E\n\u003Cp\u003ECustom implementations must preserve the relevant contracts and security requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-validation-strategy\u0022\u003ERecommended Validation Strategy\u003C/h3\u003E\n\u003Cp\u003EFor advanced configurations:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EVerify that the application starts successfully.\u003C/li\u003E\n\u003Cli\u003ETest each enabled authentication mode.\u003C/li\u003E\n\u003Cli\u003ETest login, refresh, validation, and logout.\u003C/li\u003E\n\u003Cli\u003ETest session expiration and revocation.\u003C/li\u003E\n\u003Cli\u003ETest tenant isolation.\u003C/li\u003E\n\u003Cli\u003ETest authorization denial paths.\u003C/li\u003E\n\u003Cli\u003ETest concurrent refresh requests where applicable.\u003C/li\u003E\n\u003Cli\u003EVerify that effective options contain the intended values.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThese checks are especially important when customizing authorities, validators, stores, or authentication mode behavior.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-configuration-mistakes\u0022\u003E20. Common Configuration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuring-core-options-separately-from-server-options\u0022\u003EConfiguring Core Options Separately from Server Options\u003C/h3\u003E\n\u003Cp\u003EWhen using \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E, configure Core-defined behavior through \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EDo not expect a separate \u003Ccode\u003EUAuthOptions\u003C/code\u003E configuration to override the server\u0027s composed options.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-global-values-always-survive-mode-defaults\u0022\u003EAssuming Global Values Always Survive Mode Defaults\u003C/h3\u003E\n\u003Cp\u003EMode templates can overwrite values such as access token lifetime.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EConfigureMode()\u003C/code\u003E for explicit mode-specific customization.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-allowedmodes-as-mode-selection\u0022\u003ETreating AllowedModes as Mode Selection\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E restricts permitted modes.\u003C/p\u003E\n\u003Cp\u003EIt does not replace \u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enabling-an-unsupported-mode\u0022\u003EEnabling an Unsupported Mode\u003C/h3\u003E\n\u003Cp\u003EAn enum value or default template does not establish that a mode is ready for production.\u003C/p\u003E\n\u003Cp\u003EUse only modes supported by the current implementation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022replacing-security-components-unnecessarily\u0022\u003EReplacing Security Components Unnecessarily\u003C/h3\u003E\n\u003Cp\u003EReplacing a validator or authority can change fundamental authentication behavior.\u003C/p\u003E\n\u003Cp\u003EPrefer options and policies when they satisfy the requirement.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-every-di-service-is-replaceable\u0022\u003EAssuming Every DI Service Is Replaceable\u003C/h3\u003E\n\u003Cp\u003EDifferent services use different registration patterns.\u003C/p\u003E\n\u003Cp\u003EReview the actual registration behavior before replacing a service.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-events-for-authorization-decisions\u0022\u003EUsing Events for Authorization Decisions\u003C/h3\u003E\n\u003Cp\u003ELifecycle events are for post-operation reactions.\u003C/p\u003E\n\u003Cp\u003EUse authorities and policies for decisions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ignoring-store-concurrency\u0022\u003EIgnoring Store Concurrency\u003C/h3\u003E\n\u003Cp\u003EAuthentication stores must preserve the required consistency and atomicity semantics.\u003C/p\u003E\n\u003Cp\u003EThis is particularly important for refresh token rotation and revocation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-runtime-overrides-receive-full-startup-validation\u0022\u003EAssuming Runtime Overrides Receive Full Startup Validation\u003C/h3\u003E\n\u003Cp\u003EMode-specific overrides are applied during effective-options construction.\u003C/p\u003E\n\u003Cp\u003EValidate their results through tests and appropriate application safeguards.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022advanced-configuration-reference\u0022\u003E21. Advanced Configuration Reference\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMechanism\u003C/th\u003E\n\u003Cth\u003EAPI / Type\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EServer configuration\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBase server settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMode customization\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApply mode-specific overrides\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEffective configuration\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIEffectiveServerOptionsProvider\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve effective server settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEffective result\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EEffectiveUAuthServerOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolved mode and options\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMode selection\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve mode from application profile\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ELogin decisions\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EILoginAuthority\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEvaluate login decisions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAuthentication authority\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIAuthAuthority\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication security decisions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess authority\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIAccessAuthority\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAccess decisions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ETenant identification\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EITenantIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenant identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession validation\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionValidator\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidate sessions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession identification\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve session identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDevice identification\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIDeviceResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve device information\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESigning keys\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIJwtSigningKeyProvider\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESupply JWT signing keys\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ELifecycle events\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EObserve completed authentication operations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEndpoint customization\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnConfigureEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAdvanced endpoint configuration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession persistence\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionStore\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession storage\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh persistence\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIRefreshTokenStore\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh token storage\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-extension-strategy\u0022\u003E22. Recommended Extension Strategy\u003C/h2\u003E\n\u003Cp\u003EWhen an application requires customization, follow this order:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse existing options.\u003C/strong\u003E Prefer supported configuration properties.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse mode overrides.\u003C/strong\u003E Apply \u003Ccode\u003EConfigureMode()\u003C/code\u003E when behavior must differ by authentication mode.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse application policies.\u003C/strong\u003E Extend authorization rules without replacing the authorization pipeline.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse lifecycle events.\u003C/strong\u003E Implement logging, monitoring, and notifications without changing authentication decisions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse focused resolvers or providers.\u003C/strong\u003E Customize tenant identification, signing keys, or other specific infrastructure concerns.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReplace authorities, validators, or stores only when necessary.\u003C/strong\u003E Preserve all relevant security invariants and verify the implementation through tests.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe objective is not to replace as much of UltimateAuth as possible.\u003C/p\u003E\n\u003Cp\u003EIt is to customize the smallest component necessary while retaining the guarantees of the surrounding system.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/overview\u0022\u003EConfiguration Overview\u003C/a\u003E \u2014 Understand registration, configuration sources, and architecture.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/server-options\u0022\u003EServer Options\u003C/a\u003E \u2014 Configure authentication and server security behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure SDK flows and client behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E \u2014 Understand supported authentication modes.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/authorization\u0022\u003EAuthorization\u003C/a\u003E \u2014 Use the client authorization API.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/session-management\u0022\u003ESession Management\u003C/a\u003E \u2014 Manage sessions and revocation.\u003C/li\u003E\n\u003C/ul\u003E\n", + "Html": "\n\u003Cp\u003EUltimateAuth supports advanced customization of authentication behavior through effective server options, authentication mode resolution, dependency injection, custom infrastructure, and lifecycle events.\u003C/p\u003E\n\u003Cp\u003EThese mechanisms serve different purposes:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EOptions\u003C/strong\u003E define configurable behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EEffective options\u003C/strong\u003E adapt that behavior to the selected authentication mode.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EResolvers\u003C/strong\u003E determine information required by authentication flows.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EAuthorities and validators\u003C/strong\u003E participate in security decisions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EStores\u003C/strong\u003E persist authentication and application state.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EEvents\u003C/strong\u003E allow applications to react to completed operations.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EMost applications should begin with the standard Server and Client options. Advanced customization becomes useful when an application needs specialized authentication behavior, custom infrastructure, or integration with existing systems.\u003C/p\u003E\n\u003Cp\u003EThis guide explains the supported extension mechanisms, their execution order, and the security boundaries developers must preserve.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-versus-extensibility\u0022\u003E1. Configuration Versus Extensibility\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth distinguishes between configuring existing behavior and replacing an implementation.\u003C/p\u003E\n\u003Cp\u003EFor example, changing a session lifetime is configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromHours(8);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EProviding a custom clock is an infrastructure extension:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;IClock, ApplicationClock\u0026gt;();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EApplicationClock\u003C/code\u003E is an implementation supplied by your application.\u003C/p\u003E\n\u003Cp\u003EThese approaches are not interchangeable.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ERequirement\u003C/th\u003E\n\u003Cth\u003ERecommended mechanism\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EChange session lifetime\u003C/td\u003E\n\u003Ctd\u003EServer options\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EChange token lifetime for a specific mode\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESelect authentication mode differently\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EResolve tenants from a custom source\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EITenantIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECustomize login decisions\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EILoginAuthority\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESupply signing keys\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIJwtSigningKeyProvider\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPersist sessions in another backend\u003C/td\u003E\n\u003Ctd\u003EStore implementation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EReact to successful login\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthEvents\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAdd application-specific access rules\u003C/td\u003E\n\u003Ctd\u003EPolicies\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EPrefer the most specific supported mechanism rather than replacing an entire authentication component.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022understanding-effective-server-options\u0022\u003E2. Understanding Effective Server Options\u003C/h2\u003E\n\u003Cp\u003EThe server does not necessarily use the original \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E instance unchanged for every authentication flow.\u003C/p\u003E\n\u003Cp\u003EInstead, UltimateAuth can resolve an effective configuration based on the application profile and authentication mode.\u003C/p\u003E\n\u003Cp\u003EThe relevant types are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIEffectiveServerOptionsProvider\nEffectiveUAuthServerOptions\nIEffectiveAuthModeResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configured-options\u0022\u003EConfigured Options\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E represents the application\u0027s configured server settings.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromHours(8);\n options.Token.Issuer = \u0026quot;MyApplication\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings form the base configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022effective-options\u0022\u003EEffective Options\u003C/h3\u003E\n\u003Cp\u003EThe provider produces an \u003Ccode\u003EEffectiveUAuthServerOptions\u003C/code\u003E instance containing:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed class EffectiveUAuthServerOptions\n{\n public UAuthMode Mode { get; init; }\n public UAuthServerOptions Options { get; init; } = default!;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EMode\u003C/code\u003E identifies the resolved authentication mode.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EOptions\u003C/code\u003E contains the effective server configuration for that mode.\u003C/p\u003E\n\u003Cp\u003EThe effective configuration is derived from the original settings rather than replacing the application\u0027s registered options globally.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022effective-configuration-resolution\u0022\u003E3. Effective Configuration Resolution\u003C/h2\u003E\n\u003Cp\u003EThe current \u003Ccode\u003EEffectiveServerOptionsProvider\u003C/code\u003E follows this sequence:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EConfigured UAuthServerOptions\n |\n v\n Resolve mode\n |\n v\n Clone base options\n |\n v\n Apply mode defaults\n |\n v\n Apply ConfigureMode override\n |\n v\n EffectiveUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn simplified form:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar original = baseOptions.Value;\n\nvar mode = modeResolver.Resolve(applicationProfile);\n\nvar options = original.Clone();\n\nConfigureDefaults.ApplyModeDefaults(mode, options);\n\nif (original.ModeConfigurations.TryGetValue(mode, out var configure))\n{\n configure(options);\n}\n\nreturn new EffectiveUAuthServerOptions\n{\n Mode = mode,\n Options = options\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis execution order is important.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EMode defaults are applied after the original configuration is cloned.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EConsequently, certain values configured globally may be replaced by mode-specific defaults.\u003C/p\u003E\n\u003Cp\u003EExplicit mode overrides are applied last.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-changes-between-requests\u0022\u003EWhat Changes Between Requests?\u003C/h3\u003E\n\u003Cp\u003EDifferent application profiles can resolve to different authentication modes.\u003C/p\u003E\n\u003Cp\u003EThe provider therefore can produce different effective configurations for different application profiles.\u003C/p\u003E\n\u003Cp\u003EHowever, this does not mean every setting is independently recalculated from arbitrary request data.\u003C/p\u003E\n\u003Cp\u003EIn the current implementation, mode selection is based on the supplied \u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe provider also accepts tenant context, but the default effective-options construction does not apply an additional tenant-specific configuration override.\u003C/p\u003E\n\u003Cp\u003EApplications should not assume that per-tenant options customization exists automatically.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-authentication-mode-resolution\u0022\u003E4. Default Authentication Mode Resolution\u003C/h2\u003E\n\u003Cp\u003EThe default \u003Ccode\u003EEffectiveAuthModeResolver\u003C/code\u003E maps application profiles to authentication modes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication Profile\u003C/th\u003E\n\u003Cth\u003EDefault Mode\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EWebServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorWasm\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaui\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EOther / unknown\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese mappings describe the current default resolver.\u003C/p\u003E\n\u003Cp\u003EThey do not imply that every resolved mode is fully supported in the current release.\u003C/p\u003E\n\u003Cp\u003EApplications should verify that their application profiles resolve to a supported authentication mode before deploying.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022allowedmodes-is-not-a-mode-selector\u0022\u003EAllowedModes Is Not a Mode Selector\u003C/h3\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis restricts which modes are allowed.\u003C/p\u003E\n\u003Cp\u003EIt does not instruct the resolver to choose \u003Ccode\u003EHybrid\u003C/code\u003E for every client.\u003C/p\u003E\n\u003Cp\u003EMode selection and mode restrictions are separate responsibilities.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-authentication-modes\u0022\u003E5. Configure Authentication Modes\u003C/h2\u003E\n\u003Cp\u003EUse the public \u003Ccode\u003EConfigureMode()\u003C/code\u003E extension to customize settings for a particular authentication mode.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis configuration changes the effective access token lifetime for \u003Ccode\u003EHybrid\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIt does not change the effective \u003Ccode\u003EPureOpaque\u003C/code\u003E configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-configuremode-matters\u0022\u003EWhy ConfigureMode Matters\u003C/h3\u003E\n\u003Cp\u003EConsider this configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Token.AccessTokenLifetime = TimeSpan.FromMinutes(30);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current \u003Ccode\u003EHybrid\u003C/code\u003E mode defaults explicitly set:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EBecause mode defaults are applied after the base options are cloned, the effective \u003Ccode\u003EHybrid\u003C/code\u003E access token lifetime becomes ten minutes rather than thirty.\u003C/p\u003E\n\u003Cp\u003ETo override that behavior, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(30);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe explicit mode override is applied after the mode defaults.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-multiple-modes\u0022\u003EConfigure Multiple Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n });\n\n options.ConfigureMode(UAuthMode.PureOpaque, mode =\u0026gt;\n {\n mode.Session.IdleTimeout = TimeSpan.FromDays(3);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEach override is associated with its specified mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-limitations\u0022\u003EImportant Limitations\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E configures the effective options for a mode.\u003C/p\u003E\n\u003Cp\u003EIt does not:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EEnable an unsupported authentication mode.\u003C/li\u003E\n\u003Cli\u003EBypass the server\u0027s allowed-mode restrictions.\u003C/li\u003E\n\u003Cli\u003EReplace the authentication mode resolver.\u003C/li\u003E\n\u003Cli\u003EAutomatically create a tenant-specific configuration.\u003C/li\u003E\n\u003Cli\u003EGuarantee that every combination of effective settings is safe.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe current implementation applies mode overrides during effective-options resolution.\u003C/p\u003E\n\u003Cp\u003EDo not assume that every mode-specific combination receives the same startup validation as the original \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E instance.\u003C/p\u003E\n\u003Cp\u003ETest mode overrides carefully, especially when changing token issuance, session lifetimes, or credential delivery.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-defaults\u0022\u003E6. Mode Defaults\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides mode-specific defaults for authentication behavior.\u003C/p\u003E\n\u003Cp\u003EThe current implementation includes templates for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ESemiHybrid\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese templates configure relevant token, session, cookie, and response behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque\u0022\u003EPureOpaque\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EPureOpaque\u003C/code\u003E defaults include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.IssueJwt = false;\nToken.IssueOpaque = false;\nToken.IssueRefresh = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this mode, the session identifier is the primary opaque authentication credential.\u003C/p\u003E\n\u003Cp\u003EThe defaults also configure a longer idle timeout and session touch interval where no explicit values were supplied.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid\u0022\u003EHybrid\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EHybrid\u003C/code\u003E defaults include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.IssueJwt = true;\nToken.IssueOpaque = true;\nToken.AccessTokenLifetime = TimeSpan.FromMinutes(10);\nToken.RefreshTokenLifetime = TimeSpan.FromDays(7);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EHybrid also configures refresh-token delivery through a cookie.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-effective-options\u0022\u003E7. Inspect Effective Options\u003C/h2\u003E\n\u003Cp\u003EAdvanced integrations can use \u003Ccode\u003EIEffectiveServerOptionsProvider\u003C/code\u003E to inspect configured and effective server options.\u003C/p\u003E\n\u003Cp\u003EThe interface exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic interface IEffectiveServerOptionsProvider\n{\n UAuthServerOptions GetOriginal(HttpContext context);\n EffectiveUAuthServerOptions GetEffective(HttpContext context, UAuthApplicationProfile applicationProfile);\n EffectiveUAuthServerOptions GetEffective(TenantKey tenant, UAuthApplicationProfile applicationProfile);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-the-original-configuration\u0022\u003EInspect the Original Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar original = provider.GetOriginal(httpContext);\nvar configuredLifetime = original.Token.AccessTokenLifetime;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022inspect-the-effective-configuration\u0022\u003EInspect the Effective Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar effective = provider.GetEffective(httpContext, UAuthApplicationProfile.BlazorWasm);\nvar mode = effective.Mode;\nvar lifetime = effective.Options.Token.AccessTokenLifetime;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is useful when diagnosing unexpected differences between configured and runtime behavior.\u003C/p\u003E\n\u003Cp\u003EFor example, a globally configured access token lifetime may differ from the effective value because a mode template overrides it.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022do-not-mutate-the-original-options\u0022\u003EDo Not Mutate the Original Options\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EGetOriginal()\u003C/code\u003E returns the original options instance.\u003C/p\u003E\n\u003Cp\u003ETreat it as read-only application configuration.\u003C/p\u003E\n\u003Cp\u003ERuntime customization should use the supported configuration mechanisms rather than mutating registered options during requests.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-authentication-mode-resolution\u0022\u003E8. Custom Authentication Mode Resolution\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIEffectiveAuthModeResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe interface contains:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic interface IEffectiveAuthModeResolver\n{\n UAuthMode Resolve(UAuthApplicationProfile applicationProfile);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe default implementation selects the mode using the application profile.\u003C/p\u003E\n\u003Cp\u003EAn application can provide its own resolver when the default mapping does not meet its requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-resolver-example\u0022\u003ECustom Resolver Example\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed class ApplicationAuthModeResolver : IEffectiveAuthModeResolver\n{\n public UAuthMode Resolve(UAuthApplicationProfile applicationProfile)\n {\n return applicationProfile switch\n {\n UAuthApplicationProfile.BlazorServer =\u0026gt; UAuthMode.PureOpaque,\n UAuthApplicationProfile.BlazorWasm =\u0026gt; UAuthMode.Hybrid,\n UAuthApplicationProfile.Maui =\u0026gt; UAuthMode.Hybrid,\n\n _ =\u0026gt; UAuthMode.Hybrid\n };\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister the implementation:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;IEffectiveAuthModeResolver, ApplicationAuthModeResolver\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server registers its default resolver using \u003Ccode\u003ETryAddSingleton\u003C/code\u003E, so an existing registration can take precedence.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003EThe custom resolver must return a mode compatible with the server\u0027s supported modes and security requirements.\u003C/p\u003E\n\u003Cp\u003EDo not choose authentication modes based solely on untrusted client-provided values without appropriate validation.\u003C/p\u003E\n\u003Cp\u003EAlso note that the current resolver interface receives an application profile, not an arbitrary HTTP request context.\u003C/p\u003E\n\u003Cp\u003EFor more complex context-dependent selection, additional application integration may be necessary.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022dependency-injection-extension-points\u0022\u003E9. Dependency Injection Extension Points\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth registers many internal services through dependency injection.\u003C/p\u003E\n\u003Cp\u003ESeveral default registrations use \u003Ccode\u003ETryAddScoped\u003C/code\u003E or \u003Ccode\u003ETryAddSingleton\u003C/code\u003E, allowing applications to supply an implementation before the default registration is added.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ISessionValidator, ApplicationSessionValidator\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe application-defined validator is registered before the UltimateAuth server\u0027s default registration.\u003C/p\u003E\n\u003Cp\u003EBecause the server uses \u003Ccode\u003ETryAddScoped\u003C/code\u003E for this service, it does not add its default implementation when an existing registration is present.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022registration-order-matters\u0022\u003ERegistration Order Matters\u003C/h3\u003E\n\u003Cp\u003EFor services registered using \u003Ccode\u003ETryAdd...\u003C/code\u003E, prefer:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ISessionValidator, ApplicationSessionValidator\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not assume that registering a replacement after the server will always produce the same behavior.\u003C/p\u003E\n\u003Cp\u003EThe result depends on the service\u0027s registration pattern and how it is resolved.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022not-every-service-is-replaceable-in-the-same-way\u0022\u003ENot Every Service Is Replaceable in the Same Way\u003C/h3\u003E\n\u003Cp\u003ESome UltimateAuth services use ordinary \u003Ccode\u003EAddSingleton\u003C/code\u003E or \u003Ccode\u003EAddScoped\u003C/code\u003E registrations.\u003C/p\u003E\n\u003Cp\u003EOthers use \u003Ccode\u003ETryAdd...\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003ESome are registered as collections.\u003C/p\u003E\n\u003Cp\u003EThese patterns have different override semantics.\u003C/p\u003E\n\u003Cp\u003ETherefore, do not assume that every internal service can be replaced safely or that every replacement preserves the intended security behavior.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-login-authority\u0022\u003E10. Custom Login Authority\u003C/h2\u003E\n\u003Cp\u003EThe login authority participates in deciding whether a login attempt is permitted.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EILoginAuthority\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe interface is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic interface ILoginAuthority\n{\n LoginDecision Decide(LoginDecisionContext context);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn application can implement its own login decision logic.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic sealed class ApplicationLoginAuthority : ILoginAuthority\n{\n public LoginDecision Decide(LoginDecisionContext context)\n {\n // Evaluate application-specific login rules.\n // Return a valid LoginDecision.\n throw new NotImplementedException();\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe example illustrates the extension contract; it is not a usable implementation.\u003C/p\u003E\n\u003Cp\u003ERegister the implementation:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ILoginAuthority, ApplicationLoginAuthority\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-security-boundary\u0022\u003EImportant Security Boundary\u003C/h3\u003E\n\u003Cp\u003EReplacing the login authority changes a security decision component.\u003C/p\u003E\n\u003Cp\u003EThe replacement must preserve required authentication checks and correctly handle all decision outcomes.\u003C/p\u003E\n\u003Cp\u003EDo not replace the authority merely to add logging, notifications, or metrics.\u003C/p\u003E\n\u003Cp\u003EUse lifecycle events for those purposes.\u003C/p\u003E\n\u003Cp\u003EIf the application only needs additional access rules, consider the policy system before replacing a core authority.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorities-policies-and-invariants\u0022\u003E11. Authorities, Policies, and Invariants\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates different responsibilities within its security architecture.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorities\u0022\u003EAuthorities\u003C/h3\u003E\n\u003Cp\u003EAuthorities evaluate security decisions.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIAuthAuthority\nIAccessAuthority\nILoginAuthority\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022policies\u0022\u003EPolicies\u003C/h3\u003E\n\u003Cp\u003EPolicies define application-specific rules used by the authorization system.\u003C/p\u003E\n\u003Cp\u003EThey should be the preferred extension mechanism when the requirement is to add or refine access rules.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022invariants\u0022\u003EInvariants\u003C/h3\u003E\n\u003Cp\u003EInvariants enforce foundational security requirements.\u003C/p\u003E\n\u003Cp\u003EThe server registers invariants including:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EDeviceRequiredInvariant\nExpiredSessionInvariant\nInvalidOrRevokedSessionInvariant\nTenantResolvedInvariant\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese are registered as a collection of \u003Ccode\u003EIAuthorityInvariant\u003C/code\u003E implementations.\u003C/p\u003E\n\u003Cp\u003EUnlike ordinary application policies, security invariants protect fundamental authentication requirements.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDo not remove or bypass invariants to make a custom authentication flow succeed.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EFor example, an expired or revoked session should not become valid merely because a custom access policy grants permission.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-tenant-resolution\u0022\u003E12. Custom Tenant Resolution\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports route, header, and host-based tenant resolution.\u003C/p\u003E\n\u003Cp\u003EThese mechanisms are controlled through server options.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.EnableHeader = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor applications with a different tenant identification strategy, UltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EITenantIdResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server\u0027s default registration uses \u003Ccode\u003ETryAddSingleton\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EA custom resolver can therefore be registered before the server:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;ITenantIdResolver, ApplicationTenantIdResolver\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EApplicationTenantIdResolver\u003C/code\u003E represents an application-defined implementation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022when-to-use-a-custom-resolver\u0022\u003EWhen to Use a Custom Resolver\u003C/h3\u003E\n\u003Cp\u003EA custom tenant resolver may be appropriate when tenants are identified through:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAn application-specific host naming convention.\u003C/li\u003E\n\u003Cli\u003EA trusted gateway-provided tenant identifier.\u003C/li\u003E\n\u003Cli\u003EA custom routing structure.\u003C/li\u003E\n\u003Cli\u003EAn existing tenant management system.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations-1\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003ETenant identification is not the same as tenant authorization.\u003C/p\u003E\n\u003Cp\u003EThe server must still verify that the authenticated user or application is allowed to access the resolved tenant.\u003C/p\u003E\n\u003Cp\u003ENever trust arbitrary tenant identifiers supplied by clients without applying the required validation and isolation rules.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-session-and-device-resolution\u0022\u003E13. Custom Session and Device Resolution\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates session identifier resolution from session validation.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EISessionIdResolver\nISessionValidator\nIDeviceResolver\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese interfaces have different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EComponent\u003C/th\u003E\n\u003Cth\u003EResponsibility\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDetermine which session identifier is supplied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionValidator\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidate the session\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIDeviceResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve device information\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe server supports multiple session identifier sources through internal resolvers, including cookies, bearer credentials, headers, and query parameters.\u003C/p\u003E\n\u003Cp\u003EThe active resolution behavior is controlled by the configured session resolution options.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-session-validator\u0022\u003ECustom Session Validator\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ISessionValidator, ApplicationSessionValidator\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA custom validator must preserve the relevant expiration, revocation, and security-state checks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-device-resolver\u0022\u003ECustom Device Resolver\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;IDeviceResolver, ApplicationDeviceResolver\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDevice resolution may affect session identification and security decisions.\u003C/p\u003E\n\u003Cp\u003ECustom implementations should produce consistent, trustworthy device information.\u003C/p\u003E\n\u003Cp\u003EAvoid replacing these services unless the application\u0027s requirements cannot be met through standard options.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-stores\u0022\u003E14. Custom Stores\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates domain behavior from persistence through store interfaces.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EISessionStore\nIRefreshTokenStore\nIRoleStore\nIUserRoleStore\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ESome stores are resolved through corresponding factory interfaces.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides persistence implementations in separate packages, including in-memory and Entity Framework Core implementations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-a-store-implementation\u0022\u003EChoosing a Store Implementation\u003C/h3\u003E\n\u003Cp\u003EUse in-memory implementations for suitable development, testing, or demonstration scenarios.\u003C/p\u003E\n\u003Cp\u003EUse durable persistence for production authentication state that must survive process restarts or be shared across application instances.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-store-requirements\u0022\u003ECustom Store Requirements\u003C/h3\u003E\n\u003Cp\u003EA custom store must preserve the semantics expected by the authentication services.\u003C/p\u003E\n\u003Cp\u003EDepending on the store, these may include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ECorrect session expiration handling.\u003C/li\u003E\n\u003Cli\u003EReliable revocation state.\u003C/li\u003E\n\u003Cli\u003ERefresh token consumption and replay protection.\u003C/li\u003E\n\u003Cli\u003EConsistent user and tenant scoping.\u003C/li\u003E\n\u003Cli\u003EAppropriate concurrency behavior.\u003C/li\u003E\n\u003Cli\u003EAtomic state transitions where required.\u003C/li\u003E\n\u003Cli\u003ECorrect deletion and lifecycle behavior.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example, refresh token rotation may depend on preventing two concurrent requests from successfully consuming the same token.\u003C/p\u003E\n\u003Cp\u003EA store implementation that does not enforce the required concurrency semantics can undermine the security of the refresh flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022store-registration\u0022\u003EStore Registration\u003C/h3\u003E\n\u003Cp\u003ECustom store registration depends on the specific store interface and its factory.\u003C/p\u003E\n\u003Cp\u003EDo not assume that replacing one store interface is sufficient when the runtime resolves stores through a factory.\u003C/p\u003E\n\u003Cp\u003EUse the relevant domain package\u0027s documented registration pattern.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-lifecycle-events\u0022\u003E15. Authentication Lifecycle Events\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides application-wide authentication event hooks through:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthEvents\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese hooks allow applications to react to authentication lifecycle events without replacing the authentication flow.\u003C/p\u003E\n\u003Cp\u003EThe current event options expose:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EOnAnyEvent\nOnUserLoggedIn\nOnUserLoggedOut\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-event\u0022\u003ELogin Event\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnUserLoggedIn = context =\u0026gt;\n {\n // Record a successful login.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-event\u0022\u003ELogout Event\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnUserLoggedOut = context =\u0026gt;\n {\n // Record a logout event.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022global-event-hook\u0022\u003EGlobal Event Hook\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnAnyEvent = context =\u0026gt;\n {\n // Process an authentication event.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe global hook receives an \u003Ccode\u003EIAuthEventContext\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022appropriate-event-uses\u0022\u003EAppropriate Event Uses\u003C/h3\u003E\n\u003Cp\u003ELifecycle events are suitable for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAudit logging.\u003C/li\u003E\n\u003Cli\u003EApplication metrics.\u003C/li\u003E\n\u003Cli\u003EMonitoring.\u003C/li\u003E\n\u003Cli\u003ENotifications.\u003C/li\u003E\n\u003Cli\u003ELightweight post-operation integration.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThey should not be used to implement critical authentication checks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022events-are-not-decision-hooks\u0022\u003EEvents Are Not Decision Hooks\u003C/h3\u003E\n\u003Cp\u003EThe documented event delegates run after their corresponding successful operations.\u003C/p\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EOnUserLoggedIn\u003C/code\u003E is not the place to decide whether the login should have been permitted.\u003C/p\u003E\n\u003Cp\u003EUse an appropriate authority or policy for security decisions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022avoid-complex-work-inside-events\u0022\u003EAvoid Complex Work Inside Events\u003C/h3\u003E\n\u003Cp\u003ELong-running or failure-prone external operations should generally be delegated to a reliable application service or message-processing mechanism.\u003C/p\u003E\n\u003Cp\u003EDo not make critical authentication behavior depend on an unreliable external notification system.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-jwt-signing-keys\u0022\u003E16. Custom JWT Signing Keys\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIJwtSigningKeyProvider\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server registers a development signing key provider as its default implementation.\u003C/p\u003E\n\u003Cp\u003EProduction applications should supply an appropriate signing key strategy.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddSingleton\u0026lt;IJwtSigningKeyProvider, ApplicationJwtSigningKeyProvider\u0026gt;();\nbuilder.Services.AddUltimateAuthServer();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EApplicationJwtSigningKeyProvider\u003C/code\u003E is an implementation supplied by the application.\u003C/p\u003E\n\u003Cp\u003EA production implementation should use appropriately protected signing keys and support the application\u0027s operational requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022signing-key-responsibilities\u0022\u003ESigning Key Responsibilities\u003C/h3\u003E\n\u003Cp\u003EConsider:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EKey confidentiality.\u003C/li\u003E\n\u003Cli\u003EKey rotation.\u003C/li\u003E\n\u003Cli\u003EKey identification.\u003C/li\u003E\n\u003Cli\u003EConsistent validation across resource servers.\u003C/li\u003E\n\u003Cli\u003ESecure key storage.\u003C/li\u003E\n\u003Cli\u003ERecovery and deployment procedures.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EDo not use development signing keys as a production security strategy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-customization\u0022\u003E17. Endpoint Customization\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides an advanced endpoint configuration hook:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.OnConfigureEndpoints\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe hook receives:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EIEndpointRouteBuilder\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.OnConfigureEndpoints = endpoints =\u0026gt;\n {\n // Apply supported application-specific\n // endpoint configuration here.\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe hook is invoked after UltimateAuth registers its default endpoints.\u003C/p\u003E\n\u003Cp\u003EIt can support advanced endpoint integration, but it should not be used to remove, remap, or weaken the security requirements of UltimateAuth endpoints.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022prefer-endpoint-options-first\u0022\u003EPrefer Endpoint Options First\u003C/h3\u003E\n\u003Cp\u003EFor ordinary endpoint configuration, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Endpoints\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.Authentication = true;\n options.Endpoints.Credentials = true;\n options.Endpoints.Authorization = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe advanced endpoint hook is intended for cases that cannot be addressed through the supported endpoint options.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-sources-and-precedence\u0022\u003E18. Configuration Sources and Precedence\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth integrates with the standard ASP.NET Core configuration system.\u003C/p\u003E\n\u003Cp\u003EFor the server, the configuration section is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Server\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor the client:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Client\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor Resource APIs:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:ResourceApi\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022registration-order\u0022\u003ERegistration Order\u003C/h3\u003E\n\u003Cp\u003EThe standard server registration applies:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EOption type defaults.\u003C/li\u003E\n\u003Cli\u003EThe \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E configuration delegate.\u003C/li\u003E\n\u003Cli\u003EValues bound from \u003Ccode\u003EUltimateAuth:Server\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EPost-configuration processing.\u003C/li\u003E\n\u003Cli\u003ERegistered options validation.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Server\u0026quot;: {\n \u0026quot;Login\u0026quot;: {\n \u0026quot;MaxFailedAttempts\u0026quot;: 3\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe effective configured value is \u003Ccode\u003E3\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe configuration binding occurs after the registration delegate.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022environment-variables\u0022\u003EEnvironment Variables\u003C/h3\u003E\n\u003Cp\u003EASP.NET Core supports hierarchical configuration keys through double underscores.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Server__Login__MaxFailedAttempts=3\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis corresponds to:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Server:Login:MaxFailedAttempts\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEnvironment-specific configuration can therefore override values without requiring changes to application code.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022environment-specific-files\u0022\u003EEnvironment-Specific Files\u003C/h3\u003E\n\u003Cp\u003EStandard ASP.NET Core applications commonly use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Eappsettings.json\nappsettings.Development.json\nappsettings.Staging.json\nappsettings.Production.json\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe active environment determines which environment-specific file is loaded.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EASPNETCORE_ENVIRONMENT=Production\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe final value depends on the configured ASP.NET Core configuration providers and their precedence.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-binding-does-not-replace-mode-resolution\u0022\u003EConfiguration Binding Does Not Replace Mode Resolution\u003C/h3\u003E\n\u003Cp\u003EA value supplied through \u003Ccode\u003Eappsettings.json\u003C/code\u003E becomes part of the configured options.\u003C/p\u003E\n\u003Cp\u003EIt may still be replaced later when UltimateAuth applies mode defaults.\u003C/p\u003E\n\u003Cp\u003EFor settings explicitly controlled by mode templates, use \u003Ccode\u003EConfigureMode()\u003C/code\u003E when the desired behavior must apply to a specific mode.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022startup-validation-and-runtime-safety\u0022\u003E19. Startup Validation and Runtime Safety\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth validates server options through registered \u003Ccode\u003EIValidateOptions\u0026lt;UAuthServerOptions\u0026gt;\u003C/code\u003E implementations.\u003C/p\u003E\n\u003Cp\u003EThe server uses:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EValidateOnStart()\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows many invalid configurations to fail during application startup.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EInvalid endpoint base paths.\u003C/li\u003E\n\u003Cli\u003EInvalid or unsupported allowed modes.\u003C/li\u003E\n\u003Cli\u003EInvalid session lifetimes.\u003C/li\u003E\n\u003Cli\u003EIncompatible token and session lifetime constraints.\u003C/li\u003E\n\u003Cli\u003EInvalid login settings.\u003C/li\u003E\n\u003Cli\u003EInvalid tenant configuration.\u003C/li\u003E\n\u003Cli\u003EInvalid pagination settings.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-has-boundaries\u0022\u003EValidation Has Boundaries\u003C/h3\u003E\n\u003Cp\u003EStartup validation applies to the configured options according to the registered validators.\u003C/p\u003E\n\u003Cp\u003EIt does not automatically prove that every custom dependency injection replacement is safe.\u003C/p\u003E\n\u003Cp\u003EIt also does not guarantee that every mode-specific override has been validated against all possible security invariants.\u003C/p\u003E\n\u003Cp\u003ECustom implementations must preserve the relevant contracts and security requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-validation-strategy\u0022\u003ERecommended Validation Strategy\u003C/h3\u003E\n\u003Cp\u003EFor advanced configurations:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EVerify that the application starts successfully.\u003C/li\u003E\n\u003Cli\u003ETest each enabled authentication mode.\u003C/li\u003E\n\u003Cli\u003ETest login, refresh, validation, and logout.\u003C/li\u003E\n\u003Cli\u003ETest session expiration and revocation.\u003C/li\u003E\n\u003Cli\u003ETest tenant isolation.\u003C/li\u003E\n\u003Cli\u003ETest authorization denial paths.\u003C/li\u003E\n\u003Cli\u003ETest concurrent refresh requests where applicable.\u003C/li\u003E\n\u003Cli\u003EVerify that effective options contain the intended values.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThese checks are especially important when customizing authorities, validators, stores, or authentication mode behavior.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-configuration-mistakes\u0022\u003E20. Common Configuration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuring-core-options-separately-from-server-options\u0022\u003EConfiguring Core Options Separately from Server Options\u003C/h3\u003E\n\u003Cp\u003EWhen using \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E, configure Core-defined behavior through \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EDo not expect a separate \u003Ccode\u003EUAuthOptions\u003C/code\u003E configuration to override the server\u0027s composed options.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-global-values-always-survive-mode-defaults\u0022\u003EAssuming Global Values Always Survive Mode Defaults\u003C/h3\u003E\n\u003Cp\u003EMode templates can overwrite values such as access token lifetime.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EConfigureMode()\u003C/code\u003E for explicit mode-specific customization.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-allowedmodes-as-mode-selection\u0022\u003ETreating AllowedModes as Mode Selection\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E restricts permitted modes.\u003C/p\u003E\n\u003Cp\u003EIt does not replace \u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enabling-an-unsupported-mode\u0022\u003EEnabling an Unsupported Mode\u003C/h3\u003E\n\u003Cp\u003EAn enum value or default template does not establish that a mode is ready for production.\u003C/p\u003E\n\u003Cp\u003EUse only modes supported by the current implementation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022replacing-security-components-unnecessarily\u0022\u003EReplacing Security Components Unnecessarily\u003C/h3\u003E\n\u003Cp\u003EReplacing a validator or authority can change fundamental authentication behavior.\u003C/p\u003E\n\u003Cp\u003EPrefer options and policies when they satisfy the requirement.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-every-di-service-is-replaceable\u0022\u003EAssuming Every DI Service Is Replaceable\u003C/h3\u003E\n\u003Cp\u003EDifferent services use different registration patterns.\u003C/p\u003E\n\u003Cp\u003EReview the actual registration behavior before replacing a service.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-events-for-authorization-decisions\u0022\u003EUsing Events for Authorization Decisions\u003C/h3\u003E\n\u003Cp\u003ELifecycle events are for post-operation reactions.\u003C/p\u003E\n\u003Cp\u003EUse authorities and policies for decisions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ignoring-store-concurrency\u0022\u003EIgnoring Store Concurrency\u003C/h3\u003E\n\u003Cp\u003EAuthentication stores must preserve the required consistency and atomicity semantics.\u003C/p\u003E\n\u003Cp\u003EThis is particularly important for refresh token rotation and revocation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-runtime-overrides-receive-full-startup-validation\u0022\u003EAssuming Runtime Overrides Receive Full Startup Validation\u003C/h3\u003E\n\u003Cp\u003EMode-specific overrides are applied during effective-options construction.\u003C/p\u003E\n\u003Cp\u003EValidate their results through tests and appropriate application safeguards.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022advanced-configuration-reference\u0022\u003E21. Advanced Configuration Reference\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMechanism\u003C/th\u003E\n\u003Cth\u003EAPI / Type\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EServer configuration\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBase server settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMode customization\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApply mode-specific overrides\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEffective configuration\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIEffectiveServerOptionsProvider\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve effective server settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEffective result\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EEffectiveUAuthServerOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolved mode and options\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMode selection\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve mode from application profile\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ELogin decisions\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EILoginAuthority\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEvaluate login decisions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAuthentication authority\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIAuthAuthority\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication security decisions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess authority\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIAccessAuthority\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAccess decisions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ETenant identification\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EITenantIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenant identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession validation\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionValidator\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EValidate sessions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession identification\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionIdResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve session identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDevice identification\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIDeviceResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve device information\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESigning keys\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIJwtSigningKeyProvider\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESupply JWT signing keys\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ELifecycle events\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EObserve completed authentication operations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEndpoint customization\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnConfigureEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAdvanced endpoint configuration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession persistence\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EISessionStore\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession storage\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh persistence\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIRefreshTokenStore\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh token storage\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-extension-strategy\u0022\u003E22. Recommended Extension Strategy\u003C/h2\u003E\n\u003Cp\u003EWhen an application requires customization, follow this order:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse existing options.\u003C/strong\u003E Prefer supported configuration properties.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse mode overrides.\u003C/strong\u003E Apply \u003Ccode\u003EConfigureMode()\u003C/code\u003E when behavior must differ by authentication mode.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse application policies.\u003C/strong\u003E Extend authorization rules without replacing the authorization pipeline.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse lifecycle events.\u003C/strong\u003E Implement logging, monitoring, and notifications without changing authentication decisions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUse focused resolvers or providers.\u003C/strong\u003E Customize tenant identification, signing keys, or other specific infrastructure concerns.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReplace authorities, validators, or stores only when necessary.\u003C/strong\u003E Preserve all relevant security invariants and verify the implementation through tests.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe objective is not to replace as much of UltimateAuth as possible.\u003C/p\u003E\n\u003Cp\u003EIt is to customize the smallest component necessary while retaining the guarantees of the surrounding system.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/overview\u0022\u003EConfiguration Overview\u003C/a\u003E \u2014 Understand registration, configuration sources, and architecture.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/server-options\u0022\u003EServer Options\u003C/a\u003E \u2014 Configure authentication and server security behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure SDK flows and client behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E \u2014 Understand supported authentication modes.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/authorization\u0022\u003EAuthorization\u003C/a\u003E \u2014 Use the client authorization API.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/session-management\u0022\u003ESession Management\u003C/a\u003E \u2014 Manage sessions and revocation.\u003C/li\u003E\n\u003C/ul\u003E\n", "Headings": [ { "Id": "configuration-versus-extensibility", @@ -78,11 +78,6 @@ "Text": "Hybrid", "Level": 1 }, - { - "Id": "unsupported-modes", - "Text": "Unsupported Modes", - "Level": 1 - }, { "Id": "inspect-effective-options", "Text": "7. Inspect Effective Options", @@ -374,6 +369,6 @@ "Level": 0 } ], - "SourceHash": "A6F71EFC63B97437028837DC33D22802E26096990699AA0244C88B85456294F4", + "SourceHash": "9EF03EF78E9B596042535F365E90518F15909868B7D9E77418375A7485083EEF", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/client-options.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/client-options.json index c64f4a46..bcefd663 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/client-options.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/client-options.json @@ -1,7 +1,7 @@ { "Slug": "configuration/client-options", "Title": "Client Options", - "Html": "\n\u003Cp\u003E\u003Ccode\u003EUAuthClientOptions\u003C/code\u003E controls how an UltimateAuth client communicates with the authentication server, executes authentication flows, maintains client-side authentication state, and responds when authentication must be renewed.\u003C/p\u003E\n\u003Cp\u003EThe client configuration is intentionally separate from server security configuration.\u003C/p\u003E\n\u003Cp\u003EThe server determines which authentication operations are permitted, how credentials are validated, and when sessions expire. The client determines how those operations are initiated and how the application responds to their outcomes.\u003C/p\u003E\n\u003Cp\u003EThis guide covers the current client configuration API, platform integration, defaults, practical examples, and important security considerations.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022register-the-ultimateauth-client\u0022\u003E1. Register the UltimateAuth Client\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides a platform-independent client SDK and platform-specific adapters.\u003C/p\u003E\n\u003Cp\u003EFor Blazor applications, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAddUltimateAuthClientBlazor()\u003C/code\u003E registers the underlying client services and the Blazor-specific infrastructure, including browser transport, storage, device identification, and authentication state integration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022core-client-registration\u0022\u003ECore Client Registration\u003C/h3\u003E\n\u003Cp\u003EThe platform-independent registration method is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClient(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis registers the shared client SDK.\u003C/p\u003E\n\u003Cp\u003EHowever, it does not provide every platform-specific implementation needed to run authentication flows.\u003C/p\u003E\n\u003Cp\u003EApplications should use an appropriate platform adapter rather than relying on the core client registration alone.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022do-not-register-both-client-methods\u0022\u003EDo Not Register Both Client Methods\u003C/h3\u003E\n\u003Cp\u003EWhen using:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Edo not also call:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClient();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Blazor registration already includes the core client services.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-and-client-in-one-application\u0022\u003EServer and Client in One Application\u003C/h3\u003E\n\u003Cp\u003EA Blazor Server application can register both UltimateAuth Server and the Blazor client adapter:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromDays(7);\n});\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n options.AutoDetectApplicationProfile = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese registrations configure different components.\u003C/p\u003E\n\u003Cp\u003EThe server controls authentication security and lifecycle rules.\u003C/p\u003E\n\u003Cp\u003EThe client controls the application-side integration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-options-architecture\u0022\u003E2. Client Options Architecture\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthClientOptions\u003C/code\u003E contains the following properties:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EType\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifies the application environment\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ebool\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnables automatic profile detection\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Estring?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDefault navigation destination after authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientEndpointOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication endpoint paths\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientLoginFlowOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin flow configuration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientPkceLoginFlowOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE flow configuration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoRefresh\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientAutoRefreshOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBackground refresh coordination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientReauthOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReauthentication behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientMultiTenantOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant propagation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EStateEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthStateEventOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication state event handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientResourceOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EProtected Resource API origin and browser credential handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese options are configured through the same \u003Ccode\u003EUAuthClientOptions\u003C/code\u003E instance.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/dashboard\u0026quot;;\n options.Pkce.Enabled = true;\n options.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profiles\u0022\u003E3. Application Profiles\u003C/h2\u003E\n\u003Cp\u003EThe application profile identifies the application environment and influences authentication flow behavior.\u003C/p\u003E\n\u003Cp\u003EConfigure it through:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.ApplicationProfile\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUltimateAuth defines profiles including:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProfile\u003C/th\u003E\n\u003Cth\u003ETypical application\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInteractive Blazor Server applications\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorWasm\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBrowser-hosted Blazor WebAssembly\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaui\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E.NET MAUI applications\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EWebServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETraditional ASP.NET Core web applications\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAPI-oriented clients\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUltimateAuth Hub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENotSpecified\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EProfile not explicitly selected\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EDifferent application profiles may result in different authentication modes on the server.\u003C/p\u003E\n\u003Cp\u003EFor example, the default server mode resolver maps Blazor Server to \u003Ccode\u003EPureOpaque\u003C/code\u003E and Blazor WebAssembly to \u003Ccode\u003EHybrid\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe application profile does not itself authorize an authentication mode. The server must support and permit the resolved mode.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-application-profile-detection\u0022\u003E4. Automatic Application Profile Detection\u003C/h2\u003E\n\u003Cp\u003EAutomatic profile detection is enabled by default:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoDetectApplicationProfile = true;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen enabled, UltimateAuth detects the application environment if \u003Ccode\u003EApplicationProfile\u003C/code\u003E remains \u003Ccode\u003ENotSpecified\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe current detector checks for:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EUAuthHub registration.\u003C/li\u003E\n\u003Cli\u003E.NET MAUI.\u003C/li\u003E\n\u003Cli\u003EBlazor WebAssembly.\u003C/li\u003E\n\u003Cli\u003EBlazor Server.\u003C/li\u003E\n\u003Cli\u003EA fallback to \u003Ccode\u003EWebServer\u003C/code\u003E.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-configuration\u0022\u003EDefault Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENo explicit profile is required for ordinary supported environments where detection succeeds.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022manual-configuration\u0022\u003EManual Configuration\u003C/h3\u003E\n\u003Cp\u003EFor applications that need predictable behavior independent of assembly-based detection:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.BlazorWasm;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EManual configuration can be useful for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESpecialized hosting environments.\u003C/li\u003E\n\u003Cli\u003EIntegration tests.\u003C/li\u003E\n\u003Cli\u003EApplications with multiple hosting models.\u003C/li\u003E\n\u003Cli\u003ECases where assembly-based detection is ambiguous.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-validation-rule\u0022\u003EImportant Validation Rule\u003C/h3\u003E\n\u003Cp\u003EThis configuration is invalid:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.NotSpecified;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen automatic detection is disabled, an explicit application profile must be provided.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022explicit-profiles-take-precedence\u0022\u003EExplicit Profiles Take Precedence\u003C/h3\u003E\n\u003Cp\u003EThe post-configuration detector does not replace a profile that has already been explicitly selected.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe explicit profile is retained even when automatic detection remains enabled.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022detection-limitations\u0022\u003EDetection Limitations\u003C/h3\u003E\n\u003Cp\u003EThe current detector uses service registration and loaded assemblies to identify the environment.\u003C/p\u003E\n\u003Cp\u003EAssembly-based detection may not be completely reliable in every hosting arrangement.\u003C/p\u003E\n\u003Cp\u003EFor complex Blazor Web App hosting scenarios, explicitly configuring the profile can make authentication behavior easier to reason about.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-configuration\u0022\u003E5. Endpoint Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Endpoints\u003C/code\u003E defines the endpoint paths used by the client SDK.\u003C/p\u003E\n\u003Cp\u003EThe default base path is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E/auth\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-a-remote-authentication-server\u0022\u003EConfigure a Remote Authentication Server\u003C/h3\u003E\n\u003Cp\u003EFor a client communicating with a separately hosted UAuthHub:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor an application using same-origin authentication endpoints:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe base path must match the deployed authentication server\u0027s routing configuration.\u003C/p\u003E\n\u003Cp\u003EChanging a client endpoint does not create or expose the corresponding server endpoint.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-endpoint-paths\u0022\u003EDefault Endpoint Paths\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBasePath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/auth\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/login\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryLogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/try-login\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogout\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/logout\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefresh\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/refresh\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/reauth\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValidate\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/validate\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkceAuthorize\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/pkce/authorize\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkceTryComplete\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/pkce/try-complete\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkceComplete\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/pkce/complete\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubLoginPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/uauthhub/entry\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022customize-individual-paths\u0022\u003ECustomize Individual Paths\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n options.Endpoints.Login = \u0026quot;/login\u0026quot;;\n options.Endpoints.Logout = \u0026quot;/logout\u0026quot;;\n options.Endpoints.Refresh = \u0026quot;/refresh\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese values should reflect the actual routes registered by UltimateAuth Server.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022required-endpoint-validation\u0022\u003ERequired Endpoint Validation\u003C/h3\u003E\n\u003Cp\u003EThe client options validator requires:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Login\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Logout\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Refresh\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Validate\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese properties must not be null, empty, or whitespace-only.\u003C/p\u003E\n\u003Cp\u003EThe current validator does not apply the same required-value checks to every optional endpoint path.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022remote-clients-and-browser-security\u0022\u003ERemote Clients and Browser Security\u003C/h3\u003E\n\u003Cp\u003EWhen using a remote authentication server, also consider:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EHTTPS.\u003C/li\u003E\n\u003Cli\u003ECross-origin request configuration.\u003C/li\u003E\n\u003Cli\u003ECookie \u003Ccode\u003ESameSite\u003C/code\u003E and \u003Ccode\u003ESecure\u003C/code\u003E attributes.\u003C/li\u003E\n\u003Cli\u003EAllowed client origins.\u003C/li\u003E\n\u003Cli\u003EPKCE redirects.\u003C/li\u003E\n\u003Cli\u003EBrowser credential policies.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA correct endpoint URL alone does not guarantee that cross-origin authentication will work.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-configuration\u0022\u003EResource API Configuration\u003C/h3\u003E\n\u003Cp\u003EAuthentication endpoints and application resource endpoints serve different purposes.\u003C/p\u003E\n\u003Cp\u003EAn application may authenticate through UAuthHub while retrieving business data from a separately deployed Resource API.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides \u003Ccode\u003Eoptions.Resource\u003C/code\u003E to configure these requests independently.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client is available through \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource\n .GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch4 id=\u0022resource-options\u0022\u003EResource Options\u003C/h4\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.BaseAddress\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResource API origin; \u003Ccode\u003Enull\u003C/code\u003E uses the application\u0027s origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.Credentials\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBrowser credential transmission policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch4 id=\u0022base-address-validation\u0022\u003EBase Address Validation\u003C/h4\u003E\n\u003Cp\u003EWhen configured, \u003Ccode\u003EResource.BaseAddress\u003C/code\u003E must be an absolute HTTP or HTTPS origin.\u003C/p\u003E\n\u003Cp\u003EHTTPS is required except for loopback development addresses.\u003C/p\u003E\n\u003Cp\u003EThe address must not contain an additional path, query string, fragment, or embedded credentials.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIndividual resource paths are supplied when making requests:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch4 id=\u0022credential-modes\u0022\u003ECredential Modes\u003C/h4\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthResourceCredentialsMode\u003C/code\u003E supports four options:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatically select the appropriate browser credential policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESameOrigin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude browser credentials only for same-origin requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EInclude\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude browser credentials for the configured Resource API origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOmit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDo not include browser credentials\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor example, a separate Resource API that requires cross-origin cookies may use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.Include;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource API must permit the relevant browser origin and support the required CORS and cookie configuration.\u003C/p\u003E\n\u003Cp\u003ECredential configuration does not bypass browser security restrictions or replace server-side authentication and authorization.\u003C/p\u003E\n\u003Ch4 id=\u0022resource-requests-and-authentication-lifecycle\u0022\u003EResource Requests and Authentication Lifecycle\u003C/h4\u003E\n\u003Cp\u003EResource requests use the browser transport in the Blazor integration.\u003C/p\u003E\n\u003Cp\u003EThey support request cancellation, origin validation, and redirect protection.\u003C/p\u003E\n\u003Cp\u003EResource requests return \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E or \u003Ccode\u003EUAuthResult\u003C/code\u003E, depending on the operation.\u003C/p\u003E\n\u003Cp\u003EThe current Resource Client does not automatically refresh authentication and retry a request after receiving a \u003Ccode\u003E401 Unauthorized\u003C/code\u003E response.\u003C/p\u003E\n\u003Cp\u003EFor a complete explanation, see \u003Ca href=\u0022/docs/client-sdk/resource-api-requests\u0022\u003EResource API Requests\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-flow-options\u0022\u003E6. Login Flow Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Login\u003C/code\u003E controls client-side login behavior.\u003C/p\u003E\n\u003Cp\u003EThe available properties are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin-specific return destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowCredentialPost\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAllow direct credential posting\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-login-navigation\u0022\u003EConfigure Login Navigation\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe login-specific return URL is used when the login flow does not provide a more specific destination.\u003C/p\u003E\n\u003Cp\u003EIf it is not set, UltimateAuth can fall back to \u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E or the current location according to the flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-credential-posting\u0022\u003EDirect Credential Posting\u003C/h3\u003E\n\u003Cp\u003EThe default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.AllowCredentialPost = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an important security setting.\u003C/p\u003E\n\u003Cp\u003EDirectly posting user credentials is not appropriate for public browser clients such as Blazor WebAssembly applications.\u003C/p\u003E\n\u003Cp\u003EPublic clients should use the supported PKCE-based login flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022trusted-server-hosted-clients\u0022\u003ETrusted Server-Hosted Clients\u003C/h3\u003E\n\u003Cp\u003EA trusted server-hosted application may explicitly enable direct credential posting where its authentication architecture requires it:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n options.Login.AllowCredentialPost = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not enable this setting for a public client merely to simplify login implementation.\u003C/p\u003E\n\u003Cp\u003EThe server still determines whether the requested authentication operation is permitted.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pkce-configuration\u0022\u003E7. PKCE Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Pkce\u003C/code\u003E controls client-side PKCE login behavior.\u003C/p\u003E\n\u003Cp\u003EPKCE allows a public client to complete an authorization flow without relying on a confidential client secret.\u003C/p\u003E\n\u003Cp\u003EThe current options are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable client PKCE support\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPost-login return destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoRedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatically navigate after beginning PKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnAuthorized\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECallback after the authorization response is issued\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022basic-configuration\u0022\u003EBasic Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Pkce.Enabled = true;\n options.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n options.Pkce.AutoRedirect = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-redirect\u0022\u003EDisable Automatic Redirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Pkce.AutoRedirect = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen \u003Ccode\u003EAutoRedirect\u003C/code\u003E is disabled, \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E does not automatically navigate to the next location.\u003C/p\u003E\n\u003Cp\u003EThe application is responsible for handling navigation.\u003C/p\u003E\n\u003Cp\u003EThis can be useful when integrating UltimateAuth into an existing routing or navigation system.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-callback\u0022\u003EAuthorization Callback\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Pkce.OnAuthorized = response =\u0026gt;\n {\n // Inspect or process the authorization response.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe callback receives:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EPkceAuthorizeResponse\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIt runs after the authorization response is issued and before the normal Hub navigation.\u003C/p\u003E\n\u003Cp\u003EUse the callback for application-specific integration, not to bypass PKCE verification.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-and-server-pkce-settings-are-different\u0022\u003EClient and Server PKCE Settings Are Different\u003C/h3\u003E\n\u003Cp\u003EClient configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.AutoRedirect = true;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EServer configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.AuthorizationCodeLifetimeSeconds = 120;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client controls how the flow is initiated and navigated.\u003C/p\u003E\n\u003Cp\u003EThe server controls the authorization code\u0027s validity and verification.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022return-url-configuration\u0022\u003E8. Return URL Configuration\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports several return URL configuration points.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EGlobal default for interactive authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin-specific default\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE-specific default\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022global-default\u0022\u003EGlobal Default\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/dashboard\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022flow-specific-defaults\u0022\u003EFlow-Specific Defaults\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n options.Login.ReturnUrl = \u0026quot;/account\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFlow-specific values allow different authentication paths to use different destinations.\u003C/p\u003E\n\u003Cp\u003EAn explicitly supplied return URL for an individual operation may take precedence over these defaults.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003EReturn URLs are navigation destinations and must be treated carefully.\u003C/p\u003E\n\u003Cp\u003EDo not redirect users to arbitrary external URLs without appropriate validation.\u003C/p\u003E\n\u003Cp\u003EOpen redirects can be abused for phishing and other attacks.\u003C/p\u003E\n\u003Cp\u003EPrefer local application routes unless cross-origin navigation is an intentional and validated part of the authentication architecture.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh\u0022\u003E9. Automatic Refresh\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.AutoRefresh\u003C/code\u003E controls background refresh coordination.\u003C/p\u003E\n\u003Cp\u003EThe available properties are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnables or disables automatic background refresh\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInterval between background refresh attempts\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-automatic-refresh\u0022\u003EConfigure Automatic Refresh\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoRefresh.Enabled = true;\n options.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-refresh\u0022\u003EDisable Automatic Refresh\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoRefresh.Enabled = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-interval\u0022\u003EDefault Interval\u003C/h3\u003E\n\u003Cp\u003EIf \u003Ccode\u003EInterval\u003C/code\u003E is not supplied, the client registration applies:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoRefresh.Interval ??= TimeSpan.FromMinutes(5);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe resulting default interval is five minutes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022platform-behavior\u0022\u003EPlatform Behavior\u003C/h3\u003E\n\u003Cp\u003EThe effective \u003Ccode\u003EEnabled\u003C/code\u003E setting should be considered together with the platform\u0027s post-configuration and session coordination behavior.\u003C/p\u003E\n\u003Cp\u003EThe current Blazor session coordinator checks \u003Ccode\u003EAutoRefresh.Enabled\u003C/code\u003E before starting its background loop.\u003C/p\u003E\n\u003Cp\u003EWhen enabled, it periodically invokes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClient.Flows.RefreshAsync(true);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-is-not-a-security-policy\u0022\u003EAutomatic Refresh Is Not a Security Policy\u003C/h3\u003E\n\u003Cp\u003EAutomatic refresh does not control:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EServer session lifetime.\u003C/li\u003E\n\u003Cli\u003ERefresh token lifetime.\u003C/li\u003E\n\u003Cli\u003ESession revocation.\u003C/li\u003E\n\u003Cli\u003ECredential recovery policies.\u003C/li\u003E\n\u003Cli\u003ERefresh token replay protection.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese remain server-side responsibilities.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-does-not-guarantee-session-continuity\u0022\u003EAutomatic Refresh Does Not Guarantee Session Continuity\u003C/h3\u003E\n\u003Cp\u003EBackground refresh may fail because:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe session has expired.\u003C/li\u003E\n\u003Cli\u003EThe refresh credential has been revoked.\u003C/li\u003E\n\u003Cli\u003EThe browser is suspended.\u003C/li\u003E\n\u003Cli\u003ENetwork connectivity is unavailable.\u003C/li\u003E\n\u003Cli\u003EThe server requires reauthentication.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EAutomatic refresh is a convenience and continuity mechanism, not a guarantee that authentication remains valid indefinitely.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022coordinator-lifecycle\u0022\u003ECoordinator Lifecycle\u003C/h3\u003E\n\u003Cp\u003EThe Blazor adapter provides an \u003Ccode\u003EISessionCoordinator\u003C/code\u003E implementation.\u003C/p\u003E\n\u003Cp\u003EThe coordinator must be started by the application\u0027s supported initialization lifecycle.\u003C/p\u003E\n\u003Cp\u003ESetting \u003Ccode\u003EAutoRefresh.Enabled = true\u003C/code\u003E does not mean that a background task automatically runs without the coordinator being started.\u003C/p\u003E\n\u003Cp\u003EApplications should follow the client initialization guidance for their hosting model.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022reauthentication-options\u0022\u003E10. Reauthentication Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Reauth\u003C/code\u003E controls how the Blazor session coordinator responds when refresh reports that reauthentication is required.\u003C/p\u003E\n\u003Cp\u003EThe available properties are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBehavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauthBehavior.Redirect\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirectPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-behaviors\u0022\u003EAvailable Behaviors\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EReauthBehavior.Redirect\nReauthBehavior.None\nReauthBehavior.RaiseEvent\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022redirect\u0022\u003ERedirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Reauth.Behavior = ReauthBehavior.Redirect;\n options.Reauth.RedirectPath = \u0026quot;/login\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen the coordinator receives a \u003Ccode\u003EReauthRequired\u003C/code\u003E refresh outcome, it navigates to the configured redirect path.\u003C/p\u003E\n\u003Cp\u003EIf \u003Ccode\u003ERedirectPath\u003C/code\u003E is null, the coordinator falls back to \u003Ccode\u003EEndpoints.Login\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe current Blazor coordinator uses forced navigation for this redirect.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022raise-an-event\u0022\u003ERaise an Event\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows an application to handle reauthentication through the coordinator\u0027s \u003Ccode\u003EReauthRequired\u003C/code\u003E event.\u003C/p\u003E\n\u003Cp\u003EFor example, an application may display a reauthentication dialog rather than immediately navigating.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022no-automatic-action\u0022\u003ENo Automatic Action\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Reauth.Behavior = ReauthBehavior.None;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith \u003Ccode\u003ENone\u003C/code\u003E, the coordinator does not automatically redirect or raise its reauthentication event.\u003C/p\u003E\n\u003Cp\u003EThe application must still handle unauthenticated states appropriately.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important\u0022\u003EImportant\u003C/h3\u003E\n\u003Cp\u003EReauthentication behavior does not make an expired or revoked session valid.\u003C/p\u003E\n\u003Cp\u003EIt only controls how the client responds when authentication must be reestablished.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022multi-tenant-client-configuration\u0022\u003E11. Multi-Tenant Client Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.MultiTenant\u003C/code\u003E controls tenant propagation from the client to the authentication server.\u003C/p\u003E\n\u003Cp\u003EThe client does not independently authorize or resolve tenant ownership.\u003C/p\u003E\n\u003Cp\u003EIt carries tenant context using the configured transport.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable tenant propagation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant identifier to propagate\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETransport\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ETenantTransport.None\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant transport mechanism\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-transports\u0022\u003EAvailable Transports\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETenantTransport.None\nTenantTransport.Header\nTenantTransport.Route\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022header-based-tenant-propagation\u0022\u003EHeader-Based Tenant Propagation\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.Tenant = \u0026quot;tenant-a\u0026quot;;\n options.MultiTenant.Transport = TenantTransport.Header;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server must be configured to resolve tenant information from the corresponding transport.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.EnableHeader = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022route-based-tenant-propagation\u0022\u003ERoute-Based Tenant Propagation\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.Tenant = \u0026quot;tenant-a\u0026quot;;\n options.MultiTenant.Transport = TenantTransport.Route;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server must expose routes compatible with tenant-based routing.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-boundary\u0022\u003ESecurity Boundary\u003C/h3\u003E\n\u003Cp\u003EA client-provided tenant identifier is not proof of tenant membership.\u003C/p\u003E\n\u003Cp\u003EThe server must validate the resolved tenant and enforce tenant isolation.\u003C/p\u003E\n\u003Cp\u003ENever rely on client-side tenant selection as an authorization boundary.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-state-events\u0022\u003E12. Authentication State Events\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.StateEvents\u003C/code\u003E controls how the client processes authentication-related state events.\u003C/p\u003E\n\u003Cp\u003EThe available property is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.StateEvents.HandlingMode\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthStateEventHandlingMode.Patch\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-modes\u0022\u003EAvailable Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPatch\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApply a local authentication state update\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValidate\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevalidate authentication state after the event\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENone\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDo not update authentication state in response to the event\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022patch\u0022\u003EPatch\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EPatch\u003C/code\u003E is the default.\u003C/p\u003E\n\u003Cp\u003EIt allows the client to update local state without performing a full authentication validation for every event.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validate\u0022\u003EValidate\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Validate;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EValidate\u003C/code\u003E causes the client to revalidate authentication state in response to events.\u003C/p\u003E\n\u003Cp\u003EThis may introduce additional requests but can be appropriate when the application prefers server-confirmed state updates.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022none\u0022\u003ENone\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.None;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ENone\u003C/code\u003E disables automatic authentication state updates in response to these events.\u003C/p\u003E\n\u003Cp\u003EApplications using this mode must provide any required state synchronization through other mechanisms.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022local-events-are-not-distributed-notifications\u0022\u003ELocal Events Are Not Distributed Notifications\u003C/h3\u003E\n\u003Cp\u003EClient state events do not automatically notify every browser, device, or application instance.\u003C/p\u003E\n\u003Cp\u003EFor example, an administrator changing a user\u0027s role does not automatically push an event to that user\u0027s open browser.\u003C/p\u003E\n\u003Cp\u003EDistributed synchronization requires additional application infrastructure.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-from-appsettings.json\u0022\u003E13. Configuration from appsettings.json\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth Client binds the configuration section:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Client\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Client\u0026quot;: {\n \u0026quot;AutoDetectApplicationProfile\u0026quot;: true,\n \u0026quot;DefaultReturnUrl\u0026quot;: \u0026quot;/dashboard\u0026quot;,\n \u0026quot;Endpoints\u0026quot;: {\n \u0026quot;BasePath\u0026quot;: \u0026quot;https://auth.example.com/auth\u0026quot;\n },\n \u0026quot;Pkce\u0026quot;: {\n \u0026quot;Enabled\u0026quot;: true,\n \u0026quot;ReturnUrl\u0026quot;: \u0026quot;/dashboard\u0026quot;,\n \u0026quot;AutoRedirect\u0026quot;: true\n },\n \u0026quot;AutoRefresh\u0026quot;: {\n \u0026quot;Enabled\u0026quot;: true,\n \u0026quot;Interval\u0026quot;: \u0026quot;00:05:00\u0026quot;\n },\n \u0026quot;Reauth\u0026quot;: {\n \u0026quot;Behavior\u0026quot;: \u0026quot;Redirect\u0026quot;,\n \u0026quot;RedirectPath\u0026quot;: \u0026quot;/login\u0026quot;\n },\n \u0026quot;StateEvents\u0026quot;: {\n \u0026quot;HandlingMode\u0026quot;: \u0026quot;Patch\u0026quot;\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe example uses the standard ASP.NET Core configuration binding conventions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-precedence\u0022\u003EConfiguration Precedence\u003C/h3\u003E\n\u003Cp\u003EThe registration pipeline applies:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EOption type defaults.\u003C/li\u003E\n\u003Cli\u003EThe configuration delegate.\u003C/li\u003E\n\u003Cli\u003EValues from \u003Ccode\u003EUltimateAuth:Client\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EPost-configuration processing.\u003C/li\u003E\n\u003Cli\u003ERegistered options validation when the options are resolved.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Client\u0026quot;: {\n \u0026quot;DefaultReturnUrl\u0026quot;: \u0026quot;/dashboard\u0026quot;\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe configured return URL becomes \u003Ccode\u003E/dashboard\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022environment-variables\u0022\u003EEnvironment Variables\u003C/h3\u003E\n\u003Cp\u003EASP.NET Core supports double underscores for hierarchical configuration keys.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Client__Endpoints__BasePath=https://auth.example.com/auth\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis corresponds to:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Client:Endpoints:BasePath\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUse environment-specific configuration for deployment-dependent values such as authentication server addresses and application return paths.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-options-validation\u0022\u003E14. Client Options Validation\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth registers validators for:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClientOptions\nUAuthClientEndpointOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profile-validation\u0022\u003EApplication Profile Validation\u003C/h3\u003E\n\u003Cp\u003EThe validator rejects a configuration where:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoDetectApplicationProfile = false;\noptions.ApplicationProfile = UAuthApplicationProfile.NotSpecified;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn explicit profile is required when detection is disabled.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-validation\u0022\u003EEndpoint Validation\u003C/h3\u003E\n\u003Cp\u003EThe following endpoint properties must be present:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EEndpoints.BasePath\nEndpoints.Login\nEndpoints.Logout\nEndpoints.Refresh\nEndpoints.Validate\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example, this configuration is invalid:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-timing\u0022\u003EValidation Timing\u003C/h3\u003E\n\u003Cp\u003EUnlike the server registration, the current client registration does not explicitly call \u003Ccode\u003EValidateOnStart()\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EValidation therefore occurs through the normal options resolution lifecycle.\u003C/p\u003E\n\u003Cp\u003EApplications that require early validation can arrange for the configured options to be resolved during startup.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-scope\u0022\u003EValidation Scope\u003C/h3\u003E\n\u003Cp\u003EThe current validators check essential application profile and endpoint requirements.\u003C/p\u003E\n\u003Cp\u003EThey do not automatically validate every possible combination of client flow, server deployment, cookie behavior, and authentication mode.\u003C/p\u003E\n\u003Cp\u003EApplications should test their actual authentication flows against the deployed server configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-blazor-webassembly-example\u0022\u003E15. Complete Blazor WebAssembly Example\u003C/h2\u003E\n\u003Cp\u003EThe following example configures a Blazor WebAssembly client using a remote authentication server.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n // Application profile\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.BlazorWasm;\n\n // Authentication server\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n\n // Navigation\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n options.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\n // Public client security\n options.Login.AllowCredentialPost = false;\n\n // PKCE\n options.Pkce.Enabled = true;\n options.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n options.Pkce.AutoRedirect = true;\n\n // Background refresh\n options.AutoRefresh.Enabled = false;\n\n // Reauthentication\n options.Reauth.Behavior = ReauthBehavior.Redirect;\n options.Reauth.RedirectPath = \u0026quot;/login\u0026quot;;\n\n // State updates\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis example emphasizes PKCE-based authentication and avoids direct credential posting from a public browser client.\u003C/p\u003E\n\u003Cp\u003EThe remote server must be configured with compatible endpoints, origins, authentication modes, and credential delivery policies.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-blazor-server-example\u0022\u003E16. Complete Blazor Server Example\u003C/h2\u003E\n\u003Cp\u003EThe following example configures a Blazor Server client.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n // Application profile\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n\n // Same-origin authentication endpoints\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n\n // Navigation\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n options.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\n // Background refresh\n options.AutoRefresh.Enabled = true;\n options.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n\n // Reauthentication\n options.Reauth.Behavior = ReauthBehavior.Redirect;\n options.Reauth.RedirectPath = \u0026quot;/login\u0026quot;;\n\n // Authentication state\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EBlazor Server applications can use session-oriented authentication and the corresponding server-side security policies.\u003C/p\u003E\n\u003Cp\u003EThe application must still initialize the client and session coordinator through its supported lifecycle.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-and-client-configuration-together\u0022\u003E17. Server and Client Configuration Together\u003C/h2\u003E\n\u003Cp\u003EAn application that hosts both UltimateAuth Server and the Blazor client adapter can configure them independently.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E// Server: authentication and security policies\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Login.MaxFailedAttempts = 5;\n});\n\n// Client: platform integration and flow behavior\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n options.AutoDetectApplicationProfile = false;\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n options.AutoRefresh.Enabled = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe two configuration objects have different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ERequirement\u003C/th\u003E\n\u003Cth\u003EConfigure on\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession lifetime\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess token lifetime\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh token replay policy\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECredential recovery rules\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAllowed authentication modes\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EApplication profile\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPKCE navigation\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAutomatic background refresh\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EReauthentication navigation\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAuthentication state event handling\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ETenant validation\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ETenant propagation\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe client cannot override server-side security decisions.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-configuration-mistakes\u0022\u003E18. Common Configuration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022registering-the-core-client-and-blazor-adapter-separately\u0022\u003ERegistering the Core Client and Blazor Adapter Separately\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003EAddUltimateAuthClientBlazor()\u003C/code\u003E for Blazor applications.\u003C/p\u003E\n\u003Cp\u003EIt already registers the underlying client SDK.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disabling-profile-detection-without-selecting-a-profile\u0022\u003EDisabling Profile Detection Without Selecting a Profile\u003C/h3\u003E\n\u003Cp\u003EWhen \u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E is false, set \u003Ccode\u003EApplicationProfile\u003C/code\u003E explicitly.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022relying-on-automatic-detection-in-an-ambiguous-hosting-environment\u0022\u003ERelying on Automatic Detection in an Ambiguous Hosting Environment\u003C/h3\u003E\n\u003Cp\u003EFor complex hosting arrangements, consider specifying the application profile explicitly.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enabling-direct-credential-posting-in-a-public-client\u0022\u003EEnabling Direct Credential Posting in a Public Client\u003C/h3\u003E\n\u003Cp\u003EDo not enable \u003Ccode\u003EAllowCredentialPost\u003C/code\u003E for browser-hosted public clients.\u003C/p\u003E\n\u003Cp\u003EUse PKCE.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-client-auto-refresh-extends-server-lifetimes\u0022\u003EAssuming Client Auto-Refresh Extends Server Lifetimes\u003C/h3\u003E\n\u003Cp\u003EAutomatic refresh only initiates refresh operations.\u003C/p\u003E\n\u003Cp\u003EThe server controls whether refresh is permitted.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-auto-refresh-starts-automatically\u0022\u003EAssuming Auto-Refresh Starts Automatically\u003C/h3\u003E\n\u003Cp\u003EThe Blazor session coordinator must be started through the supported application lifecycle.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuring-only-the-client-endpoint\u0022\u003EConfiguring Only the Client Endpoint\u003C/h3\u003E\n\u003Cp\u003EThe server must expose compatible routes and allow the intended cross-origin interaction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-tenant-propagation-as-authorization\u0022\u003ETreating Tenant Propagation as Authorization\u003C/h3\u003E\n\u003Cp\u003EA tenant identifier supplied by the client does not grant access to that tenant.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-state-events-as-distributed-notifications\u0022\u003EUsing State Events as Distributed Notifications\u003C/h3\u003E\n\u003Cp\u003EClient events update local client state; they do not automatically synchronize all connected devices.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-every-client-setting-is-validated-at-startup\u0022\u003EAssuming Every Client Setting Is Validated at Startup\u003C/h3\u003E\n\u003Cp\u003EThe current client registration validates options when they are resolved, rather than explicitly requiring startup validation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-options-quick-reference\u0022\u003E19. Client Options Quick Reference\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ENotSpecified\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApplication environment\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatic profile detection\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EGlobal return URL\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/auth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication endpoint base\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin return URL\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin.AllowCredentialPost\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDirect credential posting\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.Enabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE flow support\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE return URL\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.AutoRedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatic PKCE navigation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.OnAuthorized\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE authorization callback\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoRefresh.Interval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E5 minutes after post-configuration\u003C/td\u003E\n\u003Ctd\u003EBackground refresh interval\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth.Behavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReauthentication handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth.RedirectPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReauthentication redirect\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant.Enabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant propagation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant.Tenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant.Transport\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ENone\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant transport\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EStateEvents.HandlingMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPatch\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EState event handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.BaseAddress\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResource API origin; defaults to application origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.Credentials\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBrowser credential handling for resource requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAutoRefresh.Enabled\u003C/code\u003E should be evaluated with the applicable platform and post-configuration behavior rather than inferred solely from its property initializer.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EConfiguration Overview\u003C/strong\u003E \u2014 Understand the configuration architecture and source precedence.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EServer Options\u003C/strong\u003E \u2014 Configure authentication security, sessions, tokens, and endpoints.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EAdvanced Configuration\u003C/strong\u003E \u2014 Explore effective options, mode resolution, and extension points.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient Authentication\u003C/strong\u003E \u2014 Implement login, PKCE, refresh, and logout flows.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient Session Management\u003C/strong\u003E \u2014 Manage authenticated sessions and revocation.\u003C/li\u003E\n\u003C/ul\u003E\n", + "Html": "\n\u003Cp\u003E\u003Ccode\u003EUAuthClientOptions\u003C/code\u003E controls how an UltimateAuth client communicates with the authentication server, executes authentication flows, maintains client-side authentication state, and responds when authentication must be renewed.\u003C/p\u003E\n\u003Cp\u003EThe client configuration is intentionally separate from server security configuration.\u003C/p\u003E\n\u003Cp\u003EThe server determines which authentication operations are permitted, how credentials are validated, and when sessions expire. The client determines how those operations are initiated and how the application responds to their outcomes.\u003C/p\u003E\n\u003Cp\u003EThis guide covers the current client configuration API, platform integration, defaults, practical examples, and important security considerations.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022register-the-ultimateauth-client\u0022\u003E1. Register the UltimateAuth Client\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides a platform-independent client SDK and platform-specific adapters.\u003C/p\u003E\n\u003Cp\u003EFor Blazor applications, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAddUltimateAuthClientBlazor()\u003C/code\u003E registers the underlying client services and the Blazor-specific infrastructure, including browser transport, storage, device identification, and authentication state integration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022core-client-registration\u0022\u003ECore Client Registration\u003C/h3\u003E\n\u003Cp\u003EThe platform-independent registration method is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClient(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis registers the shared client SDK.\u003C/p\u003E\n\u003Cp\u003EHowever, it does not provide every platform-specific implementation needed to run authentication flows.\u003C/p\u003E\n\u003Cp\u003EApplications should use an appropriate platform adapter rather than relying on the core client registration alone.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022do-not-register-both-client-methods\u0022\u003EDo Not Register Both Client Methods\u003C/h3\u003E\n\u003Cp\u003EWhen using:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Edo not also call:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClient();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Blazor registration already includes the core client services.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-and-client-in-one-application\u0022\u003EServer and Client in One Application\u003C/h3\u003E\n\u003Cp\u003EA Blazor Server application can register both UltimateAuth Server and the Blazor client adapter:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromDays(7);\n});\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n options.AutoDetectApplicationProfile = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese registrations configure different components.\u003C/p\u003E\n\u003Cp\u003EThe server controls authentication security and lifecycle rules.\u003C/p\u003E\n\u003Cp\u003EThe client controls the application-side integration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-options-architecture\u0022\u003E2. Client Options Architecture\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthClientOptions\u003C/code\u003E contains the following properties:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EType\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifies the application environment\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ebool\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnables automatic profile detection\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Estring?\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDefault navigation destination after authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientEndpointOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication endpoint paths\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientLoginFlowOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin flow configuration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientPkceLoginFlowOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE flow configuration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoRefresh\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientAutoRefreshOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBackground refresh coordination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientReauthOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReauthentication behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientMultiTenantOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant propagation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EStateEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthStateEventOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication state event handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientResourceOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EProtected Resource API origin and browser credential handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese options are configured through the same \u003Ccode\u003EUAuthClientOptions\u003C/code\u003E instance.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/dashboard\u0026quot;;\n options.Pkce.Enabled = true;\n options.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profiles\u0022\u003E3. Application Profiles\u003C/h2\u003E\n\u003Cp\u003EThe application profile identifies the application environment and influences authentication flow behavior.\u003C/p\u003E\n\u003Cp\u003EConfigure it through:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.ApplicationProfile\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUltimateAuth defines profiles including:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProfile\u003C/th\u003E\n\u003Cth\u003ETypical application\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInteractive Blazor Server applications\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorWasm\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBrowser-hosted Blazor WebAssembly\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaui\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E.NET MAUI applications\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EWebServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETraditional ASP.NET Core web applications\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAPI-oriented clients\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUltimateAuth Hub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENotSpecified\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EProfile not explicitly selected\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EDifferent application profiles may result in different authentication modes on the server.\u003C/p\u003E\n\u003Cp\u003EFor example, the default server mode resolver maps Blazor Server to \u003Ccode\u003EPureOpaque\u003C/code\u003E and Blazor WebAssembly to \u003Ccode\u003EHybrid\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe application profile does not itself authorize an authentication mode. The server must support and permit the resolved mode.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-application-profile-detection\u0022\u003E4. Automatic Application Profile Detection\u003C/h2\u003E\n\u003Cp\u003EAutomatic profile detection is enabled by default:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoDetectApplicationProfile = true;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen enabled, UltimateAuth detects the application environment if \u003Ccode\u003EApplicationProfile\u003C/code\u003E remains \u003Ccode\u003ENotSpecified\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe current detector checks for:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EUAuthHub registration.\u003C/li\u003E\n\u003Cli\u003E.NET MAUI.\u003C/li\u003E\n\u003Cli\u003EBlazor WebAssembly.\u003C/li\u003E\n\u003Cli\u003EBlazor Server.\u003C/li\u003E\n\u003Cli\u003EA fallback to \u003Ccode\u003EWebServer\u003C/code\u003E.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-configuration\u0022\u003EDefault Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENo explicit profile is required for ordinary supported environments where detection succeeds.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022manual-configuration\u0022\u003EManual Configuration\u003C/h3\u003E\n\u003Cp\u003EFor applications that need predictable behavior independent of assembly-based detection:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.BlazorWasm;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EManual configuration can be useful for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESpecialized hosting environments.\u003C/li\u003E\n\u003Cli\u003EIntegration tests.\u003C/li\u003E\n\u003Cli\u003EApplications with multiple hosting models.\u003C/li\u003E\n\u003Cli\u003ECases where assembly-based detection is ambiguous.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-validation-rule\u0022\u003EImportant Validation Rule\u003C/h3\u003E\n\u003Cp\u003EThis configuration is invalid:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.NotSpecified;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen automatic detection is disabled, an explicit application profile must be provided.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022explicit-profiles-take-precedence\u0022\u003EExplicit Profiles Take Precedence\u003C/h3\u003E\n\u003Cp\u003EThe post-configuration detector does not replace a profile that has already been explicitly selected.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe explicit profile is retained even when automatic detection remains enabled.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022detection-limitations\u0022\u003EDetection Limitations\u003C/h3\u003E\n\u003Cp\u003EThe current detector uses service registration and loaded assemblies to identify the environment.\u003C/p\u003E\n\u003Cp\u003EAssembly-based detection may not be completely reliable in every hosting arrangement.\u003C/p\u003E\n\u003Cp\u003EFor complex Blazor Web App hosting scenarios, explicitly configuring the profile can make authentication behavior easier to reason about.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-configuration\u0022\u003E5. Endpoint Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Endpoints\u003C/code\u003E defines the endpoint paths used by the client SDK.\u003C/p\u003E\n\u003Cp\u003EThe default base path is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E/auth\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-a-remote-authentication-server\u0022\u003EConfigure a Remote Authentication Server\u003C/h3\u003E\n\u003Cp\u003EFor a client communicating with a separately hosted UAuthHub:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor an application using same-origin authentication endpoints:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe base path must match the deployed authentication server\u0027s routing configuration.\u003C/p\u003E\n\u003Cp\u003EChanging a client endpoint does not create or expose the corresponding server endpoint.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-endpoint-paths\u0022\u003EDefault Endpoint Paths\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBasePath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/auth\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/login\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryLogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/try-login\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogout\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/logout\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefresh\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/refresh\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/reauth\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValidate\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/validate\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkceAuthorize\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/pkce/authorize\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkceTryComplete\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/pkce/try-complete\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkceComplete\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/pkce/complete\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubLoginPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/uauthhub/entry\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginTransport\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/login/transport\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cblockquote\u003E\n\u003Cp\u003EThe \u003Ccode\u003ELoginTransport\u003C/code\u003E endpoint exposes the effective login transport capabilities of the authentication server.\u003C/p\u003E\n\u003Cp\u003EThe client uses this information to determine whether navigation-based login is supported and whether the authentication response requires access-token processing.\u003C/p\u003E\n\u003Cp\u003EThis endpoint does not select an authentication mode or negotiate the server\u0027s authentication configuration.\u003C/p\u003E\n\u003C/blockquote\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022customize-individual-paths\u0022\u003ECustomize Individual Paths\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n options.Endpoints.Login = \u0026quot;/login\u0026quot;;\n options.Endpoints.Logout = \u0026quot;/logout\u0026quot;;\n options.Endpoints.Refresh = \u0026quot;/refresh\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese values should reflect the actual routes registered by UltimateAuth Server.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022required-endpoint-validation\u0022\u003ERequired Endpoint Validation\u003C/h3\u003E\n\u003Cp\u003EThe client options validator requires:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Login\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Logout\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Refresh\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EEndpoints.Validate\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese properties must not be null, empty, or whitespace-only.\u003C/p\u003E\n\u003Cp\u003EThe current validator does not apply the same required-value checks to every optional endpoint path.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022remote-clients-and-browser-security\u0022\u003ERemote Clients and Browser Security\u003C/h3\u003E\n\u003Cp\u003EWhen using a remote authentication server, also consider:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EHTTPS.\u003C/li\u003E\n\u003Cli\u003ECross-origin request configuration.\u003C/li\u003E\n\u003Cli\u003ECookie \u003Ccode\u003ESameSite\u003C/code\u003E and \u003Ccode\u003ESecure\u003C/code\u003E attributes.\u003C/li\u003E\n\u003Cli\u003EAllowed client origins.\u003C/li\u003E\n\u003Cli\u003EPKCE redirects.\u003C/li\u003E\n\u003Cli\u003EBrowser credential policies.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA correct endpoint URL alone does not guarantee that cross-origin authentication will work.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-configuration\u0022\u003EResource API Configuration\u003C/h3\u003E\n\u003Cp\u003EAuthentication endpoints and application resource endpoints serve different purposes.\u003C/p\u003E\n\u003Cp\u003EAn application may authenticate through UAuthHub while retrieving business data from a separately deployed Resource API.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides \u003Ccode\u003Eoptions.Resource\u003C/code\u003E to configure these requests independently.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n\n options.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client is available through \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource\n .GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch4 id=\u0022resource-options\u0022\u003EResource Options\u003C/h4\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.BaseAddress\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResource API origin; \u003Ccode\u003Enull\u003C/code\u003E uses the application\u0027s origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.Credentials\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBrowser credential transmission policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch4 id=\u0022base-address-validation\u0022\u003EBase Address Validation\u003C/h4\u003E\n\u003Cp\u003EWhen configured, \u003Ccode\u003EResource.BaseAddress\u003C/code\u003E must be an absolute HTTP or HTTPS origin.\u003C/p\u003E\n\u003Cp\u003EHTTPS is required except for loopback development addresses.\u003C/p\u003E\n\u003Cp\u003EThe address must not contain an additional path, query string, fragment, or embedded credentials.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.BaseAddress = \u0026quot;https://api.example.com\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIndividual resource paths are supplied when making requests:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch4 id=\u0022credential-modes\u0022\u003ECredential Modes\u003C/h4\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthResourceCredentialsMode\u003C/code\u003E supports four options:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatically select the appropriate browser credential policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESameOrigin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude browser credentials only for same-origin requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EInclude\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude browser credentials for the configured Resource API origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOmit\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDo not include browser credentials\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor example, a separate Resource API that requires cross-origin cookies may use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Resource.Credentials = UAuthResourceCredentialsMode.Include;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource API must permit the relevant browser origin and support the required CORS and cookie configuration.\u003C/p\u003E\n\u003Cp\u003ECredential configuration does not bypass browser security restrictions or replace server-side authentication and authorization.\u003C/p\u003E\n\u003Ch4 id=\u0022resource-requests-and-authentication-lifecycle\u0022\u003EResource Requests and Authentication Lifecycle\u003C/h4\u003E\n\u003Cp\u003EResource requests use the browser transport in the Blazor integration.\u003C/p\u003E\n\u003Cp\u003EThey support request cancellation, origin validation, and redirect protection.\u003C/p\u003E\n\u003Cp\u003EResource requests return \u003Ccode\u003EUAuthResult\u0026lt;T\u0026gt;\u003C/code\u003E or \u003Ccode\u003EUAuthResult\u003C/code\u003E, depending on the operation.\u003C/p\u003E\n\u003Cp\u003EThe current Resource Client does not automatically refresh authentication and retry a request after receiving a \u003Ccode\u003E401 Unauthorized\u003C/code\u003E response.\u003C/p\u003E\n\u003Cp\u003EFor a complete explanation, see \u003Ca href=\u0022/docs/client-sdk/resource-api-requests\u0022\u003EResource API Requests\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-flow-options\u0022\u003E6. Login Flow Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Login\u003C/code\u003E controls client-side login behavior.\u003C/p\u003E\n\u003Cp\u003EThe available properties are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin-specific return destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowCredentialPost\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAllow direct credential posting\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-login-navigation\u0022\u003EConfigure Login Navigation\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe login-specific return URL is used when the login flow does not provide a more specific destination.\u003C/p\u003E\n\u003Cp\u003EIf it is not set, UltimateAuth can fall back to \u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E or the current location according to the flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-credential-posting\u0022\u003EDirect Credential Posting\u003C/h3\u003E\n\u003Cp\u003EThe default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Login.AllowCredentialPost = false;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an important security setting.\u003C/p\u003E\n\u003Cp\u003EDirectly posting user credentials is not appropriate for public browser clients such as Blazor WebAssembly applications.\u003C/p\u003E\n\u003Cp\u003EPublic clients should use the supported PKCE-based login flow.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022trusted-server-hosted-clients\u0022\u003ETrusted Server-Hosted Clients\u003C/h3\u003E\n\u003Cp\u003EA trusted server-hosted application may explicitly enable direct credential posting where its authentication architecture requires it:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n options.Login.AllowCredentialPost = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not enable this setting for a public client merely to simplify login implementation.\u003C/p\u003E\n\u003Cp\u003EThe server still determines whether the requested authentication operation is permitted.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pkce-configuration\u0022\u003E7. PKCE Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Pkce\u003C/code\u003E controls client-side PKCE login behavior.\u003C/p\u003E\n\u003Cp\u003EPKCE allows a public client to complete an authorization flow without relying on a confidential client secret.\u003C/p\u003E\n\u003Cp\u003EThe current options are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable client PKCE support\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPost-login return destination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoRedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatically navigate after beginning PKCE\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnAuthorized\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECallback after the authorization response is issued\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022basic-configuration\u0022\u003EBasic Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Pkce.Enabled = true;\n options.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n options.Pkce.AutoRedirect = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-redirect\u0022\u003EDisable Automatic Redirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Pkce.AutoRedirect = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen \u003Ccode\u003EAutoRedirect\u003C/code\u003E is disabled, \u003Ccode\u003EBeginPkceAsync\u003C/code\u003E does not automatically navigate to the next location.\u003C/p\u003E\n\u003Cp\u003EThe application is responsible for handling navigation.\u003C/p\u003E\n\u003Cp\u003EThis can be useful when integrating UltimateAuth into an existing routing or navigation system.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-callback\u0022\u003EAuthorization Callback\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Pkce.OnAuthorized = response =\u0026gt;\n {\n // Inspect or process the authorization response.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe callback receives:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EPkceAuthorizeResponse\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIt runs after the authorization response is issued and before the normal Hub navigation.\u003C/p\u003E\n\u003Cp\u003EUse the callback for application-specific integration, not to bypass PKCE verification.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-and-server-pkce-settings-are-different\u0022\u003EClient and Server PKCE Settings Are Different\u003C/h3\u003E\n\u003Cp\u003EClient configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.AutoRedirect = true;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EServer configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Pkce.AuthorizationCodeLifetimeSeconds = 120;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client controls how the flow is initiated and navigated.\u003C/p\u003E\n\u003Cp\u003EThe server controls the authorization code\u0027s validity and verification.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022return-url-configuration\u0022\u003E8. Return URL Configuration\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports several return URL configuration points.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EGlobal default for interactive authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin-specific default\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE-specific default\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022global-default\u0022\u003EGlobal Default\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/dashboard\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022flow-specific-defaults\u0022\u003EFlow-Specific Defaults\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n options.Login.ReturnUrl = \u0026quot;/account\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFlow-specific values allow different authentication paths to use different destinations.\u003C/p\u003E\n\u003Cp\u003EAn explicitly supplied return URL for an individual operation may take precedence over these defaults.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003EReturn URLs are navigation destinations and must be treated carefully.\u003C/p\u003E\n\u003Cp\u003EDo not redirect users to arbitrary external URLs without appropriate validation.\u003C/p\u003E\n\u003Cp\u003EOpen redirects can be abused for phishing and other attacks.\u003C/p\u003E\n\u003Cp\u003EPrefer local application routes unless cross-origin navigation is an intentional and validated part of the authentication architecture.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh\u0022\u003E9. Automatic Refresh\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.AutoRefresh\u003C/code\u003E controls background refresh coordination.\u003C/p\u003E\n\u003Cp\u003EThe available properties are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnables or disables automatic background refresh\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInterval between background refresh attempts\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-automatic-refresh\u0022\u003EConfigure Automatic Refresh\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoRefresh.Enabled = true;\n options.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-refresh\u0022\u003EDisable Automatic Refresh\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoRefresh.Enabled = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-interval\u0022\u003EDefault Interval\u003C/h3\u003E\n\u003Cp\u003EIf \u003Ccode\u003EInterval\u003C/code\u003E is not supplied, the client registration applies:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoRefresh.Interval ??= TimeSpan.FromMinutes(5);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe resulting default interval is five minutes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022platform-behavior\u0022\u003EPlatform Behavior\u003C/h3\u003E\n\u003Cp\u003EThe effective \u003Ccode\u003EEnabled\u003C/code\u003E setting should be considered together with the platform\u0027s post-configuration and session coordination behavior.\u003C/p\u003E\n\u003Cp\u003EThe current Blazor session coordinator checks \u003Ccode\u003EAutoRefresh.Enabled\u003C/code\u003E before starting its background loop.\u003C/p\u003E\n\u003Cp\u003EWhen enabled, it periodically invokes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClient.Flows.RefreshAsync(true);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-is-not-a-security-policy\u0022\u003EAutomatic Refresh Is Not a Security Policy\u003C/h3\u003E\n\u003Cp\u003EAutomatic refresh does not control:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EServer session lifetime.\u003C/li\u003E\n\u003Cli\u003ERefresh token lifetime.\u003C/li\u003E\n\u003Cli\u003ESession revocation.\u003C/li\u003E\n\u003Cli\u003ECredential recovery policies.\u003C/li\u003E\n\u003Cli\u003ERefresh token replay protection.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese remain server-side responsibilities.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-refresh-does-not-guarantee-session-continuity\u0022\u003EAutomatic Refresh Does Not Guarantee Session Continuity\u003C/h3\u003E\n\u003Cp\u003EBackground refresh may fail because:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe session has expired.\u003C/li\u003E\n\u003Cli\u003EThe refresh credential has been revoked.\u003C/li\u003E\n\u003Cli\u003EThe browser is suspended.\u003C/li\u003E\n\u003Cli\u003ENetwork connectivity is unavailable.\u003C/li\u003E\n\u003Cli\u003EThe server requires reauthentication.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EAutomatic refresh is a convenience and continuity mechanism, not a guarantee that authentication remains valid indefinitely.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022coordinator-lifecycle\u0022\u003ECoordinator Lifecycle\u003C/h3\u003E\n\u003Cp\u003EThe Blazor adapter provides an \u003Ccode\u003EISessionCoordinator\u003C/code\u003E implementation.\u003C/p\u003E\n\u003Cp\u003EThe coordinator must be started by the application\u0027s supported initialization lifecycle.\u003C/p\u003E\n\u003Cp\u003ESetting \u003Ccode\u003EAutoRefresh.Enabled = true\u003C/code\u003E does not mean that a background task automatically runs without the coordinator being started.\u003C/p\u003E\n\u003Cp\u003EApplications should follow the client initialization guidance for their hosting model.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022reauthentication-options\u0022\u003E10. Reauthentication Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Reauth\u003C/code\u003E controls how the Blazor session coordinator responds when refresh reports that reauthentication is required.\u003C/p\u003E\n\u003Cp\u003EThe available properties are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBehavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauthBehavior.Redirect\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirectPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-behaviors\u0022\u003EAvailable Behaviors\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EReauthBehavior.Redirect\nReauthBehavior.None\nReauthBehavior.RaiseEvent\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022redirect\u0022\u003ERedirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Reauth.Behavior = ReauthBehavior.Redirect;\n options.Reauth.RedirectPath = \u0026quot;/login\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen the coordinator receives a \u003Ccode\u003EReauthRequired\u003C/code\u003E refresh outcome, it navigates to the configured redirect path.\u003C/p\u003E\n\u003Cp\u003EIf \u003Ccode\u003ERedirectPath\u003C/code\u003E is null, the coordinator falls back to \u003Ccode\u003EEndpoints.Login\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe current Blazor coordinator uses forced navigation for this redirect.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022raise-an-event\u0022\u003ERaise an Event\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows an application to handle reauthentication through the coordinator\u0027s \u003Ccode\u003EReauthRequired\u003C/code\u003E event.\u003C/p\u003E\n\u003Cp\u003EFor example, an application may display a reauthentication dialog rather than immediately navigating.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022no-automatic-action\u0022\u003ENo Automatic Action\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Reauth.Behavior = ReauthBehavior.None;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith \u003Ccode\u003ENone\u003C/code\u003E, the coordinator does not automatically redirect or raise its reauthentication event.\u003C/p\u003E\n\u003Cp\u003EThe application must still handle unauthenticated states appropriately.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important\u0022\u003EImportant\u003C/h3\u003E\n\u003Cp\u003EReauthentication behavior does not make an expired or revoked session valid.\u003C/p\u003E\n\u003Cp\u003EIt only controls how the client responds when authentication must be reestablished.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022multi-tenant-client-configuration\u0022\u003E11. Multi-Tenant Client Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.MultiTenant\u003C/code\u003E controls tenant propagation from the client to the authentication server.\u003C/p\u003E\n\u003Cp\u003EThe client does not independently authorize or resolve tenant ownership.\u003C/p\u003E\n\u003Cp\u003EIt carries tenant context using the configured transport.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable tenant propagation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant identifier to propagate\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETransport\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ETenantTransport.None\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant transport mechanism\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-transports\u0022\u003EAvailable Transports\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETenantTransport.None\nTenantTransport.Header\nTenantTransport.Route\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022header-based-tenant-propagation\u0022\u003EHeader-Based Tenant Propagation\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.Tenant = \u0026quot;tenant-a\u0026quot;;\n options.MultiTenant.Transport = TenantTransport.Header;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server must be configured to resolve tenant information from the corresponding transport.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.EnableHeader = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022route-based-tenant-propagation\u0022\u003ERoute-Based Tenant Propagation\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.Tenant = \u0026quot;tenant-a\u0026quot;;\n options.MultiTenant.Transport = TenantTransport.Route;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server must expose routes compatible with tenant-based routing.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-boundary\u0022\u003ESecurity Boundary\u003C/h3\u003E\n\u003Cp\u003EA client-provided tenant identifier is not proof of tenant membership.\u003C/p\u003E\n\u003Cp\u003EThe server must validate the resolved tenant and enforce tenant isolation.\u003C/p\u003E\n\u003Cp\u003ENever rely on client-side tenant selection as an authorization boundary.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-state-events\u0022\u003E12. Authentication State Events\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.StateEvents\u003C/code\u003E controls how the client processes authentication-related state events.\u003C/p\u003E\n\u003Cp\u003EThe available property is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.StateEvents.HandlingMode\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthStateEventHandlingMode.Patch\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-modes\u0022\u003EAvailable Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPatch\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApply a local authentication state update\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EValidate\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevalidate authentication state after the event\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENone\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDo not update authentication state in response to the event\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022patch\u0022\u003EPatch\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EPatch\u003C/code\u003E is the default.\u003C/p\u003E\n\u003Cp\u003EIt allows the client to update local state without performing a full authentication validation for every event.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validate\u0022\u003EValidate\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Validate;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EValidate\u003C/code\u003E causes the client to revalidate authentication state in response to events.\u003C/p\u003E\n\u003Cp\u003EThis may introduce additional requests but can be appropriate when the application prefers server-confirmed state updates.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022none\u0022\u003ENone\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.None;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ENone\u003C/code\u003E disables automatic authentication state updates in response to these events.\u003C/p\u003E\n\u003Cp\u003EApplications using this mode must provide any required state synchronization through other mechanisms.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022local-events-are-not-distributed-notifications\u0022\u003ELocal Events Are Not Distributed Notifications\u003C/h3\u003E\n\u003Cp\u003EClient state events do not automatically notify every browser, device, or application instance.\u003C/p\u003E\n\u003Cp\u003EFor example, an administrator changing a user\u0027s role does not automatically push an event to that user\u0027s open browser.\u003C/p\u003E\n\u003Cp\u003EDistributed synchronization requires additional application infrastructure.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-from-appsettings.json\u0022\u003E13. Configuration from appsettings.json\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth Client binds the configuration section:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Client\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Client\u0026quot;: {\n \u0026quot;AutoDetectApplicationProfile\u0026quot;: true,\n \u0026quot;DefaultReturnUrl\u0026quot;: \u0026quot;/dashboard\u0026quot;,\n \u0026quot;Endpoints\u0026quot;: {\n \u0026quot;BasePath\u0026quot;: \u0026quot;https://auth.example.com/auth\u0026quot;\n },\n \u0026quot;Pkce\u0026quot;: {\n \u0026quot;Enabled\u0026quot;: true,\n \u0026quot;ReturnUrl\u0026quot;: \u0026quot;/dashboard\u0026quot;,\n \u0026quot;AutoRedirect\u0026quot;: true\n },\n \u0026quot;AutoRefresh\u0026quot;: {\n \u0026quot;Enabled\u0026quot;: true,\n \u0026quot;Interval\u0026quot;: \u0026quot;00:05:00\u0026quot;\n },\n \u0026quot;Reauth\u0026quot;: {\n \u0026quot;Behavior\u0026quot;: \u0026quot;Redirect\u0026quot;,\n \u0026quot;RedirectPath\u0026quot;: \u0026quot;/login\u0026quot;\n },\n \u0026quot;StateEvents\u0026quot;: {\n \u0026quot;HandlingMode\u0026quot;: \u0026quot;Patch\u0026quot;\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe example uses the standard ASP.NET Core configuration binding conventions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-precedence\u0022\u003EConfiguration Precedence\u003C/h3\u003E\n\u003Cp\u003EThe registration pipeline applies:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EOption type defaults.\u003C/li\u003E\n\u003Cli\u003EThe configuration delegate.\u003C/li\u003E\n\u003Cli\u003EValues from \u003Ccode\u003EUltimateAuth:Client\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EPost-configuration processing.\u003C/li\u003E\n\u003Cli\u003ERegistered options validation when the options are resolved.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWith:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Client\u0026quot;: {\n \u0026quot;DefaultReturnUrl\u0026quot;: \u0026quot;/dashboard\u0026quot;\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe configured return URL becomes \u003Ccode\u003E/dashboard\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022environment-variables\u0022\u003EEnvironment Variables\u003C/h3\u003E\n\u003Cp\u003EASP.NET Core supports double underscores for hierarchical configuration keys.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Client__Endpoints__BasePath=https://auth.example.com/auth\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis corresponds to:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Client:Endpoints:BasePath\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUse environment-specific configuration for deployment-dependent values such as authentication server addresses and application return paths.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-options-validation\u0022\u003E14. Client Options Validation\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth registers validators for:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthClientOptions\nUAuthClientEndpointOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profile-validation\u0022\u003EApplication Profile Validation\u003C/h3\u003E\n\u003Cp\u003EThe validator rejects a configuration where:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AutoDetectApplicationProfile = false;\noptions.ApplicationProfile = UAuthApplicationProfile.NotSpecified;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn explicit profile is required when detection is disabled.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-validation\u0022\u003EEndpoint Validation\u003C/h3\u003E\n\u003Cp\u003EThe following endpoint properties must be present:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EEndpoints.BasePath\nEndpoints.Login\nEndpoints.Logout\nEndpoints.Refresh\nEndpoints.Validate\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example, this configuration is invalid:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-timing\u0022\u003EValidation Timing\u003C/h3\u003E\n\u003Cp\u003EUnlike the server registration, the current client registration does not explicitly call \u003Ccode\u003EValidateOnStart()\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EValidation therefore occurs through the normal options resolution lifecycle.\u003C/p\u003E\n\u003Cp\u003EApplications that require early validation can arrange for the configured options to be resolved during startup.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-scope\u0022\u003EValidation Scope\u003C/h3\u003E\n\u003Cp\u003EThe current validators check essential application profile and endpoint requirements.\u003C/p\u003E\n\u003Cp\u003EThey do not automatically validate every possible combination of client flow, server deployment, cookie behavior, and authentication mode.\u003C/p\u003E\n\u003Cp\u003EApplications should test their actual authentication flows against the deployed server configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-blazor-webassembly-example\u0022\u003E15. Complete Blazor WebAssembly Example\u003C/h2\u003E\n\u003Cp\u003EThe following example configures a Blazor WebAssembly client using a remote authentication server.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n // Application profile\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.BlazorWasm;\n\n // Authentication server\n options.Endpoints.BasePath = \u0026quot;https://auth.example.com/auth\u0026quot;;\n\n // Navigation\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n options.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\n // Public client security\n options.Login.AllowCredentialPost = false;\n\n // PKCE\n options.Pkce.Enabled = true;\n options.Pkce.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n options.Pkce.AutoRedirect = true;\n\n // Background refresh\n options.AutoRefresh.Enabled = false;\n\n // Reauthentication\n options.Reauth.Behavior = ReauthBehavior.Redirect;\n options.Reauth.RedirectPath = \u0026quot;/login\u0026quot;;\n\n // State updates\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis example emphasizes PKCE-based authentication and avoids direct credential posting from a public browser client.\u003C/p\u003E\n\u003Cp\u003EThe remote server must be configured with compatible endpoints, origins, authentication modes, and credential delivery policies.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-blazor-server-example\u0022\u003E16. Complete Blazor Server Example\u003C/h2\u003E\n\u003Cp\u003EThe following example configures a Blazor Server client.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n // Application profile\n options.AutoDetectApplicationProfile = false;\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n\n // Same-origin authentication endpoints\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n\n // Navigation\n options.DefaultReturnUrl = \u0026quot;/\u0026quot;;\n options.Login.ReturnUrl = \u0026quot;/dashboard\u0026quot;;\n\n // Background refresh\n options.AutoRefresh.Enabled = true;\n options.AutoRefresh.Interval = TimeSpan.FromMinutes(5);\n\n // Reauthentication\n options.Reauth.Behavior = ReauthBehavior.Redirect;\n options.Reauth.RedirectPath = \u0026quot;/login\u0026quot;;\n\n // Authentication state\n options.StateEvents.HandlingMode = UAuthStateEventHandlingMode.Patch;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EBlazor Server applications can use session-oriented authentication and the corresponding server-side security policies.\u003C/p\u003E\n\u003Cp\u003EThe application must still initialize the client and session coordinator through its supported lifecycle.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-and-client-configuration-together\u0022\u003E17. Server and Client Configuration Together\u003C/h2\u003E\n\u003Cp\u003EAn application that hosts both UltimateAuth Server and the Blazor client adapter can configure them independently.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E// Server: authentication and security policies\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Login.MaxFailedAttempts = 5;\n});\n\n// Client: platform integration and flow behavior\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n options.AutoDetectApplicationProfile = false;\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n options.AutoRefresh.Enabled = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe two configuration objects have different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ERequirement\u003C/th\u003E\n\u003Cth\u003EConfigure on\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession lifetime\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess token lifetime\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh token replay policy\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECredential recovery rules\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAllowed authentication modes\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EApplication profile\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPKCE navigation\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAutomatic background refresh\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EReauthentication navigation\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAuthentication state event handling\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ETenant validation\u003C/td\u003E\n\u003Ctd\u003EServer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ETenant propagation\u003C/td\u003E\n\u003Ctd\u003EClient\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe client cannot override server-side security decisions.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-configuration-mistakes\u0022\u003E18. Common Configuration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022registering-the-core-client-and-blazor-adapter-separately\u0022\u003ERegistering the Core Client and Blazor Adapter Separately\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003EAddUltimateAuthClientBlazor()\u003C/code\u003E for Blazor applications.\u003C/p\u003E\n\u003Cp\u003EIt already registers the underlying client SDK.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disabling-profile-detection-without-selecting-a-profile\u0022\u003EDisabling Profile Detection Without Selecting a Profile\u003C/h3\u003E\n\u003Cp\u003EWhen \u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E is false, set \u003Ccode\u003EApplicationProfile\u003C/code\u003E explicitly.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022relying-on-automatic-detection-in-an-ambiguous-hosting-environment\u0022\u003ERelying on Automatic Detection in an Ambiguous Hosting Environment\u003C/h3\u003E\n\u003Cp\u003EFor complex hosting arrangements, consider specifying the application profile explicitly.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enabling-direct-credential-posting-in-a-public-client\u0022\u003EEnabling Direct Credential Posting in a Public Client\u003C/h3\u003E\n\u003Cp\u003EDo not enable \u003Ccode\u003EAllowCredentialPost\u003C/code\u003E for browser-hosted public clients.\u003C/p\u003E\n\u003Cp\u003EUse PKCE.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-client-auto-refresh-extends-server-lifetimes\u0022\u003EAssuming Client Auto-Refresh Extends Server Lifetimes\u003C/h3\u003E\n\u003Cp\u003EAutomatic refresh only initiates refresh operations.\u003C/p\u003E\n\u003Cp\u003EThe server controls whether refresh is permitted.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-auto-refresh-starts-automatically\u0022\u003EAssuming Auto-Refresh Starts Automatically\u003C/h3\u003E\n\u003Cp\u003EThe Blazor session coordinator must be started through the supported application lifecycle.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuring-only-the-client-endpoint\u0022\u003EConfiguring Only the Client Endpoint\u003C/h3\u003E\n\u003Cp\u003EThe server must expose compatible routes and allow the intended cross-origin interaction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-tenant-propagation-as-authorization\u0022\u003ETreating Tenant Propagation as Authorization\u003C/h3\u003E\n\u003Cp\u003EA tenant identifier supplied by the client does not grant access to that tenant.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022using-state-events-as-distributed-notifications\u0022\u003EUsing State Events as Distributed Notifications\u003C/h3\u003E\n\u003Cp\u003EClient events update local client state; they do not automatically synchronize all connected devices.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-every-client-setting-is-validated-at-startup\u0022\u003EAssuming Every Client Setting Is Validated at Startup\u003C/h3\u003E\n\u003Cp\u003EThe current client registration validates options when they are resolved, rather than explicitly requiring startup validation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-options-quick-reference\u0022\u003E19. Client Options Quick Reference\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ENotSpecified\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EApplication environment\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatic profile detection\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EGlobal return URL\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/auth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication endpoint base\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin return URL\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin.AllowCredentialPost\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDirect credential posting\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.Enabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE flow support\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.ReturnUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE return URL\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.AutoRedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAutomatic PKCE navigation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce.OnAuthorized\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE authorization callback\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoRefresh.Interval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E5 minutes after post-configuration\u003C/td\u003E\n\u003Ctd\u003EBackground refresh interval\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth.Behavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReauthentication handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EReauth.RedirectPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReauthentication redirect\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant.Enabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant propagation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant.Tenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant.Transport\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ENone\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant transport\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EStateEvents.HandlingMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPatch\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EState event handling\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.BaseAddress\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResource API origin; defaults to application origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResource.Credentials\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBrowser credential handling for resource requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAutoRefresh.Enabled\u003C/code\u003E should be evaluated with the applicable platform and post-configuration behavior rather than inferred solely from its property initializer.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EConfiguration Overview\u003C/strong\u003E \u2014 Understand the configuration architecture and source precedence.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EServer Options\u003C/strong\u003E \u2014 Configure authentication security, sessions, tokens, and endpoints.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EAdvanced Configuration\u003C/strong\u003E \u2014 Explore effective options, mode resolution, and extension points.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient Authentication\u003C/strong\u003E \u2014 Implement login, PKCE, refresh, and logout flows.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient Session Management\u003C/strong\u003E \u2014 Manage authenticated sessions and revocation.\u003C/li\u003E\n\u003C/ul\u003E\n", "Headings": [ { "Id": "register-the-ultimateauth-client", @@ -414,6 +414,6 @@ "Level": 0 } ], - "SourceHash": "98AF16BB83BA21CF09352C14F62D24C073770CCBB5D2D1DF6F6998751EBA5A21", + "SourceHash": "84F0639982E2B2C1F2654290837D5A975F1646905894E4EF07A5F9789520D658", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/server-options.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/server-options.json index d6262de0..d2acecf8 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/server-options.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/configuration/server-options.json @@ -1,7 +1,7 @@ { "Slug": "configuration/server-options", "Title": "Server Options", - "Html": "\n\u003Cp\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E is the primary configuration surface for UltimateAuth Server.\u003C/p\u003E\n\u003Cp\u003EIt controls authentication behavior, session lifecycles, token issuance, credential security, tenant resolution, endpoint exposure, and integration with UAuthHub.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth composes its Core-defined options directly into \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E. When using UltimateAuth Server, you configure both shared authentication behavior and server-specific features through the same options object.\u003C/p\u003E\n\u003Cp\u003EThis guide covers the available configuration groups, their defaults, practical examples, and the distinction between configured and effective runtime behavior.\u003C/p\u003E\n\u003Cp\u003EBuilt-in HTTP throttling is configured through \u003Ccode\u003Eoptions.RateLimiting\u003C/code\u003E. See \u003Ca href=\u0022/docs/security/rate-limiting\u0022\u003ERate Limiting\u003C/a\u003E for defaults, middleware ownership, proxy configuration and native-policy integration.\u003C/p\u003E\n\u003Cp\u003EExpensive password hashing operations are protected by \u003Ccode\u003Eoptions.ConcurrencyLimiting\u003C/code\u003E, which provides global and workload-specific concurrency budgets. See \u003Ca href=\u0022/docs/security/concurrency-limiting\u0022\u003EConcurrency Limiting\u003C/a\u003E for defaults, queue behavior, timeouts, and configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022register-ultimateauth-server\u0022\u003E1. Register UltimateAuth Server\u003C/h2\u003E\n\u003Cp\u003EConfigure the server through \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe configuration delegate receives:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server registration also supports an optional policy configuration delegate.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(\n configure: options =\u0026gt;\n {\n options.Login.MaxFailedAttempts = 5;\n },\n configurePolicies: policies =\u0026gt;\n {\n // Register application access policies.\n });\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server automatically registers its Core infrastructure. You do not need to call \u003Ccode\u003EAddUltimateAuth()\u003C/code\u003E separately.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-from-appsettings.json\u0022\u003EConfiguration from appsettings.json\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth Server binds the configuration section:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Server\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Server\u0026quot;: {\n \u0026quot;Login\u0026quot;: {\n \u0026quot;MaxFailedAttempts\u0026quot;: 5,\n \u0026quot;LockoutDuration\u0026quot;: \u0026quot;00:15:00\u0026quot;\n },\n \u0026quot;Session\u0026quot;: {\n \u0026quot;Lifetime\u0026quot;: \u0026quot;7.00:00:00\u0026quot;\n },\n \u0026quot;Token\u0026quot;: {\n \u0026quot;AccessTokenLifetime\u0026quot;: \u0026quot;00:10:00\u0026quot;\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EASP.NET Core represents \u003Ccode\u003ETimeSpan\u003C/code\u003E values using strings such as \u003Ccode\u003E00:15:00\u003C/code\u003E for fifteen minutes and \u003Ccode\u003E7.00:00:00\u003C/code\u003E for seven days.\u003C/p\u003E\n\u003Cp\u003EThe configuration section is bound after the registration delegate, so configuration provider values take precedence for matching properties.\u003C/p\u003E\n\u003Cp\u003EFor configuration source ordering and environment-specific overrides, see \u003Ca href=\u0022/docs/configuration/configuration\u0022\u003EConfiguration Overview\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-options-architecture\u0022\u003E2. Server Options Architecture\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E contains two categories of configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022core-defined-options\u0022\u003ECore-defined options\u003C/h3\u003E\n\u003Cp\u003EThese types are defined in UltimateAuth Core and composed into the server options:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EType\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthLoginOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin attempts and lockout behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESession\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthSessionOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession lifetime and lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EToken\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthTokenOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAccess and refresh token behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthPkceOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE authorization code lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthMultiTenantOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant identification and resolution\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPagination\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthPaginationOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPagination defaults and limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication lifecycle callbacks\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-specific-options\u0022\u003EServer-specific options\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERestrict permitted authentication modes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubDeploymentMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDescribe the relationship between UAuthHub and the application\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub integration and flow settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECookie\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECookie names, security attributes, and lifetime behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESessionResolution\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession identifier sources and precedence\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEndpoint groups and disabled actions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPrimary credential selection for UI and API requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication credential delivery and redirect behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialSessionPolicy\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession invalidation after credential changes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResetCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential recovery code and token settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier behavior, normalization, and uniqueness\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifierValidation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUsername, email, and phone validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier types allowed for login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser profile capabilities\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENavigation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication navigation behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDiagnostics\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional diagnostic response details\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EAdvanced configuration hooks are also available, including \u003Ccode\u003EConfigureMode()\u003C/code\u003E and \u003Ccode\u003EOnConfigureEndpoints\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-options\u0022\u003E3. Login Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Login\u003C/code\u003E controls login attempt limits, lockout behavior, and related security settings.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Login.FailureWindow = TimeSpan.FromMinutes(15);\n options.Login.ExtendLockOnFailure = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxFailedAttempts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E10\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EFailed login threshold; \u003Ccode\u003E0\u003C/code\u003E disables lockout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELockoutDuration\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E15 minutes\u003C/td\u003E\n\u003Ctd\u003ELockout duration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EFailureWindow\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E15 minutes\u003C/td\u003E\n\u003Ctd\u003EWindow for counting failed attempts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EExtendLockOnFailure\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExtend lockout when another attempt fails during lockout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIncludeFailureDetails\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude detailed authentication failure information\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryLoginDuration\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E180 seconds\u003C/td\u003E\n\u003Ctd\u003EDuration associated with the try-login flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-restrict-login-failure-details\u0022\u003EExample: Restrict Login Failure Details\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.IncludeFailureDetails = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis setting is useful when an application does not want to expose detailed lockout information to callers.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important\u0022\u003EImportant\u003C/h3\u003E\n\u003Cp\u003ELockout configuration is not equivalent to complete network-level rate limiting.\u003C/p\u003E\n\u003Cp\u003EProduction deployments should also consider infrastructure protections against abusive traffic and distributed login attempts.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-options\u0022\u003E4. Session Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Session\u003C/code\u003E controls session lifetime, expiration, sliding behavior, and session-chain limits.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Session.SlidingExpiration = true;\n options.Session.IdleTimeout = TimeSpan.FromDays(3);\n options.Session.MaxLifetime = TimeSpan.FromDays(30);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-lifetime-properties\u0022\u003ESession Lifetime Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E7 days\u003C/td\u003E\n\u003Ctd\u003EStandard session lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional absolute lifetime limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESlidingExpiration\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAllow eligible activity or refresh operations to extend expiration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdleTimeout\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional inactivity timeout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETouchInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E5 minutes\u003C/td\u003E\n\u003Ctd\u003EMinimum interval between last-seen updates\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings have different purposes.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ELifetime\u003C/code\u003E determines the standard lifetime assigned to a session.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EMaxLifetime\u003C/code\u003E establishes an optional hard boundary that cannot be extended indefinitely.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EIdleTimeout\u003C/code\u003E limits how long a session can remain inactive.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ETouchInterval\u003C/code\u003E reduces unnecessary persistence operations caused by frequent activity updates.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-chain-properties\u0022\u003ESession-Chain Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxChainsPerUser\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E0\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved user-level chain limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxSessionsPerChain\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E100\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession-chain rotation limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxChainsPerPlatform\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved platform-specific chain limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPlatformCategories\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved platform group definitions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxChainsPerCategory\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved category-specific chain limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableIpBinding\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved IP binding setting\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableUserAgentBinding\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved User-Agent binding setting\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceMismatchBehavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EReject\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved device mismatch behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003ECurrent implementation limitation:\u003C/strong\u003E The source identifies several device limits and binding settings as reserved for future enforcement. Setting these properties must not be treated as proof that the corresponding protection is active.\u003C/p\u003E\n\u003Cp\u003EFor example, do not rely on:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Session.MaxChainsPerUser = 1;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Eas a production guarantee that only one device chain can exist unless the current runtime implementation has been verified to enforce that restriction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enforced-device-limits\u0022\u003EEnforced Device Limits\u003C/h3\u003E\n\u003Cp\u003EActive-device admission limits are configured separately from \u003Ccode\u003Eoptions.Session\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.DeviceLimits.MaxDevices = 3;\n options.DeviceLimits.TypeLimits[\u0026quot;web\u0026quot;] = 2;\n options.DeviceLimits.Behavior = DeviceLimitBehavior.RejectNewLogin;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits.MaxDevices\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional maximum distinct active device IDs per user and tenant\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits.TypeLimits\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEmpty\u003C/td\u003E\n\u003Ctd\u003EOptional per-type limits (case-insensitive keys)\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits.Behavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERejectNewLogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReject a new device or revoke oldest eligible active device(s)\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe feature is disabled until one or more quotas are configured.\u003C/p\u003E\n\u003Cp\u003EMultiple active chains sharing the same \u003Ccode\u003EDeviceId\u003C/code\u003E count as one device.\u003C/p\u003E\n\u003Cp\u003EBuilt-in browser clients are classified as \u003Ccode\u003Eweb\u003C/code\u003E, regardless of operating system.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EDeviceLimits\u003C/code\u003E is the supported active-device enforcement mechanism. Reserved \u003Ccode\u003ESession.MaxChainsPerUser\u003C/code\u003E, \u003Ccode\u003EMaxChainsPerPlatform\u003C/code\u003E, and category-based chain settings do not enforce these quotas.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/sessions-devices/device-limits\u0022\u003EDevice Limits\u003C/a\u003E for admission, eviction, persistence, and migration behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-specific-session-defaults\u0022\u003EMode-Specific Session Defaults\u003C/h3\u003E\n\u003Cp\u003ESession settings can also be affected by authentication mode defaults.\u003C/p\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EPureOpaque\u003C/code\u003E supplies a longer idle timeout and touch interval when those values have not been configured.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EHybrid\u003C/code\u003E explicitly sets \u003Ccode\u003ETouchInterval\u003C/code\u003E to \u003Ccode\u003Enull\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E for the effective-options resolution order.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-options\u0022\u003E5. Token Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Token\u003C/code\u003E configures access and refresh token behavior.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Token.Issuer = \u0026quot;MyApplication\u0026quot;;\n options.Token.Audience = \u0026quot;MyApplicationApi\u0026quot;;\n options.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n options.Token.RefreshTokenLifetime = TimeSpan.FromDays(7);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-1\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssueJwt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable JWT issuance where supported by the effective mode\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssueOpaque\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable opaque token issuance where supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssueRefresh\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable refresh token issuance where supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAccessTokenLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E10 minutes\u003C/td\u003E\n\u003Ctd\u003EAccess token lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshTokenLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E7 days\u003C/td\u003E\n\u003Ctd\u003ERefresh token lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOpaqueIdBytes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E32\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERandom byte length used for opaque token identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshTokenConcurrentRequestWindow\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E2 seconds\u003C/td\u003E\n\u003Ctd\u003EConcurrent duplicate refresh classification window\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssuer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT issuer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAudience\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClient\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT audience\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAddJwtIdClaim\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude a JWT identifier claim\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EKeyId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional signing key identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-concurrency-window\u0022\u003ERefresh Token Concurrency Window\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Token.RefreshTokenConcurrentRequestWindow = TimeSpan.FromSeconds(2);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis option controls how the server distinguishes a closely timed duplicate refresh request from a confirmed replay.\u003C/p\u003E\n\u003Cp\u003EA duplicate refresh request is still rejected.\u003C/p\u003E\n\u003Cp\u003EThe window affects the replay-response classification, including whether the token family should be revoked.\u003C/p\u003E\n\u003Cp\u003EIt does \u003Cstrong\u003Enot\u003C/strong\u003E allow the same consumed refresh token to be used successfully more than once.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-defaults-may-override-token-values\u0022\u003EMode Defaults May Override Token Values\u003C/h3\u003E\n\u003Cp\u003EThe effective \u003Ccode\u003EHybrid\u003C/code\u003E configuration explicitly sets:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.AccessTokenLifetime = TimeSpan.FromMinutes(10);\nToken.RefreshTokenLifetime = TimeSpan.FromDays(7);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ETherefore, a different value configured globally may be replaced when the effective mode is resolved.\u003C/p\u003E\n\u003Cp\u003ETo customize the lifetime for \u003Ccode\u003EHybrid\u003C/code\u003E, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis distinction is essential when configuring token lifetimes.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pkce-options\u0022\u003E6. PKCE Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Pkce\u003C/code\u003E configures the lifetime of PKCE authorization codes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Pkce.AuthorizationCodeLifetimeSeconds = 120;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthorizationCodeLifetimeSeconds\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E120\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELifetime of a PKCE authorization code\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EPKCE is particularly important for browser-based clients such as Blazor WebAssembly.\u003C/p\u003E\n\u003Cp\u003EA shorter authorization code lifetime reduces the period during which an intercepted or exposed code could potentially be used.\u003C/p\u003E\n\u003Cp\u003EHowever, the value must remain long enough for legitimate authorization exchanges to complete.\u003C/p\u003E\n\u003Cp\u003EThe server\u0027s PKCE configuration is separate from the client\u0027s PKCE flow settings.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-modes\u0022\u003E7. Authentication Modes\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports authentication mode resolution based on the application profile.\u003C/p\u003E\n\u003Cp\u003EThe server exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AllowedModes\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis property restricts the modes the server is permitted to use.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022restrict-allowed-modes\u0022\u003ERestrict Allowed Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E is a restriction, not a mode selector.\u003C/p\u003E\n\u003Cp\u003EThe effective mode is resolved by \u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-mode-resolution\u0022\u003EDefault Mode Resolution\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth resolves the effective authentication mode using the application profile unless the server explicitly configures \u003Ccode\u003EAuthMode\u003C/code\u003E or \u003Ccode\u003EApplicationProfileModes\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication Profile\u003C/th\u003E\n\u003Cth\u003EDefault Mode\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazorServer\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EWebServer\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazorWasm\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMaui\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EApi\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EResourceApi\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe server controls the effective authentication mode. Application profile metadata is not an authorization boundary.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAuthMode\u003C/code\u003E forces a single mode for the server, while \u003Ccode\u003EApplicationProfileModes\u003C/code\u003E provides explicit profile-specific mappings. These configuration mechanisms cannot be combined.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E restricts permitted modes but does not select a mode.\u003C/p\u003E\n\u003Cp\u003EPureJwt is implemented. SemiHybrid remains unavailable.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022explicit-purejwt-configuration\u0022\u003EExplicit PureJwt Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthMode = UAuthMode.PureJwt;\n\n options.Token.Issuer = \u0026quot;https://auth.example.com\u0026quot;;\n options.Token.Audience = \u0026quot;products-api\u0026quot;;\n\n options.Cryptography.JwtSigningKey = builder.Configuration[\u0026quot;UltimateAuth:JwtSigningKey\u0026quot;];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe JWT signing key must be a Base64-encoded cryptographic key containing at least 32 bytes of key material.\u003C/p\u003E\n\u003Cp\u003EUse a cryptographically secure, independently generated key in production. Do not reuse the JWT signing key as the token-hashing key.\u003C/p\u003E\n\u003Cp\u003EPureJwt does not create authentication sessions, but refresh-token persistence is still required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-mode-specific-behavior\u0022\u003EConfigure Mode-Specific Behavior\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003EConfigureMode()\u003C/code\u003E for behavior that should differ by mode.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.PureOpaque, mode =\u0026gt;\n {\n mode.Session.IdleTimeout = TimeSpan.FromDays(7);\n });\n\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe mode override runs after the built-in mode defaults.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E for details.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-options\u0022\u003E8. Endpoint Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Endpoints\u003C/code\u003E controls endpoint paths, feature groups, and individual action restrictions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022base-path\u0022\u003EBase Path\u003C/h3\u003E\n\u003Cp\u003EThe default server endpoint base path is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E/auth\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EConfigure it through:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EChanging the base path can help avoid route conflicts when integrating UltimateAuth into an existing application.\u003C/p\u003E\n\u003Cp\u003EThe client must use compatible endpoint paths.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-groups\u0022\u003EEndpoint Groups\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthentication\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESession\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession management endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserLifecycle\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser lifecycle endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser profile endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserIdentifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier management endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentials\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential management endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthorization\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthorization endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.Authentication = true;\n options.Endpoints.Session = true;\n options.Endpoints.Authorization = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDisabling an endpoint group controls endpoint exposure. It does not automatically remove the underlying domain services or invalidate previously issued credentials.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-individual-actions\u0022\u003EDisable Individual Actions\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EDisabledActions\u003C/code\u003E is a collection of action identifiers:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.DisabledActions.Add(\u0026quot;users.create.anonymous\u0026quot;);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe string must match the action identifier used by the server\u0027s endpoint registration and action policy.\u003C/p\u003E\n\u003Cp\u003EDo not pass a C# constant name as a string unless that exact text is also the registered action value.\u003C/p\u003E\n\u003Cp\u003EFor example, these are not necessarily equivalent:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E\u0026quot;UAuthActions.Users.Create.Anonymous\u0026quot;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Eand:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E\u0026quot;users.create.anonymous\u0026quot;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUse the actual action value defined by the corresponding \u003Ccode\u003EUAuthActions\u003C/code\u003E constant.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-hardening\u0022\u003EEndpoint Hardening\u003C/h3\u003E\n\u003Cp\u003EDisable endpoints that are not required by the application.\u003C/p\u003E\n\u003Cp\u003EFor example, an application that delegates user provisioning to administrators may choose to disable anonymous user creation.\u003C/p\u003E\n\u003Cp\u003EEndpoint exposure is a separate concern from authorization: an exposed endpoint must still enforce the applicable security policy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-resolution\u0022\u003E9. Session Resolution\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.SessionResolution\u003C/code\u003E controls how incoming requests provide session identifiers.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports four resolution sources:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBearer credentials.\u003C/li\u003E\n\u003Cli\u003ECustom headers.\u003C/li\u003E\n\u003Cli\u003ECookies.\u003C/li\u003E\n\u003Cli\u003EQuery parameters.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-configuration\u0022\u003EDefault Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableBearer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableHeader\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableCookie\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableQuery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHeaderName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EX-UAuth-Session\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EQueryParameterName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Esession_id\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default precedence order is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBearer\nHeader\nCookie\nQuery\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-resolution-sources\u0022\u003EConfigure Resolution Sources\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.SessionResolution.EnableBearer = true;\n options.SessionResolution.EnableHeader = false;\n options.SessionResolution.EnableCookie = true;\n options.SessionResolution.EnableQuery = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis example disables custom-header and query-string session resolution.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022change-resolution-order\u0022\u003EChange Resolution Order\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.SessionResolution.Order =\n [\n \u0026quot;Cookie\u0026quot;,\n \u0026quot;Bearer\u0026quot;,\n \u0026quot;Header\u0026quot;,\n \u0026quot;Query\u0026quot;\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResolution order matters when a request contains multiple candidate credentials.\u003C/p\u003E\n\u003Cp\u003EThe selected credential must still pass authentication and session validation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-recommendation\u0022\u003ESecurity Recommendation\u003C/h3\u003E\n\u003Cp\u003EAvoid query-string credentials unless the application has a specific, well-understood requirement.\u003C/p\u003E\n\u003Cp\u003EURLs may be recorded in browser history, reverse-proxy logs, analytics systems, and other infrastructure.\u003C/p\u003E\n\u003Cp\u003EFor most browser and API integrations, cookies or authorization headers are preferable.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022cookie-configuration\u0022\u003E10. Cookie Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Cookie\u003C/code\u003E controls cookies used for authentication credentials.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth defines three cookie groups:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Cookie.Session\noptions.Cookie.AccessToken\noptions.Cookie.RefreshToken\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-cookie-names\u0022\u003EDefault Cookie Names\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ECookie\u003C/th\u003E\n\u003Cth\u003EDefault name\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euas\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess token\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euat\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh token\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euar\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default cookie options use:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EHttpOnly = true\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ESecurePolicy = CookieSecurePolicy.Always\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EPath = \u0026quot;/\u0026quot;\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EDomain = null\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EMaxAge = null\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003E\u003Ccode\u003ESameSite\u003C/code\u003E is nullable and can be resolved through the applicable cookie and deployment policies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022customize-cookie-names\u0022\u003ECustomize Cookie Names\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cookie.Session.Name = \u0026quot;myapp_session\u0026quot;;\n options.Cookie.RefreshToken.Name = \u0026quot;myapp_refresh\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-cookie-scope\u0022\u003EConfigure Cookie Scope\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cookie.Session.Path = \u0026quot;/\u0026quot;;\n options.Cookie.Session.Domain = null;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA null domain produces a host-only cookie.\u003C/p\u003E\n\u003Cp\u003ESetting a parent domain can broaden cookie availability to subdomains and should be done only when necessary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022cookie-security\u0022\u003ECookie Security\u003C/h3\u003E\n\u003Cp\u003EAvoid disabling \u003Ccode\u003EHttpOnly\u003C/code\u003E or relaxing secure transport requirements for authentication cookies.\u003C/p\u003E\n\u003Cp\u003ECookie settings interact with:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe deployment mode.\u003C/li\u003E\n\u003Cli\u003ECross-site requests.\u003C/li\u003E\n\u003Cli\u003EBrowser cookie policies.\u003C/li\u003E\n\u003Cli\u003ECredential delivery configuration.\u003C/li\u003E\n\u003Cli\u003EHTTPS requirements.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor cross-site deployments, configure cookie behavior together with CORS and the relevant browser security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022hub-deployment-mode\u0022\u003E11. Hub Deployment Mode\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.HubDeploymentMode\u003C/code\u003E describes how UAuthHub is deployed relative to the application.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.HubDeploymentMode = UAuthHubDeploymentMode.Embedded;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-modes\u0022\u003EAvailable Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEmbedded\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub and application share the same origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIntegrated\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub is separate but within the same-site boundary\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EExternal\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub is hosted on a different site or domain\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthHubDeploymentMode.Integrated\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022embedded\u0022\u003EEmbedded\u003C/h3\u003E\n\u003Cp\u003ESuitable for applications hosting UltimateAuth within the same application and origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.HubDeploymentMode = UAuthHubDeploymentMode.Embedded;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022integrated\u0022\u003EIntegrated\u003C/h3\u003E\n\u003Cp\u003ESuitable for deployments such as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Eauth.example.com\napp.example.com\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Ewhere the authentication service and application are separate origins within the same site.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022external\u0022\u003EExternal\u003C/h3\u003E\n\u003Cp\u003ESuitable for a separate authentication provider domain.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.HubDeploymentMode = UAuthHubDeploymentMode.External;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EExternal deployment requires careful coordination of cookie policies, redirects, allowed origins, and browser restrictions.\u003C/p\u003E\n\u003Cp\u003EThe deployment mode influences authentication transport behavior; it is not merely descriptive metadata.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022hub-options\u0022\u003E12. Hub Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Hub\u003C/code\u003E configures UAuthHub integration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-2\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EClientBaseAddress\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional client application base address\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowedClientOrigins\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEmpty set\u003C/td\u003E\n\u003Ctd\u003EAllowed client origins\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EFlowLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E5 minutes\u003C/td\u003E\n\u003Ctd\u003ELifetime of Hub flow artifacts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/login\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub login page path\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Hub.ClientBaseAddress = \u0026quot;https://app.example.com\u0026quot;;\n options.Hub.AllowedClientOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n options.Hub.FlowLifetime = TimeSpan.FromMinutes(5);\n options.Hub.LoginPath = \u0026quot;/login\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Hub flow lifetime is not the same as the authenticated session lifetime.\u003C/p\u003E\n\u003Cp\u003EHub artifacts support authentication orchestration and should generally be short-lived.\u003C/p\u003E\n\u003Cp\u003EOnly trusted origins should be included in \u003Ccode\u003EAllowedClientOrigins\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022primary-credential-policy\u0022\u003E13. Primary Credential Policy\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.PrimaryCredential\u003C/code\u003E controls which credential kind is preferred for UI and API requests.\u003C/p\u003E\n\u003Cp\u003EThe defaults are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryTokenKind.Session\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryTokenKind.AccessToken\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-1\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.PrimaryCredential.Ui = PrimaryTokenKind.Session;\n options.PrimaryCredential.Api = PrimaryTokenKind.AccessToken;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows UltimateAuth to distinguish between session-oriented browser interactions and access-token-oriented API interactions.\u003C/p\u003E\n\u003Cp\u003EThe primary credential policy does not bypass authentication validation.\u003C/p\u003E\n\u003Cp\u003EIt determines which credential kind should be preferred within the applicable request-processing rules.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-session-policy\u0022\u003E14. Credential Session Policy\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.CredentialSessionPolicy\u003C/code\u003E determines what happens to active session chains after credential changes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-3\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnSelfChange\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreserveCurrent\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser changes their own credential\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnAdminChange\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERevokeAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAdministrator changes a user\u0027s credential\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnRecovery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERevokeAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential recovery completes\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-2\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.CredentialSessionPolicy.OnSelfChange = CredentialSessionBehavior.PreserveCurrent;\n options.CredentialSessionPolicy.OnAdminChange = CredentialSessionBehavior.RevokeAll;\n options.CredentialSessionPolicy.OnRecovery = CredentialSessionBehavior.RevokeAll;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-behaviors\u0022\u003EAvailable Behaviors\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003Cth\u003EEffect\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreserveAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EKeep existing session chains\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreserveCurrent\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EKeep the current chain and revoke other applicable chains\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERevokeAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke all applicable session chains\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor recovery flows, \u003Ccode\u003EPreserveCurrent\u003C/code\u003E is not always meaningful because the user may not have an authenticated current session.\u003C/p\u003E\n\u003Cp\u003EThe current implementation treats this situation using the more restrictive \u003Ccode\u003ERevokeAll\u003C/code\u003E behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-recommendation-1\u0022\u003ESecurity Recommendation\u003C/h3\u003E\n\u003Cp\u003EPreserving the current session after a normal password change can provide a reasonable user experience.\u003C/p\u003E\n\u003Cp\u003ERevoking all sessions after administrative credential changes or account recovery is generally more conservative.\u003C/p\u003E\n\u003Cp\u003EChoose the policy according to the application\u0027s security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-reset-options\u0022\u003E15. Credential Reset Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.ResetCredential\u003C/code\u003E configures credential recovery proof lifetimes and attempt limits.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022defaults\u0022\u003EDefaults\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETokenValidity\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E30 minutes\u003C/td\u003E\n\u003Ctd\u003EReset token lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECodeValidity\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E10 minutes\u003C/td\u003E\n\u003Ctd\u003ENumeric reset code lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxAttempts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMaximum permitted recovery attempts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECodeLength\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E6\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENumeric reset code length\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-3\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ResetCredential.TokenValidity = TimeSpan.FromMinutes(20);\n options.ResetCredential.CodeValidity = TimeSpan.FromMinutes(5);\n options.ResetCredential.MaxAttempts = 3;\n options.ResetCredential.CodeLength = 6;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ECodeLength\u003C/code\u003E applies to numeric reset codes, not token-based recovery proofs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-security-boundary\u0022\u003EImportant Security Boundary\u003C/h3\u003E\n\u003Cp\u003EReset proofs must be delivered through a trusted server-side mechanism.\u003C/p\u003E\n\u003Cp\u003EDo not return recovery tokens to anonymous callers simply to simplify a client-side reset form.\u003C/p\u003E\n\u003Cp\u003EThe application should provide the appropriate \u003Ccode\u003EICredentialResetNotifier\u003C/code\u003E implementation for supported recovery flows.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-identifier-options\u0022\u003E16. Login Identifier Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.LoginIdentifiers\u003C/code\u003E determines which identifier types can be used for login.\u003C/p\u003E\n\u003Cp\u003EThe default allowed types are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUserIdentifierType.Username\nUserIdentifierType.Email\nUserIdentifierType.Phone\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022restrict-login-identifier-types\u0022\u003ERestrict Login Identifier Types\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.LoginIdentifiers.AllowedTypes =\n new HashSet\u0026lt;UserIdentifierType\u0026gt;\n {\n UserIdentifierType.Email\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis configures email as the allowed login identifier type.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022require-verification\u0022\u003ERequire Verification\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.LoginIdentifiers.RequireVerificationForEmail = true;\n options.LoginIdentifiers.RequireVerificationForPhone = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings control whether the corresponding identifiers must be verified before being accepted for login.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-resolvers\u0022\u003ECustom Resolvers\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableCustomResolvers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECustomResolversFirst\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese options control the participation and ordering of custom login identifier resolvers.\u003C/p\u003E\n\u003Cp\u003EAn identifier existing on a user account does not necessarily mean it is permitted for login.\u003C/p\u003E\n\u003Cp\u003EIdentifier management and login eligibility are separate concerns.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-validation\u0022\u003E17. Identifier Validation\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.IdentifierValidation\u003C/code\u003E provides rules for usernames, email addresses, and phone numbers.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022username-rules\u0022\u003EUsername Rules\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.IdentifierValidation.UserName.Enabled = true;\n options.IdentifierValidation.UserName.MinLength = 3;\n options.IdentifierValidation.UserName.MaxLength = 32;\n options.IdentifierValidation.UserName.AllowedRegex = \u0026quot;^[a-zA-Z0-9._-]\u002B$\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-validation-rules\u0022\u003EDefault Validation Rules\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EIdentifier\u003C/th\u003E\n\u003Cth\u003EEnabled\u003C/th\u003E\n\u003Cth\u003EMinimum length\u003C/th\u003E\n\u003Cth\u003EMaximum length\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUsername\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E64\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEmail\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E256\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPhone\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E24\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EUsername validation additionally supports \u003Ccode\u003EAllowedRegex\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe default username expression is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EREGEX\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-regex\u0022\u003E^[a-zA-Z0-9._-]\u002B$\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-behavior\u0022\u003EIdentifier Behavior\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Identifiers\u003C/code\u003E contains additional groups:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Identifiers.Behavior\noptions.Identifiers.Validation\noptions.Identifiers.Normalization\noptions.Identifiers.Uniqueness\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese configure identifier behavior beyond the top-level validation rules.\u003C/p\u003E\n\u003Cp\u003EIdentifier normalization and uniqueness are particularly important because they affect how duplicate identifiers are detected.\u003C/p\u003E\n\u003Cp\u003EUse the provided options rather than implementing inconsistent normalization independently in the client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-limits\u0022\u003EIdentifier Limits\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth supports configurable limits on the number of identifiers associated with each user.\u003C/p\u003E\n\u003Cp\u003EBy default, a user can have up to \u003Cstrong\u003E10 active identifiers\u003C/strong\u003E, regardless of their type.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Identifiers.Behavior.MaxIdentifiersPerUser = 10;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is a global per-user limit. It applies to the combined number of usernames, email addresses, phone numbers, and custom identifiers.\u003C/p\u003E\n\u003Ch4 id=\u0022optional-per-type-limits\u0022\u003EOptional Per-Type Limits\u003C/h4\u003E\n\u003Cp\u003EApplications can optionally define limits for individual identifier types:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Identifiers.Behavior.MaxIdentifiersPerUser = 10;\n\noptions.Identifiers.Behavior.MaxIdentifiersPerType = new()\n{\n [UserIdentifierType.Username] = 2,\n [UserIdentifierType.Email] = 5,\n [UserIdentifierType.Phone] = 3\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EPer-type limits are not configured by default.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhen no per-type limit is specified, only the global limit applies.\u003C/p\u003E\n\u003Cp\u003EFor example, with the configuration above, a user may have up to five email addresses, but the combined number of all active identifiers cannot exceed ten.\u003C/p\u003E\n\u003Ch4 id=\u0022default-behavior\u0022\u003EDefault Behavior\u003C/h4\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxIdentifiersPerUser\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E10\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMaximum total active identifiers per user\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxIdentifiersPerType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEmpty dictionary\u003C/td\u003E\n\u003Ctd\u003EOptional limits for individual identifier types\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe following rules apply:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EPrimary and non-primary identifiers count equally.\u003C/li\u003E\n\u003Cli\u003ESoft-deleted identifiers do not count toward active limits.\u003C/li\u003E\n\u003Cli\u003ESelf-service and administrative operations follow the same limits.\u003C/li\u003E\n\u003Cli\u003EPer-type limits do not override the global limit.\u003C/li\u003E\n\u003Cli\u003EExisting identifier behavior options remain applicable.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EAllowMultipleUsernames = false\u003C/code\u003E still prevents multiple usernames, even when the configured username limit is greater than one.\u003C/p\u003E\n\u003Ch4 id=\u0022limit-validation\u0022\u003ELimit Validation\u003C/h4\u003E\n\u003Cp\u003EWhen an identifier addition exceeds a configured limit, the operation is rejected with a validation error.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EError Code\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003Eidentifier_total_limit_exceeded\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EThe user has reached the global identifier limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003Eidentifier_type_limit_exceeded\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EThe user has reached the configured limit for that identifier type\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EApplications should handle these errors and display appropriate feedback.\u003C/p\u003E\n\u003Cp\u003EIdentifier limits are enforced by the Users application layer rather than individual persistence stores.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022user-profile-options\u0022\u003E18. User Profile Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.UserProfile\u003C/code\u003E controls profile-related capabilities.\u003C/p\u003E\n\u003Cp\u003EThe current option is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.UserProfile.EnableMultiProfile\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts default is \u003Ccode\u003Efalse\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enable-multiple-profiles\u0022\u003EEnable Multiple Profiles\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.UserProfile.EnableMultiProfile = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows applications to use UltimateAuth\u0027s multiple-profile capability where supported by the user domain.\u003C/p\u003E\n\u003Cp\u003EFor example, an application may maintain separate profile contexts for different purposes.\u003C/p\u003E\n\u003Cp\u003EMulti-profile support does not create separate user identities or independent authentication accounts.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022multi-tenant-options\u0022\u003E19. Multi-Tenant Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.MultiTenant\u003C/code\u003E controls whether tenant-aware behavior is enabled and how tenant identifiers are resolved.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-4\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable multi-tenant behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENormalizeToLowercase\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENormalize tenant identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableRoute\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenants from routes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableHeader\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenants from headers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableDomain\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenants from hosts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHeaderName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EX-Tenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant header name\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-header-based-tenant-resolution\u0022\u003EExample: Header-Based Tenant Resolution\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.EnableHeader = true;\n options.MultiTenant.HeaderName = \u0026quot;X-Tenant\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-domain-based-resolution\u0022\u003EExample: Domain-Based Resolution\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.EnableDomain = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EMultiple resolution mechanisms can be enabled.\u003C/p\u003E\n\u003Cp\u003EThe server composes the configured tenant resolvers according to its resolution infrastructure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-boundary\u0022\u003ESecurity Boundary\u003C/h3\u003E\n\u003Cp\u003ETenant identification is not tenant authorization.\u003C/p\u003E\n\u003Cp\u003EA request providing another tenant identifier must not gain access to that tenant without appropriate authorization.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for tenant isolation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pagination-options\u0022\u003E20. Pagination Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Pagination\u003C/code\u003E controls pagination defaults and maximum page sizes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultPageSize\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E250\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxPageSize\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E1000\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-4\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Pagination.DefaultPageSize = 50;\n options.Pagination.MaxPageSize = 200;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings affect paginated queries exposed by UltimateAuth domain services.\u003C/p\u003E\n\u003Cp\u003EFor administrative interfaces, choosing a moderate page size can reduce unnecessary data transfer and processing.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022navigation-options\u0022\u003E21. Navigation Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Navigation\u003C/code\u003E configures automatic authentication navigation behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-5\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableAutomaticNavigationRedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAccessDeniedResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-redirects\u0022\u003EDisable Automatic Redirects\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Navigation.EnableAutomaticNavigationRedirect = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-login-redirect\u0022\u003ECustom Login Redirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Navigation.LoginResolver = context =\u0026gt;\n {\n return \u0026quot;/account/login\u0026quot;;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-access-denied-redirect\u0022\u003ECustom Access Denied Redirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Navigation.AccessDeniedResolver = context =\u0026gt;\n {\n return \u0026quot;/account/access-denied\u0026quot;;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese delegates receive the current \u003Ccode\u003EHttpContext\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe application should return valid, trusted navigation destinations.\u003C/p\u003E\n\u003Cp\u003EAvoid constructing redirects from unvalidated user-controlled URLs.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-response-options\u0022\u003E22. Authentication Response Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.AuthResponse\u003C/code\u003E controls how authentication credentials and redirect behavior are represented in responses.\u003C/p\u003E\n\u003Cp\u003EThe available groups are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AuthResponse.SessionIdDelivery\noptions.AuthResponse.AccessTokenDelivery\noptions.AuthResponse.RefreshTokenDelivery\n\noptions.AuthResponse.Login\noptions.AuthResponse.Logout\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings govern credential delivery and authentication response behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-mode-specific-response-defaults\u0022\u003EImportant: Mode-Specific Response Defaults\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth provides response templates for authentication modes.\u003C/p\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EPureOpaque\u003C/code\u003E uses a session-oriented cookie response, while \u003Ccode\u003EHybrid\u003C/code\u003E combines session and token delivery behavior.\u003C/p\u003E\n\u003Cp\u003EThe effective response may therefore depend on the resolved authentication mode and flow.\u003C/p\u003E\n\u003Cp\u003EDo not assume that a single globally configured response delivery setting applies unchanged to every authentication mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003ECredential delivery settings determine whether sensitive authentication material is exposed through cookies, headers, or other response mechanisms.\u003C/p\u003E\n\u003Cp\u003EOnly customize them when the application has a clear requirement and the selected transport is appropriate for the client platform.\u003C/p\u003E\n\u003Cp\u003EFor advanced response customization, see \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022diagnostics-options\u0022\u003E23. Diagnostics Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Diagnostics\u003C/code\u003E provides optional diagnostic behavior.\u003C/p\u003E\n\u003Cp\u003EThe current property is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Diagnostics.EnableRefreshDetails\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts default is \u003Ccode\u003Efalse\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-5\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Diagnostics.EnableRefreshDetails = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen enabled, the option allows additional refresh-related diagnostic response information, such as the \u003Ccode\u003EX-UAuth-Refresh\u003C/code\u003E header.\u003C/p\u003E\n\u003Cp\u003EThis is primarily useful during development and debugging.\u003C/p\u003E\n\u003Cp\u003EAvoid enabling detailed authentication diagnostics in production unless the exposure is understood and justified.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-lifecycle-events\u0022\u003E24. Authentication Lifecycle Events\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Events\u003C/code\u003E exposes server-side authentication lifecycle callbacks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-events\u0022\u003EAvailable Events\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Events.OnAnyEvent\noptions.Events.OnUserLoggedIn\noptions.Events.OnUserLoggedOut\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-login-logging\u0022\u003EExample: Login Logging\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnUserLoggedIn = context =\u0026gt;\n {\n // Record the successful login.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-global-event-handler\u0022\u003EExample: Global Event Handler\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnAnyEvent = context =\u0026gt;\n {\n // Process an authentication lifecycle event.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ELifecycle events are intended for lightweight reactions such as logging, metrics, and notifications.\u003C/p\u003E\n\u003Cp\u003EThey should not replace security decisions, authentication validation, or application policies.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E for event and extension guidance.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022in-memory-auth-artifact-store\u0022\u003E25. In-Memory Auth Artifact Store\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses a bounded in-memory store by default for temporary authentication artifacts, including PKCE authorization codes and login preview receipts.\u003C/p\u003E\n\u003Cp\u003EExpired artifacts are rejected on access and periodically removed in the background, even when they are never accessed again. The store also enforces a maximum number of entries to prevent unbounded accumulation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDefault configuration\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.MaxEntries\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E50,000\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMaximum retained artifacts per application instance\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.CleanupInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E1 minute\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInterval between expiration cleanup passes\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese defaults require no additional configuration.\u003C/p\u003E\n\u003Cp\u003ETo customize them:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthArtifacts.MaxEntries = 200_000;\n options.AuthArtifacts.CleanupInterval = TimeSpan.FromMinutes(5);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen capacity is reached, the store attempts to reclaim expired entries. If it remains full, new artifacts are rejected without evicting valid authentication proofs.\u003C/p\u003E\n\u003Cp\u003EExpiration is always enforced when an artifact is accessed or consumed, independently of the cleanup interval. Atomic consume-once semantics are preserved.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDeployment notes:\u003C/strong\u003E Capacity limits are process-local, not shared across application instances. Custom \u003Ccode\u003EIAuthStore\u003C/code\u003E implementations are responsible for their own expiration and capacity management. Choose limits according to expected authentication traffic and available memory.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022effective-server-options\u0022\u003E26. Effective Server Options\u003C/h2\u003E\n\u003Cp\u003EThe configured \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E instance is the base configuration.\u003C/p\u003E\n\u003Cp\u003EAt runtime, UltimateAuth can resolve:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EEffectiveUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current resolution process is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EConfigured UAuthServerOptions\n |\n v\n Resolve auth mode\n |\n v\n Clone base options\n |\n v\n Apply mode defaults\n |\n v\n Apply ConfigureMode overrides\n |\n v\n EffectiveUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis means that the effective settings used for a \u003Ccode\u003EHybrid\u003C/code\u003E client can differ from those used for a \u003Ccode\u003EPureOpaque\u003C/code\u003E client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-6\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromDays(7);\n\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n\n options.ConfigureMode(UAuthMode.PureOpaque, mode =\u0026gt;\n {\n mode.Session.IdleTimeout = TimeSpan.FromDays(3);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe original options remain the common starting point.\u003C/p\u003E\n\u003Cp\u003EMode defaults and overrides determine the effective values for the resolved mode.\u003C/p\u003E\n\u003Cp\u003EFor implementation details and inspection of effective options, see \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-and-configuration-safety\u0022\u003E27. Validation and Configuration Safety\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth Server registers multiple options validators and enables startup validation.\u003C/p\u003E\n\u003Cp\u003EThese validators cover areas including:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ELogin settings.\u003C/li\u003E\n\u003Cli\u003ESession settings.\u003C/li\u003E\n\u003Cli\u003EToken settings.\u003C/li\u003E\n\u003Cli\u003EPKCE.\u003C/li\u003E\n\u003Cli\u003EMulti-tenancy.\u003C/li\u003E\n\u003Cli\u003EIdentifier configuration.\u003C/li\u003E\n\u003Cli\u003ESession resolution.\u003C/li\u003E\n\u003Cli\u003EPagination.\u003C/li\u003E\n\u003Cli\u003EGeneral server configuration.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-invalid-session-lifetime\u0022\u003EExample: Invalid Session Lifetime\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.Zero;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server rejects an invalid session lifetime under the applicable validation rules.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-invalid-base-path\u0022\u003EExample: Invalid Base Path\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;//auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe general server validator rejects paths containing \u003Ccode\u003E//\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022unsupported-modes\u0022\u003EUnsupported Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureJwt\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current validator rejects explicitly enabling \u003Ccode\u003EPureJwt\u003C/code\u003E because that mode is not yet implemented as a supported server mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-limitations\u0022\u003EValidation Limitations\u003C/h3\u003E\n\u003Cp\u003EStartup validation protects the configured options according to the registered validators.\u003C/p\u003E\n\u003Cp\u003EIt does not guarantee that every custom service implementation or mode-specific override is secure.\u003C/p\u003E\n\u003Cp\u003EWhen using advanced customization, test the resulting effective configuration and authentication flows.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-configuration-example\u0022\u003E28. Complete Configuration Example\u003C/h2\u003E\n\u003Cp\u003EThe following example combines several commonly used server settings.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n // Authentication modes\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n\n // Login security\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Login.IncludeFailureDetails = false;\n\n // Sessions\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Session.MaxLifetime = TimeSpan.FromDays(30);\n\n // Token identity\n options.Token.Issuer = \u0026quot;MyApplication\u0026quot;;\n options.Token.Audience = \u0026quot;MyApplicationApi\u0026quot;;\n\n // Hybrid-specific token lifetime\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n });\n\n // PKCE\n options.Pkce.AuthorizationCodeLifetimeSeconds = 120;\n\n // Hub deployment\n options.HubDeploymentMode = UAuthHubDeploymentMode.Integrated;\n options.Hub.ClientBaseAddress = \u0026quot;https://app.example.com\u0026quot;;\n options.Hub.AllowedClientOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n\n // Credential security\n options.CredentialSessionPolicy.OnSelfChange = CredentialSessionBehavior.PreserveCurrent;\n options.CredentialSessionPolicy.OnAdminChange = CredentialSessionBehavior.RevokeAll;\n options.CredentialSessionPolicy.OnRecovery = CredentialSessionBehavior.RevokeAll;\n\n // Credential recovery\n options.ResetCredential.TokenValidity = TimeSpan.FromMinutes(30);\n options.ResetCredential.MaxAttempts = 3;\n\n // Identifier login rules\n options.LoginIdentifiers.RequireVerificationForEmail = true;\n\n // Session transport\n options.SessionResolution.EnableCookie = true;\n options.SessionResolution.EnableBearer = true;\n options.SessionResolution.EnableQuery = false;\n\n // Endpoint exposure\n options.Endpoints.Authentication = true;\n options.Endpoints.Session = true;\n options.Endpoints.Credentials = true;\n options.Endpoints.Authorization = true;\n\n // Pagination\n options.Pagination.DefaultPageSize = 50;\n options.Pagination.MaxPageSize = 200;\n\n // Diagnostics\n options.Diagnostics.EnableRefreshDetails = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an illustrative configuration, not a universal production preset.\u003C/p\u003E\n\u003Cp\u003EApplications should choose session lifetimes, authentication modes, credential transport, tenant behavior, and endpoint exposure according to their own deployment and security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-configuration-mistakes\u0022\u003E29. Common Configuration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuring-core-options-separately\u0022\u003EConfiguring Core Options Separately\u003C/h3\u003E\n\u003Cp\u003EWhen using \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E, configure Core-defined options through \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EA separate \u003Ccode\u003EUAuthOptions\u003C/code\u003E configuration does not automatically override the server\u0027s composed options.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-allowedmodes-selects-the-mode\u0022\u003EAssuming AllowedModes Selects the Mode\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E is a restriction.\u003C/p\u003E\n\u003Cp\u003EMode selection is performed by the authentication mode resolver.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ignoring-mode-defaults\u0022\u003EIgnoring Mode Defaults\u003C/h3\u003E\n\u003Cp\u003EMode-specific defaults can replace globally configured values.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EConfigureMode()\u003C/code\u003E for explicit mode-specific behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enabling-unsupported-modes\u0022\u003EEnabling Unsupported Modes\u003C/h3\u003E\n\u003Cp\u003EAn authentication mode appearing in an enum does not guarantee runtime support.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-reserved-session-options-as-enforced-security-features\u0022\u003ETreating Reserved Session Options as Enforced Security Features\u003C/h3\u003E\n\u003Cp\u003ESome device and session-chain options are reserved for future enforcement.\u003C/p\u003E\n\u003Cp\u003EVerify actual runtime support before relying on them.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022exposing-unnecessary-endpoints\u0022\u003EExposing Unnecessary Endpoints\u003C/h3\u003E\n\u003Cp\u003EDisable endpoint groups or actions that the application does not require.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022allowing-query-string-credentials-without-a-specific-need\u0022\u003EAllowing Query-String Credentials Without a Specific Need\u003C/h3\u003E\n\u003Cp\u003EQuery-string credentials can leak through URLs and infrastructure logs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022weakening-cookie-security\u0022\u003EWeakening Cookie Security\u003C/h3\u003E\n\u003Cp\u003EDo not relax secure transport or cookie protections without understanding the consequences.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-configuration-validation-covers-everything\u0022\u003EAssuming Configuration Validation Covers Everything\u003C/h3\u003E\n\u003Cp\u003EStartup validation does not replace testing, infrastructure security, or validation of custom extension implementations.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-options-quick-reference\u0022\u003E30. Server Options Quick Reference\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EConfiguration group\u003C/th\u003E\n\u003Cth\u003ETypical use\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPermitted authentication modes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIn-memory authentication artifact capacity and expiration cleanup\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential delivery\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMode-specific option overrides\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECookie\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECookie security and scope\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialSessionPolicy\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession invalidation after credential changes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnforced global and per-type active-device admission limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDiagnostics\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh diagnostics\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEndpoint exposure\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication lifecycle callbacks\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubDeploymentMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub deployment topology\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifierValidation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin attempts and lockout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin identifier eligibility\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant resolution\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENavigation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication redirects\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnConfigureEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAdvanced endpoint customization\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPagination\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EQuery page limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE code lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUI/API primary credential selection\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResetCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential recovery rules\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESession\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession expiration and lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESessionResolution\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential source precedence\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EToken\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EToken issuance and lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMulti-profile capability\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/configuration\u0022\u003EConfiguration Overview\u003C/a\u003E \u2014 Understand the configuration architecture and precedence.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure client SDK behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E \u2014 Explore effective options, mode resolution, and extension points.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/session-management\u0022\u003ESession Management\u003C/a\u003E \u2014 Manage sessions through the client.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/authentication\u0022\u003EAuthentication\u003C/a\u003E \u2014 Use the client authentication flows.\u003C/li\u003E\n\u003C/ul\u003E\n", + "Html": "\n\u003Cp\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E is the primary configuration surface for UltimateAuth Server.\u003C/p\u003E\n\u003Cp\u003EIt controls authentication behavior, session lifecycles, token issuance, credential security, tenant resolution, endpoint exposure, and integration with UAuthHub.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth composes its Core-defined options directly into \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E. When using UltimateAuth Server, you configure both shared authentication behavior and server-specific features through the same options object.\u003C/p\u003E\n\u003Cp\u003EThis guide covers the available configuration groups, their defaults, practical examples, and the distinction between configured and effective runtime behavior.\u003C/p\u003E\n\u003Cp\u003EBuilt-in HTTP throttling is configured through \u003Ccode\u003Eoptions.RateLimiting\u003C/code\u003E. See \u003Ca href=\u0022/docs/security/rate-limiting\u0022\u003ERate Limiting\u003C/a\u003E for defaults, middleware ownership, proxy configuration and native-policy integration.\u003C/p\u003E\n\u003Cp\u003EExpensive password hashing operations are protected by \u003Ccode\u003Eoptions.ConcurrencyLimiting\u003C/code\u003E, which provides global and workload-specific concurrency budgets. See \u003Ca href=\u0022/docs/security/concurrency-limiting\u0022\u003EConcurrency Limiting\u003C/a\u003E for defaults, queue behavior, timeouts, and configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022register-ultimateauth-server\u0022\u003E1. Register UltimateAuth Server\u003C/h2\u003E\n\u003Cp\u003EConfigure the server through \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe configuration delegate receives:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server registration also supports an optional policy configuration delegate.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(\n configure: options =\u0026gt;\n {\n options.Login.MaxFailedAttempts = 5;\n },\n configurePolicies: policies =\u0026gt;\n {\n // Register application access policies.\n });\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server automatically registers its Core infrastructure. You do not need to call \u003Ccode\u003EAddUltimateAuth()\u003C/code\u003E separately.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-from-appsettings.json\u0022\u003EConfiguration from appsettings.json\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth Server binds the configuration section:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth:Server\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Server\u0026quot;: {\n \u0026quot;Login\u0026quot;: {\n \u0026quot;MaxFailedAttempts\u0026quot;: 5,\n \u0026quot;LockoutDuration\u0026quot;: \u0026quot;00:15:00\u0026quot;\n },\n \u0026quot;Session\u0026quot;: {\n \u0026quot;Lifetime\u0026quot;: \u0026quot;7.00:00:00\u0026quot;\n },\n \u0026quot;Token\u0026quot;: {\n \u0026quot;AccessTokenLifetime\u0026quot;: \u0026quot;00:10:00\u0026quot;\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EASP.NET Core represents \u003Ccode\u003ETimeSpan\u003C/code\u003E values using strings such as \u003Ccode\u003E00:15:00\u003C/code\u003E for fifteen minutes and \u003Ccode\u003E7.00:00:00\u003C/code\u003E for seven days.\u003C/p\u003E\n\u003Cp\u003EThe configuration section is bound after the registration delegate, so configuration provider values take precedence for matching properties.\u003C/p\u003E\n\u003Cp\u003EFor configuration source ordering and environment-specific overrides, see \u003Ca href=\u0022/docs/configuration/configuration\u0022\u003EConfiguration Overview\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-options-architecture\u0022\u003E2. Server Options Architecture\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthServerOptions\u003C/code\u003E contains two categories of configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022core-defined-options\u0022\u003ECore-defined options\u003C/h3\u003E\n\u003Cp\u003EThese types are defined in UltimateAuth Core and composed into the server options:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EType\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthLoginOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin attempts and lockout behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESession\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthSessionOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession lifetime and lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EToken\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthTokenOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAccess and refresh token behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthPkceOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE authorization code lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthMultiTenantOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant identification and resolution\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPagination\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthPaginationOptions\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPagination defaults and limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication lifecycle callbacks\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-specific-options\u0022\u003EServer-specific options\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERestrict permitted authentication modes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubDeploymentMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDescribe the relationship between UAuthHub and the application\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub integration and flow settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECookie\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECookie names, security attributes, and lifetime behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESessionResolution\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession identifier sources and precedence\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEndpoint groups and disabled actions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPrimary credential selection for UI and API requests\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication credential delivery and redirect behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialSessionPolicy\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession invalidation after credential changes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResetCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential recovery code and token settings\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier behavior, normalization, and uniqueness\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifierValidation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUsername, email, and phone validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier types allowed for login\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser profile capabilities\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENavigation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication navigation behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDiagnostics\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional diagnostic response details\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EAdvanced configuration hooks are also available, including \u003Ccode\u003EConfigureMode()\u003C/code\u003E and \u003Ccode\u003EOnConfigureEndpoints\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-options\u0022\u003E3. Login Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Login\u003C/code\u003E controls login attempt limits, lockout behavior, and related security settings.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Login.FailureWindow = TimeSpan.FromMinutes(15);\n options.Login.ExtendLockOnFailure = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxFailedAttempts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E10\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EFailed login threshold; \u003Ccode\u003E0\u003C/code\u003E disables lockout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELockoutDuration\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E15 minutes\u003C/td\u003E\n\u003Ctd\u003ELockout duration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EFailureWindow\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E15 minutes\u003C/td\u003E\n\u003Ctd\u003EWindow for counting failed attempts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EExtendLockOnFailure\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EExtend lockout when another attempt fails during lockout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIncludeFailureDetails\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude detailed authentication failure information\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETryLoginDuration\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E180 seconds\u003C/td\u003E\n\u003Ctd\u003EDuration associated with the try-login flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-restrict-login-failure-details\u0022\u003EExample: Restrict Login Failure Details\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.IncludeFailureDetails = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis setting is useful when an application does not want to expose detailed lockout information to callers.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important\u0022\u003EImportant\u003C/h3\u003E\n\u003Cp\u003ELockout configuration is not equivalent to complete network-level rate limiting.\u003C/p\u003E\n\u003Cp\u003EProduction deployments should also consider infrastructure protections against abusive traffic and distributed login attempts.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-options\u0022\u003E4. Session Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Session\u003C/code\u003E controls session lifetime, expiration, sliding behavior, and session-chain limits.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Session.SlidingExpiration = true;\n options.Session.IdleTimeout = TimeSpan.FromDays(3);\n options.Session.MaxLifetime = TimeSpan.FromDays(30);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-lifetime-properties\u0022\u003ESession Lifetime Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E7 days\u003C/td\u003E\n\u003Ctd\u003EStandard session lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional absolute lifetime limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESlidingExpiration\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAllow eligible activity or refresh operations to extend expiration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdleTimeout\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional inactivity timeout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETouchInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E5 minutes\u003C/td\u003E\n\u003Ctd\u003EMinimum interval between last-seen updates\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings have different purposes.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ELifetime\u003C/code\u003E determines the standard lifetime assigned to a session.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EMaxLifetime\u003C/code\u003E establishes an optional hard boundary that cannot be extended indefinitely.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EIdleTimeout\u003C/code\u003E limits how long a session can remain inactive.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ETouchInterval\u003C/code\u003E reduces unnecessary persistence operations caused by frequent activity updates.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-chain-properties\u0022\u003ESession-Chain Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxChainsPerUser\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E0\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved user-level chain limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxSessionsPerChain\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E100\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession-chain rotation limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxChainsPerPlatform\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved platform-specific chain limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPlatformCategories\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved platform group definitions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxChainsPerCategory\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved category-specific chain limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableIpBinding\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved IP binding setting\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableUserAgentBinding\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved User-Agent binding setting\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceMismatchBehavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EReject\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReserved device mismatch behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003ECurrent implementation limitation:\u003C/strong\u003E The source identifies several device limits and binding settings as reserved for future enforcement. Setting these properties must not be treated as proof that the corresponding protection is active.\u003C/p\u003E\n\u003Cp\u003EFor example, do not rely on:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Session.MaxChainsPerUser = 1;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Eas a production guarantee that only one device chain can exist unless the current runtime implementation has been verified to enforce that restriction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enforced-device-limits\u0022\u003EEnforced Device Limits\u003C/h3\u003E\n\u003Cp\u003EActive-device admission limits are configured separately from \u003Ccode\u003Eoptions.Session\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.DeviceLimits.MaxDevices = 3;\n options.DeviceLimits.TypeLimits[\u0026quot;web\u0026quot;] = 2;\n options.DeviceLimits.Behavior = DeviceLimitBehavior.RejectNewLogin;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits.MaxDevices\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional maximum distinct active device IDs per user and tenant\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits.TypeLimits\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEmpty\u003C/td\u003E\n\u003Ctd\u003EOptional per-type limits (case-insensitive keys)\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits.Behavior\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERejectNewLogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReject a new device or revoke oldest eligible active device(s)\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe feature is disabled until one or more quotas are configured.\u003C/p\u003E\n\u003Cp\u003EMultiple active chains sharing the same \u003Ccode\u003EDeviceId\u003C/code\u003E count as one device.\u003C/p\u003E\n\u003Cp\u003EBuilt-in browser clients are classified as \u003Ccode\u003Eweb\u003C/code\u003E, regardless of operating system.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EDeviceLimits\u003C/code\u003E is the supported active-device enforcement mechanism. Reserved \u003Ccode\u003ESession.MaxChainsPerUser\u003C/code\u003E, \u003Ccode\u003EMaxChainsPerPlatform\u003C/code\u003E, and category-based chain settings do not enforce these quotas.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/sessions-devices/device-limits\u0022\u003EDevice Limits\u003C/a\u003E for admission, eviction, persistence, and migration behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-specific-session-defaults\u0022\u003EMode-Specific Session Defaults\u003C/h3\u003E\n\u003Cp\u003ESession settings can also be affected by authentication mode defaults.\u003C/p\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EPureOpaque\u003C/code\u003E supplies a longer idle timeout and touch interval when those values have not been configured.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EHybrid\u003C/code\u003E explicitly sets \u003Ccode\u003ETouchInterval\u003C/code\u003E to \u003Ccode\u003Enull\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E for the effective-options resolution order.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-options\u0022\u003E5. Token Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Token\u003C/code\u003E configures access and refresh token behavior.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Token.Issuer = \u0026quot;MyApplication\u0026quot;;\n options.Token.Audience = \u0026quot;MyApplicationApi\u0026quot;;\n options.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n options.Token.RefreshTokenLifetime = TimeSpan.FromDays(7);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-1\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssueJwt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable JWT issuance where supported by the effective mode\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssueOpaque\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable opaque token issuance where supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssueRefresh\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable refresh token issuance where supported\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAccessTokenLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E10 minutes\u003C/td\u003E\n\u003Ctd\u003EAccess token lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshTokenLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E7 days\u003C/td\u003E\n\u003Ctd\u003ERefresh token lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOpaqueIdBytes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E32\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERandom byte length used for opaque token identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshTokenConcurrentRequestWindow\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E2 seconds\u003C/td\u003E\n\u003Ctd\u003EConcurrent duplicate refresh classification window\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIssuer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuth\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT issuer\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAudience\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClient\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT audience\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAddJwtIdClaim\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInclude a JWT identifier claim\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EKeyId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional signing key identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-concurrency-window\u0022\u003ERefresh Token Concurrency Window\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Token.RefreshTokenConcurrentRequestWindow = TimeSpan.FromSeconds(2);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis option controls how the server distinguishes a closely timed duplicate refresh request from a confirmed replay.\u003C/p\u003E\n\u003Cp\u003EA duplicate refresh request is still rejected.\u003C/p\u003E\n\u003Cp\u003EThe window affects the replay-response classification, including whether the token family should be revoked.\u003C/p\u003E\n\u003Cp\u003EIt does \u003Cstrong\u003Enot\u003C/strong\u003E allow the same consumed refresh token to be used successfully more than once.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-defaults-may-override-token-values\u0022\u003EMode Defaults May Override Token Values\u003C/h3\u003E\n\u003Cp\u003EThe effective \u003Ccode\u003EHybrid\u003C/code\u003E configuration explicitly sets:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EToken.AccessTokenLifetime = TimeSpan.FromMinutes(10);\nToken.RefreshTokenLifetime = TimeSpan.FromDays(7);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ETherefore, a different value configured globally may be replaced when the effective mode is resolved.\u003C/p\u003E\n\u003Cp\u003ETo customize the lifetime for \u003Ccode\u003EHybrid\u003C/code\u003E, use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis distinction is essential when configuring token lifetimes.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pkce-options\u0022\u003E6. PKCE Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Pkce\u003C/code\u003E configures the lifetime of PKCE authorization codes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Pkce.AuthorizationCodeLifetimeSeconds = 120;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthorizationCodeLifetimeSeconds\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E120\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELifetime of a PKCE authorization code\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EPKCE is particularly important for browser-based clients such as Blazor WebAssembly.\u003C/p\u003E\n\u003Cp\u003EA shorter authorization code lifetime reduces the period during which an intercepted or exposed code could potentially be used.\u003C/p\u003E\n\u003Cp\u003EHowever, the value must remain long enough for legitimate authorization exchanges to complete.\u003C/p\u003E\n\u003Cp\u003EThe server\u0027s PKCE configuration is separate from the client\u0027s PKCE flow settings.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-modes\u0022\u003E7. Authentication Modes\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports authentication mode resolution based on the application profile.\u003C/p\u003E\n\u003Cp\u003EThe server exposes:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AllowedModes\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis property restricts the modes the server is permitted to use.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022restrict-allowed-modes\u0022\u003ERestrict Allowed Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E is a restriction, not a mode selector.\u003C/p\u003E\n\u003Cp\u003EThe effective mode is resolved by \u003Ccode\u003EIEffectiveAuthModeResolver\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-mode-resolution\u0022\u003EDefault Mode Resolution\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth resolves the effective authentication mode using the application profile unless the server explicitly configures \u003Ccode\u003EAuthMode\u003C/code\u003E or \u003Ccode\u003EApplicationProfileModes\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication Profile\u003C/th\u003E\n\u003Cth\u003EDefault Mode\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazorServer\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EWebServer\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazorWasm\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMaui\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUAuthHub\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EApi\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EResourceApi\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe server controls the effective authentication mode. Application profile metadata is not an authorization boundary.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAuthMode\u003C/code\u003E forces a single mode for the server, while \u003Ccode\u003EApplicationProfileModes\u003C/code\u003E provides explicit profile-specific mappings. These configuration mechanisms cannot be combined.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E restricts permitted modes but does not select a mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022explicit-purejwt-configuration\u0022\u003EExplicit PureJwt Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthMode = UAuthMode.PureJwt;\n\n options.Token.Issuer = \u0026quot;https://auth.example.com\u0026quot;;\n options.Token.Audience = \u0026quot;products-api\u0026quot;;\n\n options.Cryptography.JwtSigningKey = builder.Configuration[\u0026quot;UltimateAuth:JwtSigningKey\u0026quot;];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe JWT signing key must be a Base64-encoded cryptographic key containing at least 32 bytes of key material.\u003C/p\u003E\n\u003Cp\u003EUse a cryptographically secure, independently generated key in production. Do not reuse the JWT signing key as the token-hashing key.\u003C/p\u003E\n\u003Cp\u003EPureJwt does not create authentication sessions, but refresh-token persistence is still required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-mode-specific-behavior\u0022\u003EConfigure Mode-Specific Behavior\u003C/h3\u003E\n\u003Cp\u003EUse \u003Ccode\u003EConfigureMode()\u003C/code\u003E for behavior that should differ by mode.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConfigureMode(UAuthMode.PureOpaque, mode =\u0026gt;\n {\n mode.Session.IdleTimeout = TimeSpan.FromDays(7);\n });\n\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe mode override runs after the built-in mode defaults.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E for details.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-options\u0022\u003E8. Endpoint Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Endpoints\u003C/code\u003E controls endpoint paths, feature groups, and individual action restrictions.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022base-path\u0022\u003EBase Path\u003C/h3\u003E\n\u003Cp\u003EThe default server endpoint base path is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E/auth\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EConfigure it through:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EChanging the base path can help avoid route conflicts when integrating UltimateAuth into an existing application.\u003C/p\u003E\n\u003Cp\u003EThe client must use compatible endpoint paths.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-groups\u0022\u003EEndpoint Groups\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthentication\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESession\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession management endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserLifecycle\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser lifecycle endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser profile endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserIdentifier\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier management endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentials\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential management endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthorization\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthorization endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.Authentication = true;\n options.Endpoints.Session = true;\n options.Endpoints.Authorization = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDisabling an endpoint group controls endpoint exposure. It does not automatically remove the underlying domain services or invalidate previously issued credentials.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-individual-actions\u0022\u003EDisable Individual Actions\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EDisabledActions\u003C/code\u003E is a collection of action identifiers:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.DisabledActions.Add(\u0026quot;users.create.anonymous\u0026quot;);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe string must match the action identifier used by the server\u0027s endpoint registration and action policy.\u003C/p\u003E\n\u003Cp\u003EDo not pass a C# constant name as a string unless that exact text is also the registered action value.\u003C/p\u003E\n\u003Cp\u003EFor example, these are not necessarily equivalent:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E\u0026quot;UAuthActions.Users.Create.Anonymous\u0026quot;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Eand:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E\u0026quot;users.create.anonymous\u0026quot;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUse the actual action value defined by the corresponding \u003Ccode\u003EUAuthActions\u003C/code\u003E constant.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022endpoint-hardening\u0022\u003EEndpoint Hardening\u003C/h3\u003E\n\u003Cp\u003EDisable endpoints that are not required by the application.\u003C/p\u003E\n\u003Cp\u003EFor example, an application that delegates user provisioning to administrators may choose to disable anonymous user creation.\u003C/p\u003E\n\u003Cp\u003EEndpoint exposure is a separate concern from authorization: an exposed endpoint must still enforce the applicable security policy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-resolution\u0022\u003E9. Session Resolution\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.SessionResolution\u003C/code\u003E controls how incoming requests provide session identifiers.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports four resolution sources:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBearer credentials.\u003C/li\u003E\n\u003Cli\u003ECustom headers.\u003C/li\u003E\n\u003Cli\u003ECookies.\u003C/li\u003E\n\u003Cli\u003EQuery parameters.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-configuration\u0022\u003EDefault Configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableBearer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableHeader\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableCookie\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableQuery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHeaderName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EX-UAuth-Session\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EQueryParameterName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Esession_id\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default precedence order is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBearer\nHeader\nCookie\nQuery\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-resolution-sources\u0022\u003EConfigure Resolution Sources\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.SessionResolution.EnableBearer = true;\n options.SessionResolution.EnableHeader = false;\n options.SessionResolution.EnableCookie = true;\n options.SessionResolution.EnableQuery = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis example disables custom-header and query-string session resolution.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022change-resolution-order\u0022\u003EChange Resolution Order\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.SessionResolution.Order =\n [\n \u0026quot;Cookie\u0026quot;,\n \u0026quot;Bearer\u0026quot;,\n \u0026quot;Header\u0026quot;,\n \u0026quot;Query\u0026quot;\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResolution order matters when a request contains multiple candidate credentials.\u003C/p\u003E\n\u003Cp\u003EThe selected credential must still pass authentication and session validation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-recommendation\u0022\u003ESecurity Recommendation\u003C/h3\u003E\n\u003Cp\u003EAvoid query-string credentials unless the application has a specific, well-understood requirement.\u003C/p\u003E\n\u003Cp\u003EURLs may be recorded in browser history, reverse-proxy logs, analytics systems, and other infrastructure.\u003C/p\u003E\n\u003Cp\u003EFor most browser and API integrations, cookies or authorization headers are preferable.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022cookie-configuration\u0022\u003E10. Cookie Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Cookie\u003C/code\u003E controls cookies used for authentication credentials.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth defines three cookie groups:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Cookie.Session\noptions.Cookie.AccessToken\noptions.Cookie.RefreshToken\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-cookie-names\u0022\u003EDefault Cookie Names\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ECookie\u003C/th\u003E\n\u003Cth\u003EDefault name\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euas\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess token\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euat\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh token\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euar\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default cookie options use:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EHttpOnly = true\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ESecurePolicy = CookieSecurePolicy.Always\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EPath = \u0026quot;/\u0026quot;\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EDomain = null\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EMaxAge = null\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003E\u003Ccode\u003ESameSite\u003C/code\u003E is nullable and can be resolved through the applicable cookie and deployment policies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022customize-cookie-names\u0022\u003ECustomize Cookie Names\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cookie.Session.Name = \u0026quot;myapp_session\u0026quot;;\n options.Cookie.RefreshToken.Name = \u0026quot;myapp_refresh\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-cookie-scope\u0022\u003EConfigure Cookie Scope\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cookie.Session.Path = \u0026quot;/\u0026quot;;\n options.Cookie.Session.Domain = null;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA null domain produces a host-only cookie.\u003C/p\u003E\n\u003Cp\u003ESetting a parent domain can broaden cookie availability to subdomains and should be done only when necessary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022cookie-security\u0022\u003ECookie Security\u003C/h3\u003E\n\u003Cp\u003EAvoid disabling \u003Ccode\u003EHttpOnly\u003C/code\u003E or relaxing secure transport requirements for authentication cookies.\u003C/p\u003E\n\u003Cp\u003ECookie settings interact with:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe deployment mode.\u003C/li\u003E\n\u003Cli\u003ECross-site requests.\u003C/li\u003E\n\u003Cli\u003EBrowser cookie policies.\u003C/li\u003E\n\u003Cli\u003ECredential delivery configuration.\u003C/li\u003E\n\u003Cli\u003EHTTPS requirements.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor cross-site deployments, configure cookie behavior together with CORS and the relevant browser security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022hub-deployment-mode\u0022\u003E11. Hub Deployment Mode\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.HubDeploymentMode\u003C/code\u003E describes how UAuthHub is deployed relative to the application.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.HubDeploymentMode = UAuthHubDeploymentMode.Embedded;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-modes\u0022\u003EAvailable Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEmbedded\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub and application share the same origin\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIntegrated\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub is separate but within the same-site boundary\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EExternal\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub is hosted on a different site or domain\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe default is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUAuthHubDeploymentMode.Integrated\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022embedded\u0022\u003EEmbedded\u003C/h3\u003E\n\u003Cp\u003ESuitable for applications hosting UltimateAuth within the same application and origin.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.HubDeploymentMode = UAuthHubDeploymentMode.Embedded;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022integrated\u0022\u003EIntegrated\u003C/h3\u003E\n\u003Cp\u003ESuitable for deployments such as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Eauth.example.com\napp.example.com\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003Ewhere the authentication service and application are separate origins within the same site.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022external\u0022\u003EExternal\u003C/h3\u003E\n\u003Cp\u003ESuitable for a separate authentication provider domain.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.HubDeploymentMode = UAuthHubDeploymentMode.External;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EExternal deployment requires careful coordination of cookie policies, redirects, allowed origins, and browser restrictions.\u003C/p\u003E\n\u003Cp\u003EThe deployment mode influences authentication transport behavior; it is not merely descriptive metadata.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022hub-options\u0022\u003E12. Hub Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Hub\u003C/code\u003E configures UAuthHub integration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-2\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EClientBaseAddress\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EOptional client application base address\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowedClientOrigins\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEmpty set\u003C/td\u003E\n\u003Ctd\u003EAllowed client origins\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EFlowLifetime\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E5 minutes\u003C/td\u003E\n\u003Ctd\u003ELifetime of Hub flow artifacts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginPath\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E/login\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub login page path\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Hub.ClientBaseAddress = \u0026quot;https://app.example.com\u0026quot;;\n options.Hub.AllowedClientOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n options.Hub.FlowLifetime = TimeSpan.FromMinutes(5);\n options.Hub.LoginPath = \u0026quot;/login\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Hub flow lifetime is not the same as the authenticated session lifetime.\u003C/p\u003E\n\u003Cp\u003EHub artifacts support authentication orchestration and should generally be short-lived.\u003C/p\u003E\n\u003Cp\u003EOnly trusted origins should be included in \u003Ccode\u003EAllowedClientOrigins\u003C/code\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022primary-credential-policy\u0022\u003E13. Primary Credential Policy\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.PrimaryCredential\u003C/code\u003E controls which credential kind is preferred for UI and API requests.\u003C/p\u003E\n\u003Cp\u003EThe defaults are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryTokenKind.Session\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryTokenKind.AccessToken\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-1\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.PrimaryCredential.Ui = PrimaryTokenKind.Session;\n options.PrimaryCredential.Api = PrimaryTokenKind.AccessToken;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows UltimateAuth to distinguish between session-oriented browser interactions and access-token-oriented API interactions.\u003C/p\u003E\n\u003Cp\u003EThe primary credential policy does not bypass authentication validation.\u003C/p\u003E\n\u003Cp\u003EIt determines which credential kind should be preferred within the applicable request-processing rules.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-session-policy\u0022\u003E14. Credential Session Policy\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.CredentialSessionPolicy\u003C/code\u003E determines what happens to active session chains after credential changes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-3\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnSelfChange\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreserveCurrent\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUser changes their own credential\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnAdminChange\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERevokeAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAdministrator changes a user\u0027s credential\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnRecovery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERevokeAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential recovery completes\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-2\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.CredentialSessionPolicy.OnSelfChange = CredentialSessionBehavior.PreserveCurrent;\n options.CredentialSessionPolicy.OnAdminChange = CredentialSessionBehavior.RevokeAll;\n options.CredentialSessionPolicy.OnRecovery = CredentialSessionBehavior.RevokeAll;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-behaviors\u0022\u003EAvailable Behaviors\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EBehavior\u003C/th\u003E\n\u003Cth\u003EEffect\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreserveAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EKeep existing session chains\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPreserveCurrent\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EKeep the current chain and revoke other applicable chains\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERevokeAll\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERevoke all applicable session chains\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EFor recovery flows, \u003Ccode\u003EPreserveCurrent\u003C/code\u003E is not always meaningful because the user may not have an authenticated current session.\u003C/p\u003E\n\u003Cp\u003EThe current implementation treats this situation using the more restrictive \u003Ccode\u003ERevokeAll\u003C/code\u003E behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-recommendation-1\u0022\u003ESecurity Recommendation\u003C/h3\u003E\n\u003Cp\u003EPreserving the current session after a normal password change can provide a reasonable user experience.\u003C/p\u003E\n\u003Cp\u003ERevoking all sessions after administrative credential changes or account recovery is generally more conservative.\u003C/p\u003E\n\u003Cp\u003EChoose the policy according to the application\u0027s security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-reset-options\u0022\u003E15. Credential Reset Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.ResetCredential\u003C/code\u003E configures credential recovery proof lifetimes and attempt limits.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022defaults\u0022\u003EDefaults\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETokenValidity\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E30 minutes\u003C/td\u003E\n\u003Ctd\u003EReset token lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECodeValidity\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E10 minutes\u003C/td\u003E\n\u003Ctd\u003ENumeric reset code lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxAttempts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMaximum permitted recovery attempts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECodeLength\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E6\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENumeric reset code length\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-3\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ResetCredential.TokenValidity = TimeSpan.FromMinutes(20);\n options.ResetCredential.CodeValidity = TimeSpan.FromMinutes(5);\n options.ResetCredential.MaxAttempts = 3;\n options.ResetCredential.CodeLength = 6;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003ECodeLength\u003C/code\u003E applies to numeric reset codes, not token-based recovery proofs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022important-security-boundary\u0022\u003EImportant Security Boundary\u003C/h3\u003E\n\u003Cp\u003EReset proofs must be delivered through a trusted server-side mechanism.\u003C/p\u003E\n\u003Cp\u003EDo not return recovery tokens to anonymous callers simply to simplify a client-side reset form.\u003C/p\u003E\n\u003Cp\u003EThe application should provide the appropriate \u003Ccode\u003EICredentialResetNotifier\u003C/code\u003E implementation for supported recovery flows.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-identifier-options\u0022\u003E16. Login Identifier Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.LoginIdentifiers\u003C/code\u003E determines which identifier types can be used for login.\u003C/p\u003E\n\u003Cp\u003EThe default allowed types are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EUserIdentifierType.Username\nUserIdentifierType.Email\nUserIdentifierType.Phone\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022restrict-login-identifier-types\u0022\u003ERestrict Login Identifier Types\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.LoginIdentifiers.AllowedTypes =\n new HashSet\u0026lt;UserIdentifierType\u0026gt;\n {\n UserIdentifierType.Email\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis configures email as the allowed login identifier type.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022require-verification\u0022\u003ERequire Verification\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.LoginIdentifiers.RequireVerificationForEmail = true;\n options.LoginIdentifiers.RequireVerificationForPhone = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings control whether the corresponding identifiers must be verified before being accepted for login.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-resolvers\u0022\u003ECustom Resolvers\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableCustomResolvers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECustomResolversFirst\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese options control the participation and ordering of custom login identifier resolvers.\u003C/p\u003E\n\u003Cp\u003EAn identifier existing on a user account does not necessarily mean it is permitted for login.\u003C/p\u003E\n\u003Cp\u003EIdentifier management and login eligibility are separate concerns.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-validation\u0022\u003E17. Identifier Validation\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.IdentifierValidation\u003C/code\u003E provides rules for usernames, email addresses, and phone numbers.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022username-rules\u0022\u003EUsername Rules\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.IdentifierValidation.UserName.Enabled = true;\n options.IdentifierValidation.UserName.MinLength = 3;\n options.IdentifierValidation.UserName.MaxLength = 32;\n options.IdentifierValidation.UserName.AllowedRegex = \u0026quot;^[a-zA-Z0-9._-]\u002B$\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022default-validation-rules\u0022\u003EDefault Validation Rules\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EIdentifier\u003C/th\u003E\n\u003Cth\u003EEnabled\u003C/th\u003E\n\u003Cth\u003EMinimum length\u003C/th\u003E\n\u003Cth\u003EMaximum length\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUsername\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E64\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EEmail\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E256\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPhone\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E3\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E24\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EUsername validation additionally supports \u003Ccode\u003EAllowedRegex\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe default username expression is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EREGEX\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-regex\u0022\u003E^[a-zA-Z0-9._-]\u002B$\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-behavior\u0022\u003EIdentifier Behavior\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Identifiers\u003C/code\u003E contains additional groups:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Identifiers.Behavior\noptions.Identifiers.Validation\noptions.Identifiers.Normalization\noptions.Identifiers.Uniqueness\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese configure identifier behavior beyond the top-level validation rules.\u003C/p\u003E\n\u003Cp\u003EIdentifier normalization and uniqueness are particularly important because they affect how duplicate identifiers are detected.\u003C/p\u003E\n\u003Cp\u003EUse the provided options rather than implementing inconsistent normalization independently in the client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-limits\u0022\u003EIdentifier Limits\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth supports configurable limits on the number of identifiers associated with each user.\u003C/p\u003E\n\u003Cp\u003EBy default, a user can have up to \u003Cstrong\u003E10 active identifiers\u003C/strong\u003E, regardless of their type.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Identifiers.Behavior.MaxIdentifiersPerUser = 10;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is a global per-user limit. It applies to the combined number of usernames, email addresses, phone numbers, and custom identifiers.\u003C/p\u003E\n\u003Ch4 id=\u0022optional-per-type-limits\u0022\u003EOptional Per-Type Limits\u003C/h4\u003E\n\u003Cp\u003EApplications can optionally define limits for individual identifier types:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Identifiers.Behavior.MaxIdentifiersPerUser = 10;\n\noptions.Identifiers.Behavior.MaxIdentifiersPerType = new()\n{\n [UserIdentifierType.Username] = 2,\n [UserIdentifierType.Email] = 5,\n [UserIdentifierType.Phone] = 3\n};\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EPer-type limits are not configured by default.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhen no per-type limit is specified, only the global limit applies.\u003C/p\u003E\n\u003Cp\u003EFor example, with the configuration above, a user may have up to five email addresses, but the combined number of all active identifiers cannot exceed ten.\u003C/p\u003E\n\u003Ch4 id=\u0022default-behavior\u0022\u003EDefault Behavior\u003C/h4\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxIdentifiersPerUser\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E10\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMaximum total active identifiers per user\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxIdentifiersPerType\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEmpty dictionary\u003C/td\u003E\n\u003Ctd\u003EOptional limits for individual identifier types\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe following rules apply:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EPrimary and non-primary identifiers count equally.\u003C/li\u003E\n\u003Cli\u003ESoft-deleted identifiers do not count toward active limits.\u003C/li\u003E\n\u003Cli\u003ESelf-service and administrative operations follow the same limits.\u003C/li\u003E\n\u003Cli\u003EPer-type limits do not override the global limit.\u003C/li\u003E\n\u003Cli\u003EExisting identifier behavior options remain applicable.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EAllowMultipleUsernames = false\u003C/code\u003E still prevents multiple usernames, even when the configured username limit is greater than one.\u003C/p\u003E\n\u003Ch4 id=\u0022limit-validation\u0022\u003ELimit Validation\u003C/h4\u003E\n\u003Cp\u003EWhen an identifier addition exceeds a configured limit, the operation is rejected with a validation error.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EError Code\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003Eidentifier_total_limit_exceeded\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EThe user has reached the global identifier limit\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003Eidentifier_type_limit_exceeded\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EThe user has reached the configured limit for that identifier type\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EApplications should handle these errors and display appropriate feedback.\u003C/p\u003E\n\u003Cp\u003EIdentifier limits are enforced by the Users application layer rather than individual persistence stores.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022user-profile-options\u0022\u003E18. User Profile Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.UserProfile\u003C/code\u003E controls profile-related capabilities.\u003C/p\u003E\n\u003Cp\u003EThe current option is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.UserProfile.EnableMultiProfile\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts default is \u003Ccode\u003Efalse\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enable-multiple-profiles\u0022\u003EEnable Multiple Profiles\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.UserProfile.EnableMultiProfile = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows applications to use UltimateAuth\u0027s multiple-profile capability where supported by the user domain.\u003C/p\u003E\n\u003Cp\u003EFor example, an application may maintain separate profile contexts for different purposes.\u003C/p\u003E\n\u003Cp\u003EMulti-profile support does not create separate user identities or independent authentication accounts.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022multi-tenant-options\u0022\u003E19. Multi-Tenant Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.MultiTenant\u003C/code\u003E controls whether tenant-aware behavior is enabled and how tenant identifiers are resolved.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-4\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnable multi-tenant behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENormalizeToLowercase\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENormalize tenant identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableRoute\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenants from routes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableHeader\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenants from headers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableDomain\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Efalse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EResolve tenants from hosts\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHeaderName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EX-Tenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant header name\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-header-based-tenant-resolution\u0022\u003EExample: Header-Based Tenant Resolution\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.EnableHeader = true;\n options.MultiTenant.HeaderName = \u0026quot;X-Tenant\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-domain-based-resolution\u0022\u003EExample: Domain-Based Resolution\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.MultiTenant.Enabled = true;\n options.MultiTenant.EnableDomain = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EMultiple resolution mechanisms can be enabled.\u003C/p\u003E\n\u003Cp\u003EThe server composes the configured tenant resolvers according to its resolution infrastructure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-boundary\u0022\u003ESecurity Boundary\u003C/h3\u003E\n\u003Cp\u003ETenant identification is not tenant authorization.\u003C/p\u003E\n\u003Cp\u003EA request providing another tenant identifier must not gain access to that tenant without appropriate authorization.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for tenant isolation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pagination-options\u0022\u003E20. Pagination Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Pagination\u003C/code\u003E controls pagination defaults and maximum page sizes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDefaultPageSize\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E250\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaxPageSize\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E1000\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-4\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Pagination.DefaultPageSize = 50;\n options.Pagination.MaxPageSize = 200;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese settings affect paginated queries exposed by UltimateAuth domain services.\u003C/p\u003E\n\u003Cp\u003EFor administrative interfaces, choosing a moderate page size can reduce unnecessary data transfer and processing.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022navigation-options\u0022\u003E21. Navigation Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Navigation\u003C/code\u003E configures automatic authentication navigation behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-properties-5\u0022\u003EAvailable Properties\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProperty\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEnableAutomaticNavigationRedirect\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Etrue\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAccessDeniedResolver\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Enull\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022disable-automatic-redirects\u0022\u003EDisable Automatic Redirects\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Navigation.EnableAutomaticNavigationRedirect = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-login-redirect\u0022\u003ECustom Login Redirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Navigation.LoginResolver = context =\u0026gt;\n {\n return \u0026quot;/account/login\u0026quot;;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-access-denied-redirect\u0022\u003ECustom Access Denied Redirect\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Navigation.AccessDeniedResolver = context =\u0026gt;\n {\n return \u0026quot;/account/access-denied\u0026quot;;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese delegates receive the current \u003Ccode\u003EHttpContext\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe application should return valid, trusted navigation destinations.\u003C/p\u003E\n\u003Cp\u003EAvoid constructing redirects from unvalidated user-controlled URLs.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery-and-authentication-responses\u0022\u003E22. Credential Delivery and Authentication Responses\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates credential delivery from navigation behavior.\u003C/p\u003E\n\u003Cp\u003ECredential delivery is configured through \u003Ccode\u003Eoptions.GrantDelivery\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.GrantDelivery.Default\noptions.GrantDelivery.Session\noptions.GrantDelivery.AccessToken\noptions.GrantDelivery.RefreshToken\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEach grant can have its own delivery configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-specific-delivery-defaults\u0022\u003EMode-Specific Delivery Defaults\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EAuthentication Mode\u003C/th\u003E\n\u003Cth\u003ESession\u003C/th\u003E\n\u003Cth\u003EAccess Token\u003C/th\u003E\n\u003Cth\u003ERefresh Token\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ECookie\u003C/td\u003E\n\u003Ctd\u003ENot issued\u003C/td\u003E\n\u003Ctd\u003ENot issued\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003ECookie\u003C/td\u003E\n\u003Ctd\u003EHeader\u003C/td\u003E\n\u003Ctd\u003ECookie\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003ENot issued\u003C/td\u003E\n\u003Ctd\u003EHeader\u003C/td\u003E\n\u003Ctd\u003ECookie\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese are the built-in defaults before application-profile adaptation and explicit configuration.\u003C/p\u003E\n\u003Cp\u003EFor MAUI, grants that would otherwise use cookie delivery default to header delivery.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-grant-delivery\u0022\u003EConfigure Grant Delivery\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthMode = UAuthMode.PureJwt;\n\n options.GrantDelivery.AccessToken.Mode = GrantDeliveryMode.Header;\n options.GrantDelivery.RefreshToken.Mode = GrantDeliveryMode.Cookie;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn explicit per-grant delivery mode takes precedence over the global delivery default and the built-in mode-specific default.\u003C/p\u003E\n\u003Cp\u003EOnly credentials available in the selected authentication mode can be configured for delivery.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery-versus-request-authentication\u0022\u003ECredential Delivery Versus Request Authentication\u003C/h3\u003E\n\u003Cp\u003EResponse headers deliver newly issued credentials to the client.\u003C/p\u003E\n\u003Cp\u003EThe default credential response header names are:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ECredential\u003C/th\u003E\n\u003Cth\u003EResponse Header\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euas\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess token\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euat\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh token\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Euar\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese response headers must not be confused with the headers used to authenticate subsequent requests.\u003C/p\u003E\n\u003Cp\u003EFor example, the Blazor client receives an access token through the configured response header and sends it on subsequent authenticated requests using \u003Ccode\u003EAuthorization: Bearer\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022redirect-configuration\u0022\u003ERedirect Configuration\u003C/h3\u003E\n\u003Cp\u003ELogin and logout redirect behavior is configured separately:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Redirect.Login\noptions.Redirect.Logout\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA redirect is a navigation concern, not an authentication credential.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-transport-discovery\u0022\u003ELogin Transport Discovery\u003C/h3\u003E\n\u003Cp\u003EThe client discovers whether the effective server configuration supports navigation-based login or requires fetch-based submission.\u003C/p\u003E\n\u003Cp\u003EHeader-delivered access tokens require a transport that allows the client to observe and process the authentication response.\u003C/p\u003E\n\u003Cp\u003EApplications should normally allow the client to select the appropriate login transport automatically.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity Considerations\u003C/h3\u003E\n\u003Cp\u003ECredential delivery must be compatible with the selected authentication mode, application profile, and deployment topology.\u003C/p\u003E\n\u003Cp\u003EBrowser cookie restrictions, CORS policies, trusted origins, and token storage behavior remain relevant regardless of the selected transport.\u003C/p\u003E\n\u003Cp\u003EFor additional client-side behavior, see \u003Ca href=\u0022/docs/client-sdk/authentication\u0022\u003EAuthentication\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022diagnostics-options\u0022\u003E23. Diagnostics Options\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Diagnostics\u003C/code\u003E provides optional diagnostic behavior.\u003C/p\u003E\n\u003Cp\u003EThe current property is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Diagnostics.EnableRefreshDetails\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts default is \u003Ccode\u003Efalse\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-5\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Diagnostics.EnableRefreshDetails = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen enabled, the option allows additional refresh-related diagnostic response information, such as the \u003Ccode\u003EX-UAuth-Refresh\u003C/code\u003E header.\u003C/p\u003E\n\u003Cp\u003EThis is primarily useful during development and debugging.\u003C/p\u003E\n\u003Cp\u003EAvoid enabling detailed authentication diagnostics in production unless the exposure is understood and justified.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-lifecycle-events\u0022\u003E24. Authentication Lifecycle Events\u003C/h2\u003E\n\u003Cp\u003E\u003Ccode\u003Eoptions.Events\u003C/code\u003E exposes server-side authentication lifecycle callbacks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-events\u0022\u003EAvailable Events\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Events.OnAnyEvent\noptions.Events.OnUserLoggedIn\noptions.Events.OnUserLoggedOut\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-login-logging\u0022\u003EExample: Login Logging\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnUserLoggedIn = context =\u0026gt;\n {\n // Record the successful login.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-global-event-handler\u0022\u003EExample: Global Event Handler\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Events.OnAnyEvent = context =\u0026gt;\n {\n // Process an authentication lifecycle event.\n return Task.CompletedTask;\n };\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ELifecycle events are intended for lightweight reactions such as logging, metrics, and notifications.\u003C/p\u003E\n\u003Cp\u003EThey should not replace security decisions, authentication validation, or application policies.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E for event and extension guidance.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022in-memory-auth-artifact-store\u0022\u003E25. In-Memory Auth Artifact Store\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses a bounded in-memory store by default for temporary authentication artifacts, including PKCE authorization codes and login preview receipts.\u003C/p\u003E\n\u003Cp\u003EExpired artifacts are rejected on access and periodically removed in the background, even when they are never accessed again. The store also enforces a maximum number of entries to prevent unbounded accumulation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDefault configuration\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.MaxEntries\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E50,000\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMaximum retained artifacts per application instance\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.CleanupInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E1 minute\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EInterval between expiration cleanup passes\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese defaults require no additional configuration.\u003C/p\u003E\n\u003Cp\u003ETo customize them:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthArtifacts.MaxEntries = 200_000;\n options.AuthArtifacts.CleanupInterval = TimeSpan.FromMinutes(5);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen capacity is reached, the store attempts to reclaim expired entries. If it remains full, new artifacts are rejected without evicting valid authentication proofs.\u003C/p\u003E\n\u003Cp\u003EExpiration is always enforced when an artifact is accessed or consumed, independently of the cleanup interval. Atomic consume-once semantics are preserved.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDeployment notes:\u003C/strong\u003E Capacity limits are process-local, not shared across application instances. Custom \u003Ccode\u003EIAuthStore\u003C/code\u003E implementations are responsible for their own expiration and capacity management. Choose limits according to expected authentication traffic and available memory.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022effective-server-options\u0022\u003E26. Effective Server Options\u003C/h2\u003E\n\u003Cp\u003EThe configured \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E instance is the base configuration.\u003C/p\u003E\n\u003Cp\u003EAt runtime, UltimateAuth can resolve:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003EEffectiveUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current resolution process is:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EConfigured UAuthServerOptions\n |\n v\n Resolve auth mode\n |\n v\n Clone base options\n |\n v\n Apply mode defaults\n |\n v\n Apply ConfigureMode overrides\n |\n v\n EffectiveUAuthServerOptions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis means that the effective settings used for a \u003Ccode\u003EHybrid\u003C/code\u003E client can differ from those used for a \u003Ccode\u003EPureOpaque\u003C/code\u003E client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-6\u0022\u003EExample\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.FromDays(7);\n\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(5);\n });\n\n options.ConfigureMode(UAuthMode.PureOpaque, mode =\u0026gt;\n {\n mode.Session.IdleTimeout = TimeSpan.FromDays(3);\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe original options remain the common starting point.\u003C/p\u003E\n\u003Cp\u003EMode defaults and overrides determine the effective values for the resolved mode.\u003C/p\u003E\n\u003Cp\u003EFor implementation details and inspection of effective options, see \u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-and-configuration-safety\u0022\u003E27. Validation and Configuration Safety\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth Server registers multiple options validators and enables startup validation.\u003C/p\u003E\n\u003Cp\u003EThese validators cover areas including:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ELogin settings.\u003C/li\u003E\n\u003Cli\u003ESession settings.\u003C/li\u003E\n\u003Cli\u003EToken settings.\u003C/li\u003E\n\u003Cli\u003EPKCE.\u003C/li\u003E\n\u003Cli\u003EMulti-tenancy.\u003C/li\u003E\n\u003Cli\u003EIdentifier configuration.\u003C/li\u003E\n\u003Cli\u003ESession resolution.\u003C/li\u003E\n\u003Cli\u003EPagination.\u003C/li\u003E\n\u003Cli\u003EGeneral server configuration.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-invalid-session-lifetime\u0022\u003EExample: Invalid Session Lifetime\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Session.Lifetime = TimeSpan.Zero;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server rejects an invalid session lifetime under the applicable validation rules.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-invalid-base-path\u0022\u003EExample: Invalid Base Path\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;//auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe general server validator rejects paths containing \u003Ccode\u003E//\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022unsupported-modes\u0022\u003EUnsupported Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureJwt\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current validator rejects explicitly enabling \u003Ccode\u003EPureJwt\u003C/code\u003E because that mode is not yet implemented as a supported server mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022validation-limitations\u0022\u003EValidation Limitations\u003C/h3\u003E\n\u003Cp\u003EStartup validation protects the configured options according to the registered validators.\u003C/p\u003E\n\u003Cp\u003EIt does not guarantee that every custom service implementation or mode-specific override is secure.\u003C/p\u003E\n\u003Cp\u003EWhen using advanced customization, test the resulting effective configuration and authentication flows.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022complete-configuration-example\u0022\u003E28. Complete Configuration Example\u003C/h2\u003E\n\u003Cp\u003EThe following example combines several commonly used server settings.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n // Authentication modes\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n\n // Login security\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Login.IncludeFailureDetails = false;\n\n // Sessions\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Session.MaxLifetime = TimeSpan.FromDays(30);\n\n // Token identity\n options.Token.Issuer = \u0026quot;MyApplication\u0026quot;;\n options.Token.Audience = \u0026quot;MyApplicationApi\u0026quot;;\n\n // Hybrid-specific token lifetime\n options.ConfigureMode(UAuthMode.Hybrid, mode =\u0026gt;\n {\n mode.Token.AccessTokenLifetime = TimeSpan.FromMinutes(10);\n });\n\n // PKCE\n options.Pkce.AuthorizationCodeLifetimeSeconds = 120;\n\n // Hub deployment\n options.HubDeploymentMode = UAuthHubDeploymentMode.Integrated;\n options.Hub.ClientBaseAddress = \u0026quot;https://app.example.com\u0026quot;;\n options.Hub.AllowedClientOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n\n // Credential security\n options.CredentialSessionPolicy.OnSelfChange = CredentialSessionBehavior.PreserveCurrent;\n options.CredentialSessionPolicy.OnAdminChange = CredentialSessionBehavior.RevokeAll;\n options.CredentialSessionPolicy.OnRecovery = CredentialSessionBehavior.RevokeAll;\n\n // Credential recovery\n options.ResetCredential.TokenValidity = TimeSpan.FromMinutes(30);\n options.ResetCredential.MaxAttempts = 3;\n\n // Identifier login rules\n options.LoginIdentifiers.RequireVerificationForEmail = true;\n\n // Session transport\n options.SessionResolution.EnableCookie = true;\n options.SessionResolution.EnableBearer = true;\n options.SessionResolution.EnableQuery = false;\n\n // Endpoint exposure\n options.Endpoints.Authentication = true;\n options.Endpoints.Session = true;\n options.Endpoints.Credentials = true;\n options.Endpoints.Authorization = true;\n\n // Pagination\n options.Pagination.DefaultPageSize = 50;\n options.Pagination.MaxPageSize = 200;\n\n // Diagnostics\n options.Diagnostics.EnableRefreshDetails = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an illustrative configuration, not a universal production preset.\u003C/p\u003E\n\u003Cp\u003EApplications should choose session lifetimes, authentication modes, credential transport, tenant behavior, and endpoint exposure according to their own deployment and security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-configuration-mistakes\u0022\u003E29. Common Configuration Mistakes\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuring-core-options-separately\u0022\u003EConfiguring Core Options Separately\u003C/h3\u003E\n\u003Cp\u003EWhen using \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E, configure Core-defined options through \u003Ccode\u003EUAuthServerOptions\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EA separate \u003Ccode\u003EUAuthOptions\u003C/code\u003E configuration does not automatically override the server\u0027s composed options.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-allowedmodes-selects-the-mode\u0022\u003EAssuming AllowedModes Selects the Mode\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E is a restriction.\u003C/p\u003E\n\u003Cp\u003EMode selection is performed by the authentication mode resolver.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ignoring-mode-defaults\u0022\u003EIgnoring Mode Defaults\u003C/h3\u003E\n\u003Cp\u003EMode-specific defaults can replace globally configured values.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EConfigureMode()\u003C/code\u003E for explicit mode-specific behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022enabling-unsupported-modes\u0022\u003EEnabling Unsupported Modes\u003C/h3\u003E\n\u003Cp\u003EAn authentication mode appearing in an enum does not guarantee runtime support.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022treating-reserved-session-options-as-enforced-security-features\u0022\u003ETreating Reserved Session Options as Enforced Security Features\u003C/h3\u003E\n\u003Cp\u003ESome device and session-chain options are reserved for future enforcement.\u003C/p\u003E\n\u003Cp\u003EVerify actual runtime support before relying on them.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022exposing-unnecessary-endpoints\u0022\u003EExposing Unnecessary Endpoints\u003C/h3\u003E\n\u003Cp\u003EDisable endpoint groups or actions that the application does not require.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022allowing-query-string-credentials-without-a-specific-need\u0022\u003EAllowing Query-String Credentials Without a Specific Need\u003C/h3\u003E\n\u003Cp\u003EQuery-string credentials can leak through URLs and infrastructure logs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022weakening-cookie-security\u0022\u003EWeakening Cookie Security\u003C/h3\u003E\n\u003Cp\u003EDo not relax secure transport or cookie protections without understanding the consequences.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022assuming-configuration-validation-covers-everything\u0022\u003EAssuming Configuration Validation Covers Everything\u003C/h3\u003E\n\u003Cp\u003EStartup validation does not replace testing, infrastructure security, or validation of custom extension implementations.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-options-quick-reference\u0022\u003E30. Server Options Quick Reference\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EConfiguration group\u003C/th\u003E\n\u003Cth\u003ETypical use\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPermitted authentication modes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIn-memory authentication artifact capacity and expiration cleanup\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential delivery\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EConfigureMode()\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMode-specific option overrides\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECookie\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECookie security and scope\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialSessionPolicy\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession invalidation after credential changes\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceLimits\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEnforced global and per-type active-device admission limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDiagnostics\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERefresh diagnostics\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EEndpoint exposure\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EEvents\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication lifecycle callbacks\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EHubDeploymentMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHub deployment topology\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier behavior\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIdentifierValidation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EIdentifier validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin attempts and lockout\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELoginIdentifiers\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ELogin identifier eligibility\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMultiTenant\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant resolution\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENavigation\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication redirects\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EOnConfigureEndpoints\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAdvanced endpoint customization\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPagination\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EQuery page limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPkce\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPKCE code lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPrimaryCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUI/API primary credential selection\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResetCredential\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential recovery rules\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESession\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ESession expiration and lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESessionResolution\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential source precedence\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EToken\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EToken issuance and lifetime\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUserProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EMulti-profile capability\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/configuration\u0022\u003EConfiguration Overview\u003C/a\u003E \u2014 Understand the configuration architecture and precedence.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure client SDK behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E \u2014 Explore effective options, mode resolution, and extension points.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/session-management\u0022\u003ESession Management\u003C/a\u003E \u2014 Manage sessions through the client.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/client/authentication\u0022\u003EAuthentication\u003C/a\u003E \u2014 Use the client authentication flows.\u003C/li\u003E\n\u003C/ul\u003E\n", "Headings": [ { "Id": "register-ultimateauth-server", @@ -409,13 +409,33 @@ "Level": 1 }, { - "Id": "authentication-response-options", - "Text": "22. Authentication Response Options", + "Id": "credential-delivery-and-authentication-responses", + "Text": "22. Credential Delivery and Authentication Responses", "Level": 0 }, { - "Id": "important-mode-specific-response-defaults", - "Text": "Important: Mode-Specific Response Defaults", + "Id": "mode-specific-delivery-defaults", + "Text": "Mode-Specific Delivery Defaults", + "Level": 1 + }, + { + "Id": "configure-grant-delivery", + "Text": "Configure Grant Delivery", + "Level": 1 + }, + { + "Id": "credential-delivery-versus-request-authentication", + "Text": "Credential Delivery Versus Request Authentication", + "Level": 1 + }, + { + "Id": "redirect-configuration", + "Text": "Redirect Configuration", + "Level": 1 + }, + { + "Id": "login-transport-discovery", + "Text": "Login Transport Discovery", "Level": 1 }, { @@ -559,6 +579,6 @@ "Level": 0 } ], - "SourceHash": "4CA6F7B9FD7DD6C60076A43933BE826BBA59E530C646BC10D86BA18A43D9BF37", + "SourceHash": "E933D945BBBB996D5BDD65F6537F8669DE9A194EF538FA9BAAF01A1D80F00FA2", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/application-profiles.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/application-profiles.json index 155bf8a0..a3f2ad00 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/application-profiles.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/application-profiles.json @@ -1,7 +1,7 @@ { "Slug": "fundamentals/application-profiles", "Title": "Application Profiles", - "Html": "\n\u003Cp\u003EUltimateAuth is designed to support different application environments through a unified authentication architecture.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server application, a browser-based WebAssembly application, a native mobile client, and a server-side application do not interact with authentication credentials in exactly the same way.\u003C/p\u003E\n\u003Cp\u003EThey may differ in how credentials are stored, how requests are sent, whether browser cookies are available, and how authentication results are delivered.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profiles allow UltimateAuth to account for these runtime differences without requiring separate authentication architectures for each application type.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn Application Profile describes the environment in which an application operates. It helps the framework resolve suitable authentication behavior and defaults, while the server remains responsible for enforcing the effective security policy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-is-an-application-profile\u0022\u003EWhat is an Application Profile?\u003C/h2\u003E\n\u003Cp\u003EAn Application Profile identifies a supported application environment and its relevant runtime characteristics.\u003C/p\u003E\n\u003Cp\u003EIt can influence how UltimateAuth resolves:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EDefault authentication mode.\u003C/li\u003E\n\u003Cli\u003ECredential delivery and transport.\u003C/li\u003E\n\u003Cli\u003EClient-specific authentication flow behavior.\u003C/li\u003E\n\u003Cli\u003EBrowser and non-browser integration requirements.\u003C/li\u003E\n\u003Cli\u003EApplicable server configuration and compatibility constraints.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA profile does not authenticate the client or grant permissions.\u003C/p\u003E\n\u003Cp\u003EFor example, identifying a request as originating from a Blazor WebAssembly application does not establish the identity of its user.\u003C/p\u003E\n\u003Cp\u003ELikewise, a client declaring itself to be a server-side application must not automatically receive privileges associated with a trusted server.\u003C/p\u003E\n\u003Cp\u003EThe distinction is fundamental:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profile describes the environment. Authentication Mode defines the authentication strategy. Server policy determines what is permitted.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-application-profiles-exist\u0022\u003EWhy Application Profiles exist\u003C/h2\u003E\n\u003Cp\u003EConsider an application that includes a browser frontend, a native mobile application, and a server-rendered administrative interface.\u003C/p\u003E\n\u003Cp\u003EAll three clients may authenticate against the same UAuthHub.\u003C/p\u003E\n\u003Cp\u003EHowever, their runtime characteristics differ.\u003C/p\u003E\n\u003Cp\u003EA browser application can use cookies managed by the browser. A native application may need to manage credentials through platform-specific secure storage. A server-rendered application may be able to maintain authentication through a server-controlled session without introducing a separate refresh-token lifecycle.\u003C/p\u003E\n\u003Cp\u003EWithout a client abstraction, these differences tend to spread throughout application code.\u003C/p\u003E\n\u003Cp\u003EDevelopers may need separate configuration paths, credential-handling logic, and authentication integration code for every runtime.\u003C/p\u003E\n\u003Cp\u003EApplication Profiles provide a consistent way to describe those differences.\u003C/p\u003E\n\u003Cp\u003EThey allow UltimateAuth to select appropriate integration behavior while preserving the same underlying authentication and authorization architecture.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022built-in-application-profiles\u0022\u003EBuilt-in Application Profiles\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth defines profiles for its supported application environments.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProfile\u003C/th\u003E\n\u003Cth\u003EEnvironment\u003C/th\u003E\n\u003Cth\u003ETypical characteristics\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor Server applications\u003C/td\u003E\n\u003Ctd\u003EServer-side execution, browser connection, server-managed authentication context\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorWasm\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor WebAssembly applications\u003C/td\u003E\n\u003Ctd\u003EBrowser execution, HTTP-based API communication, browser credential constraints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaui\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E.NET MAUI applications\u003C/td\u003E\n\u003Ctd\u003ENative execution, platform-specific credential storage and HTTP communication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EWebServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EASP.NET Core MVC, Razor Pages, and other server-hosted web applications\u003C/td\u003E\n\u003Ctd\u003EServer-side execution with browser-oriented authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAPI-oriented integrations\u003C/td\u003E\n\u003Ctd\u003EHTTP request authentication without assuming a browser UI\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUltimateAuth authentication host\u003C/td\u003E\n\u003Ctd\u003EAuthentication-host-specific runtime integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENotSpecified\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENo explicit profile resolved\u003C/td\u003E\n\u003Ctd\u003ERequires the applicable server-side fallback or resolution policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese profiles describe runtime environments rather than independent authentication systems.\u003C/p\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EBlazorWasm\u003C/code\u003E does not inherently mean JWT authentication, and \u003Ccode\u003EBlazorServer\u003C/code\u003E does not inherently prohibit access tokens.\u003C/p\u003E\n\u003Cp\u003EA profile may provide a recommended default, but the authentication mode remains a separate decision.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022api-profile-versus-resource-api\u0022\u003EAPI profile versus resource API\u003C/h3\u003E\n\u003Cp\u003EAn API-oriented client and an API acting as a protected resource are not necessarily the same thing.\u003C/p\u003E\n\u003Cp\u003EA protected resource API may receive requests from browser applications, mobile applications, or other services.\u003C/p\u003E\n\u003Cp\u003EThe calling client\u0027s profile should not be confused with the hosting environment of the resource API.\u003C/p\u003E\n\u003Cp\u003EResource authentication must follow the applicable server-side configuration and token-validation requirements, regardless of what an untrusted caller claims its runtime to be.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-profile-detection\u0022\u003EAutomatic profile detection\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports automatic Application Profile detection in compatible application integrations.\u003C/p\u003E\n\u003Cp\u003EDetection is intended to reduce configuration requirements for common application environments.\u003C/p\u003E\n\u003Cp\u003EDepending on the application implementation, the runtime can provide information such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe current execution environment.\u003C/li\u003E\n\u003Cli\u003EAvailable framework capabilities.\u003C/li\u003E\n\u003Cli\u003EHosting-specific registrations.\u003C/li\u003E\n\u003Cli\u003ERuntime and platform characteristics.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example, a Blazor WebAssembly client can identify that it is executing in a browser environment, while a native MAUI client can identify its native application context.\u003C/p\u003E\n\u003Cp\u003EThis resolution occurs within the supported application integration.\u003C/p\u003E\n\u003Cp\u003EIt should not be confused with a server independently discovering the true identity or trust level of a remote application.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022detection-is-a-convenience-not-a-security-boundary\u0022\u003EDetection is a convenience, not a security boundary\u003C/h3\u003E\n\u003Cp\u003ERuntime detection helps choose appropriate defaults.\u003C/p\u003E\n\u003Cp\u003EIt is not an authentication proof.\u003C/p\u003E\n\u003Cp\u003EA malicious HTTP client can imitate headers, request parameters, and other client-provided metadata.\u003C/p\u003E\n\u003Cp\u003EConsequently, the server must not grant additional authentication privileges solely because a request claims a particular Application Profile.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for validating the profile against its own configuration and security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-to-server-propagation\u0022\u003EClient-to-server propagation\u003C/h2\u003E\n\u003Cp\u003EFor supported operations, the client can communicate its resolved profile to the authentication server.\u003C/p\u003E\n\u003Cp\u003EThe transport may depend on the integration and operation, including request metadata such as headers or flow-specific form fields.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient Runtime\n |\n v\nApplication Profile Detection\n |\n v\nProfile Metadata\n |\n v\nUAuthHub\n |\n v\nServer-Side Profile Resolution\n |\n v\nEffective Authentication Context\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe important distinction is between a \u003Cstrong\u003Edeclared profile\u003C/strong\u003E and an \u003Cstrong\u003Eeffective profile\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EA declared profile is information supplied by the client.\u003C/p\u003E\n\u003Cp\u003EAn effective profile is the result accepted or resolved by the server under its configured rules.\u003C/p\u003E\n\u003Cp\u003EThe server must not treat arbitrary client-provided profile values as authority to weaken authentication requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022missing-profile-information\u0022\u003EMissing profile information\u003C/h3\u003E\n\u003Cp\u003ESome requests may not provide an explicit Application Profile.\u003C/p\u003E\n\u003Cp\u003EIn those cases, UltimateAuth can represent the unresolved application profile as \u003Ccode\u003ENotSpecified\u003C/code\u003E and apply the relevant server-side resolution or fallback behavior.\u003C/p\u003E\n\u003Cp\u003EA missing profile must not automatically imply a privileged or less restrictive environment.\u003C/p\u003E\n\u003Cp\u003EIf the server cannot establish a permitted configuration for the operation, it should reject the operation rather than inventing an unsafe authentication context.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-and-explicit-configuration\u0022\u003EAutomatic and explicit configuration\u003C/h2\u003E\n\u003Cp\u003EApplication Profile resolution can be automatic or explicitly configured, depending on the supported application integration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-configuration\u0022\u003EAutomatic configuration\u003C/h3\u003E\n\u003Cp\u003EFor supported Blazor client registrations, automatic detection can reduce the need to specify the runtime manually.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client integration can resolve the appropriate profile according to its runtime detection configuration.\u003C/p\u003E\n\u003Cp\u003EThis is generally the preferred approach when the application uses a standard, supported hosting environment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022explicit-configuration\u0022\u003EExplicit configuration\u003C/h3\u003E\n\u003Cp\u003EApplications can also configure the profile directly when their integration supports it.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorWasm;\n options.AutoDetectApplicationProfile = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EExplicit configuration may be useful when:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAn application uses a custom hosting environment.\u003C/li\u003E\n\u003Cli\u003ERuntime detection is ambiguous.\u003C/li\u003E\n\u003Cli\u003EA shared integration requires a specific application profile.\u003C/li\u003E\n\u003Cli\u003EThe application needs predictable profile selection across environments.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EExplicitly configuring an application profile does not override the server\u0027s authentication policies.\u003C/p\u003E\n\u003Cp\u003EIt only determines what profile the client integration declares or uses locally.\u003C/p\u003E\n\u003Cp\u003EThe server must still resolve and enforce the effective authentication context.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profiles-and-authentication-modes\u0022\u003EApplication Profiles and Authentication Modes\u003C/h2\u003E\n\u003Cp\u003EApplication Profiles and Authentication Modes are related but independent concepts.\u003C/p\u003E\n\u003Cp\u003EAn Application Profile describes the execution environment and its integration requirements.\u003C/p\u003E\n\u003Cp\u003EAn Authentication Mode defines how authentication credentials are issued, validated, continued, and revoked.\u003C/p\u003E\n\u003Cp\u003EFor example, a Blazor Server application commonly benefits from PureOpaque because it can use server-controlled sessions without managing separate access and refresh tokens.\u003C/p\u003E\n\u003Cp\u003EA Blazor WebAssembly application communicating with a separate API may benefit from Hybrid because it can use access and refresh tokens while retaining server-authoritative session validation.\u003C/p\u003E\n\u003Cp\u003EThese are architectural recommendations, not inherent limitations of the runtimes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-defaults\u0022\u003ERecommended defaults\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication environment\u003C/th\u003E\n\u003Cth\u003ERecommended mode\u003C/th\u003E\n\u003Cth\u003EReason\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ESimple session-based authentication without separate token rotation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WebAssembly with API\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EAccess/refresh credentials with authoritative session control\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E.NET MAUI\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EToken lifecycle suitable for native clients\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMVC / Razor Pages\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ENatural integration with secure browser cookies and server-side sessions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAPI-oriented service client\u003C/td\u003E\n\u003Ctd\u003EPureJwt, when stateless authentication is appropriate\u003C/td\u003E\n\u003Ctd\u003EIndependent JWT validation without mandatory session infrastructure\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUAuthHub\u003C/td\u003E\n\u003Ctd\u003EDepends on its configured role and operation\u003C/td\u003E\n\u003Ctd\u003EHosting the authentication system is not itself an authentication mode\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese recommendations describe suitable architectural choices.\u003C/p\u003E\n\u003Cp\u003EThey are not a guarantee that every listed mode is the current implementation default for that profile.\u003C/p\u003E\n\u003Cp\u003EIn particular, the \u003Ccode\u003EUAuthHub\u003C/code\u003E profile should not be interpreted as an authentication mode. UAuthHub is the authentication host, and its supported operations may serve clients using different modes.\u003C/p\u003E\n\u003Cp\u003EFor the full comparison of validation and lifecycle guarantees, see \u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022profile-resolution-and-request-context\u0022\u003EProfile resolution and request context\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth can serve clients with different profiles through the same authentication infrastructure.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Server Client\n |\n | Profile: BlazorServer\n |\n \u002B--------------------\u002B\n |\nBlazor WASM Client |\n | |\n | Profile: BlazorWasm |\n | v\n \u002B---------------\u0026gt; UAuthHub\n |\nMAUI Client |\n | |\n | Profile: Maui |\n | |\n \u002B--------------------\u002B\n |\n v\n AuthFlowContext\n |\n v\n Effective Mode\n Effective Policy\n Response Behavior\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server resolves the effective authentication context for each applicable operation.\u003C/p\u003E\n\u003Cp\u003EThis can include the Application Profile, authentication mode, tenant, security options, and credential delivery requirements.\u003C/p\u003E\n\u003Cp\u003EDifferent applications can therefore operate under different authentication strategies without requiring separate authentication architectures.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022per-request-resolution-does-not-mean-arbitrary-mode-switching\u0022\u003EPer-request resolution does not mean arbitrary mode switching\u003C/h3\u003E\n\u003Cp\u003EThe effective profile and mode may differ between requests from different applications.\u003C/p\u003E\n\u003Cp\u003EHowever, they must remain consistent throughout an individual authentication operation.\u003C/p\u003E\n\u003Cp\u003EA request must not begin under one authentication policy and complete under another because different components interpreted its profile differently.\u003C/p\u003E\n\u003Cp\u003ELikewise, a client must not be allowed to change its declared profile to bypass validation requirements associated with an existing credential or session.\u003C/p\u003E\n\u003Cp\u003EAuthentication continuation must preserve the relevant security relationships established by the original authentication context.\u003C/p\u003E\n\u003Cp\u003EThe framework-controlled \u003Ccode\u003EAuthFlowContext\u003C/code\u003E provides a consistent boundary for these decisions.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/fundamentals/flow-based-auth\u0022\u003EFlow-Based Authentication\u003C/a\u003E for the conceptual model and \u003Ca href=\u0022/docs/auth-flows/overview\u0022\u003EAuth Flows\u003C/a\u003E for the technical request pipeline.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery-and-runtime-capabilities\u0022\u003ECredential delivery and runtime capabilities\u003C/h2\u003E\n\u003Cp\u003EDifferent applications have different capabilities for receiving and storing authentication credentials.\u003C/p\u003E\n\u003Cp\u003EApplication Profiles help the framework account for those differences.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-environments\u0022\u003EBrowser environments\u003C/h3\u003E\n\u003Cp\u003EBrowser applications can use cookies for authentication.\u003C/p\u003E\n\u003Cp\u003EWhen cookies carry sensitive authentication credentials, appropriate \u003Ccode\u003EHttpOnly\u003C/code\u003E, \u003Ccode\u003ESecure\u003C/code\u003E, and \u003Ccode\u003ESameSite\u003C/code\u003E policies should be applied.\u003C/p\u003E\n\u003Cp\u003ECookie-based authentication also requires appropriate CSRF protection.\u003C/p\u003E\n\u003Cp\u003EIn browser environments, a credential stored in an HttpOnly cookie is not directly readable by JavaScript or WebAssembly application code, although the browser can attach it to applicable requests.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-applications\u0022\u003ENative applications\u003C/h3\u003E\n\u003Cp\u003ENative applications generally communicate through HTTP clients and can use platform-specific secure credential storage.\u003C/p\u003E\n\u003Cp\u003ETheir credential transport and storage requirements differ from those of a browser.\u003C/p\u003E\n\u003Cp\u003EA native Application Profile can help select appropriate integration behavior, but secure storage remains an application and platform responsibility.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-hosted-applications\u0022\u003EServer-hosted applications\u003C/h3\u003E\n\u003Cp\u003EServer-hosted applications can manage authentication state without exposing all authentication implementation details to browser application code.\u003C/p\u003E\n\u003Cp\u003EThis often makes session-oriented authentication attractive.\u003C/p\u003E\n\u003Cp\u003EHowever, server execution alone does not guarantee security. Cookie protection, session validation, authorization, and long-lived connection behavior must still be handled correctly.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-apis\u0022\u003EResource APIs\u003C/h3\u003E\n\u003Cp\u003EResource APIs validate the credentials presented by callers.\u003C/p\u003E\n\u003Cp\u003ETheir authentication requirements must be enforced by trusted server configuration.\u003C/p\u003E\n\u003Cp\u003EA caller\u0027s declared Application Profile must not determine whether token signatures, session validity, tenant boundaries, or authorization requirements can be bypassed.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-and-trust-boundaries\u0022\u003ESecurity and trust boundaries\u003C/h2\u003E\n\u003Cp\u003EApplication Profiles must preserve a clear separation between runtime adaptation and security authority.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022profile-declarations-are-not-trusted-identity\u0022\u003EProfile declarations are not trusted identity\u003C/h3\u003E\n\u003Cp\u003EAn Application Profile does not prove that the caller is a particular application, device, or user.\u003C/p\u003E\n\u003Cp\u003EAdditional authentication mechanisms are required when an application needs to establish client identity.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-selection-is-server-controlled\u0022\u003EMode selection is server-controlled\u003C/h3\u003E\n\u003Cp\u003EA client may provide information relevant to mode resolution, but the server determines which authentication modes are permitted.\u003C/p\u003E\n\u003Cp\u003EA profile must not provide a path to downgrade authentication requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-validity-is-independent-of-profile-labels\u0022\u003ECredential validity is independent of profile labels\u003C/h3\u003E\n\u003Cp\u003EA valid-looking credential must still satisfy the validation requirements of its authentication mode.\u003C/p\u003E\n\u003Cp\u003EChanging a profile label must not turn an invalid credential into a valid one.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022transport-configuration-is-not-authorization\u0022\u003ETransport configuration is not authorization\u003C/h3\u003E\n\u003Cp\u003ESelecting cookies, headers, or another supported delivery mechanism does not grant access to protected resources.\u003C/p\u003E\n\u003Cp\u003EAuthentication and authorization decisions remain separate from credential transport.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022defaults-are-not-universal-guarantees\u0022\u003EDefaults are not universal guarantees\u003C/h3\u003E\n\u003Cp\u003EA secure default depends on the application\u0027s deployment, runtime, authentication mode, and security requirements.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth can provide suitable defaults, but developers remain responsible for selecting and configuring the policies appropriate to their applications.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-environments-and-extensibility\u0022\u003ECustom environments and extensibility\u003C/h2\u003E\n\u003Cp\u003ENot every application fits a predefined runtime category.\u003C/p\u003E\n\u003Cp\u003EA custom host, embedded client, hybrid application, or specialized integration may need explicit profile configuration or additional integration behavior.\u003C/p\u003E\n\u003Cp\u003EThe purpose of Application Profiles is to keep these differences at a defined architectural boundary.\u003C/p\u003E\n\u003Cp\u003ENew integrations should reuse the existing authentication model and flow infrastructure wherever possible, rather than introducing independent authentication implementations.\u003C/p\u003E\n\u003Cp\u003ECustom profile resolution and integration behavior must continue to respect server-controlled mode selection and authentication security policies.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EApplication Profiles allow UltimateAuth to adapt authentication integration to different application environments.\u003C/p\u003E\n\u003Cp\u003EThey provide a consistent way to describe runtime characteristics and influence suitable defaults without turning client-provided metadata into a security authority.\u003C/p\u003E\n\u003Cp\u003EThe fundamental distinctions are:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profile\u003C/strong\u003E describes the runtime environment and integration requirements.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthentication Mode\u003C/strong\u003E defines credential validation, session dependencies, and authentication lifecycle guarantees.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthFlowContext\u003C/strong\u003E establishes the effective security context for an authentication operation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EServer policy\u003C/strong\u003E determines which behavior is permitted.\u003C/p\u003E\n\u003Cp\u003ETogether, these concepts allow different applications to share the same UltimateAuth infrastructure while preserving explicit authentication boundaries.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-step\u0022\u003ENext step\u003C/h2\u003E\n\u003Cp\u003EContinue to \u003Ca href=\u0022/docs/fundamentals/runtime-architecture\u0022\u003ERuntime Architecture\u003C/a\u003E to understand how UltimateAuth\u0027s client, server, and hosting components work together across different application environments.\u003C/p\u003E\n", + "Html": "\n\u003Cp\u003EUltimateAuth is designed to support different application environments through a unified authentication architecture.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server application, a browser-based WebAssembly application, a native mobile client, and a server-side application do not interact with authentication credentials in exactly the same way.\u003C/p\u003E\n\u003Cp\u003EThey may differ in how credentials are stored, how requests are sent, whether browser cookies are available, and how authentication results are delivered.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profiles allow UltimateAuth to account for these runtime differences without requiring separate authentication architectures for each application type.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn Application Profile describes the environment in which an application operates. It helps the framework resolve suitable authentication behavior and defaults, while the server remains responsible for enforcing the effective security policy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-is-an-application-profile\u0022\u003EWhat is an Application Profile?\u003C/h2\u003E\n\u003Cp\u003EAn Application Profile identifies a supported application environment and its relevant runtime characteristics.\u003C/p\u003E\n\u003Cp\u003EIt can influence how UltimateAuth resolves:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EDefault authentication mode.\u003C/li\u003E\n\u003Cli\u003ECredential delivery and transport.\u003C/li\u003E\n\u003Cli\u003EClient-specific authentication flow behavior.\u003C/li\u003E\n\u003Cli\u003EBrowser and non-browser integration requirements.\u003C/li\u003E\n\u003Cli\u003EApplicable server configuration and compatibility constraints.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA profile does not authenticate the client or grant permissions.\u003C/p\u003E\n\u003Cp\u003EFor example, identifying a request as originating from a Blazor WebAssembly application does not establish the identity of its user.\u003C/p\u003E\n\u003Cp\u003ELikewise, a client declaring itself to be a server-side application must not automatically receive privileges associated with a trusted server.\u003C/p\u003E\n\u003Cp\u003EThe distinction is fundamental:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profile describes the environment. Authentication Mode defines the authentication strategy. Server policy determines what is permitted.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-application-profiles-exist\u0022\u003EWhy Application Profiles exist\u003C/h2\u003E\n\u003Cp\u003EConsider an application that includes a browser frontend, a native mobile application, and a server-rendered administrative interface.\u003C/p\u003E\n\u003Cp\u003EAll three clients may authenticate against the same UAuthHub.\u003C/p\u003E\n\u003Cp\u003EHowever, their runtime characteristics differ.\u003C/p\u003E\n\u003Cp\u003EA browser application can use cookies managed by the browser. A native application may need to manage credentials through platform-specific secure storage. A server-rendered application may be able to maintain authentication through a server-controlled session without introducing a separate refresh-token lifecycle.\u003C/p\u003E\n\u003Cp\u003EWithout a client abstraction, these differences tend to spread throughout application code.\u003C/p\u003E\n\u003Cp\u003EDevelopers may need separate configuration paths, credential-handling logic, and authentication integration code for every runtime.\u003C/p\u003E\n\u003Cp\u003EApplication Profiles provide a consistent way to describe those differences.\u003C/p\u003E\n\u003Cp\u003EThey allow UltimateAuth to select appropriate integration behavior while preserving the same underlying authentication and authorization architecture.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022built-in-application-profiles\u0022\u003EBuilt-in Application Profiles\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth defines profiles for its supported application environments.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EProfile\u003C/th\u003E\n\u003Cth\u003EEnvironment\u003C/th\u003E\n\u003Cth\u003ETypical characteristics\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor Server applications\u003C/td\u003E\n\u003Ctd\u003EServer-side execution, browser connection, server-managed authentication context\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EBlazorWasm\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor WebAssembly applications\u003C/td\u003E\n\u003Ctd\u003EBrowser execution, HTTP-based API communication, browser credential constraints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EMaui\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E.NET MAUI applications\u003C/td\u003E\n\u003Ctd\u003ENative execution, platform-specific credential storage and HTTP communication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EWebServer\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EASP.NET Core MVC, Razor Pages, and other server-hosted web applications\u003C/td\u003E\n\u003Ctd\u003EServer-side execution with browser-oriented authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EApi\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAPI-oriented integrations\u003C/td\u003E\n\u003Ctd\u003EHTTP request authentication without assuming a browser UI\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthHub\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EUltimateAuth authentication host\u003C/td\u003E\n\u003Ctd\u003EAuthentication-host-specific runtime integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ENotSpecified\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENo explicit profile resolved\u003C/td\u003E\n\u003Ctd\u003ERequires the applicable server-side fallback or resolution policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese profiles describe runtime environments rather than independent authentication systems.\u003C/p\u003E\n\u003Cp\u003EFor example, \u003Ccode\u003EBlazorWasm\u003C/code\u003E does not inherently mean JWT authentication, and \u003Ccode\u003EBlazorServer\u003C/code\u003E does not inherently prohibit access tokens.\u003C/p\u003E\n\u003Cp\u003EA profile may provide a recommended default, but the authentication mode remains a separate decision.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022api-profile-versus-resource-api\u0022\u003EAPI profile versus resource API\u003C/h3\u003E\n\u003Cp\u003EAn API-oriented client and an API acting as a protected resource are not necessarily the same thing.\u003C/p\u003E\n\u003Cp\u003EA protected resource API may receive requests from browser applications, mobile applications, or other services.\u003C/p\u003E\n\u003Cp\u003EThe calling client\u0027s profile should not be confused with the hosting environment of the resource API.\u003C/p\u003E\n\u003Cp\u003EResource authentication must follow the applicable server-side configuration and token-validation requirements, regardless of what an untrusted caller claims its runtime to be.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-profile-detection\u0022\u003EAutomatic profile detection\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports automatic Application Profile detection in compatible application integrations.\u003C/p\u003E\n\u003Cp\u003EDetection is intended to reduce configuration requirements for common application environments.\u003C/p\u003E\n\u003Cp\u003EDepending on the application implementation, the runtime can provide information such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe current execution environment.\u003C/li\u003E\n\u003Cli\u003EAvailable framework capabilities.\u003C/li\u003E\n\u003Cli\u003EHosting-specific registrations.\u003C/li\u003E\n\u003Cli\u003ERuntime and platform characteristics.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example, a Blazor WebAssembly client can identify that it is executing in a browser environment, while a native MAUI client can identify its native application context.\u003C/p\u003E\n\u003Cp\u003EThis resolution occurs within the supported application integration.\u003C/p\u003E\n\u003Cp\u003EIt should not be confused with a server independently discovering the true identity or trust level of a remote application.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022detection-is-a-convenience-not-a-security-boundary\u0022\u003EDetection is a convenience, not a security boundary\u003C/h3\u003E\n\u003Cp\u003ERuntime detection helps choose appropriate defaults.\u003C/p\u003E\n\u003Cp\u003EIt is not an authentication proof.\u003C/p\u003E\n\u003Cp\u003EA malicious HTTP client can imitate headers, request parameters, and other client-provided metadata.\u003C/p\u003E\n\u003Cp\u003EConsequently, the server must not grant additional authentication privileges solely because a request claims a particular Application Profile.\u003C/p\u003E\n\u003Cp\u003EThe server remains responsible for validating the profile against its own configuration and security requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-to-server-propagation\u0022\u003EClient-to-server propagation\u003C/h2\u003E\n\u003Cp\u003EFor supported operations, the client can communicate its resolved profile to the authentication server.\u003C/p\u003E\n\u003Cp\u003EThe transport may depend on the integration and operation, including request metadata such as headers or flow-specific form fields.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient Runtime\n |\n v\nApplication Profile Detection\n |\n v\nProfile Metadata\n |\n v\nUAuthHub\n |\n v\nServer-Side Profile Resolution\n |\n v\nEffective Authentication Context\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe important distinction is between a \u003Cstrong\u003Edeclared profile\u003C/strong\u003E and an \u003Cstrong\u003Eeffective profile\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EA declared profile is information supplied by the client.\u003C/p\u003E\n\u003Cp\u003EAn effective profile is the result accepted or resolved by the server under its configured rules.\u003C/p\u003E\n\u003Cp\u003EThe server must not treat arbitrary client-provided profile values as authority to weaken authentication requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022missing-profile-information\u0022\u003EMissing profile information\u003C/h3\u003E\n\u003Cp\u003ESome requests may not provide an explicit Application Profile.\u003C/p\u003E\n\u003Cp\u003EIn those cases, UltimateAuth can represent the unresolved application profile as \u003Ccode\u003ENotSpecified\u003C/code\u003E and apply the relevant server-side resolution or fallback behavior.\u003C/p\u003E\n\u003Cp\u003EA missing profile must not automatically imply a privileged or less restrictive environment.\u003C/p\u003E\n\u003Cp\u003EIf the server cannot establish a permitted configuration for the operation, it should reject the operation rather than inventing an unsafe authentication context.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-and-explicit-configuration\u0022\u003EAutomatic and explicit configuration\u003C/h2\u003E\n\u003Cp\u003EApplication Profile resolution can be automatic or explicitly configured, depending on the supported application integration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-configuration\u0022\u003EAutomatic configuration\u003C/h3\u003E\n\u003Cp\u003EFor supported Blazor client registrations, automatic detection can reduce the need to specify the runtime manually.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client integration can resolve the appropriate profile according to its runtime detection configuration.\u003C/p\u003E\n\u003Cp\u003EThis is generally the preferred approach when the application uses a standard, supported hosting environment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022explicit-configuration\u0022\u003EExplicit configuration\u003C/h3\u003E\n\u003Cp\u003EApplications can also configure the profile directly when their integration supports it.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.ApplicationProfile = UAuthApplicationProfile.BlazorWasm;\n options.AutoDetectApplicationProfile = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EExplicit configuration may be useful when:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAn application uses a custom hosting environment.\u003C/li\u003E\n\u003Cli\u003ERuntime detection is ambiguous.\u003C/li\u003E\n\u003Cli\u003EA shared integration requires a specific application profile.\u003C/li\u003E\n\u003Cli\u003EThe application needs predictable profile selection across environments.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EExplicitly configuring an application profile does not override the server\u0027s authentication policies.\u003C/p\u003E\n\u003Cp\u003EIt only determines what profile the client integration declares or uses locally.\u003C/p\u003E\n\u003Cp\u003EThe server must still resolve and enforce the effective authentication context.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profiles-and-authentication-modes\u0022\u003EApplication Profiles and Authentication Modes\u003C/h2\u003E\n\u003Cp\u003EApplication Profiles and Authentication Modes are related but independent concepts.\u003C/p\u003E\n\u003Cp\u003EAn Application Profile describes the execution environment and its integration requirements.\u003C/p\u003E\n\u003Cp\u003EAn Authentication Mode defines how authentication credentials are issued, validated, continued, and revoked.\u003C/p\u003E\n\u003Cp\u003EFor example, a Blazor Server application commonly benefits from PureOpaque because it can use server-controlled sessions without managing separate access and refresh tokens.\u003C/p\u003E\n\u003Cp\u003EA Blazor WebAssembly application communicating with a separate API may benefit from Hybrid because it can use access and refresh tokens while retaining server-authoritative session validation.\u003C/p\u003E\n\u003Cp\u003EThese are architectural recommendations, not inherent limitations of the runtimes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-authentication-modes\u0022\u003ERecommended Authentication Modes\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication environment\u003C/th\u003E\n\u003Cth\u003ERecommended mode\u003C/th\u003E\n\u003Cth\u003EReason\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ESimple session-based authentication without separate token rotation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WebAssembly with API\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EAccess/refresh credentials with authoritative session control\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E.NET MAUI\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EToken lifecycle suitable for native clients\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMVC / Razor Pages\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ENatural integration with secure browser cookies and server-side sessions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAPI-oriented service client\u003C/td\u003E\n\u003Ctd\u003EPureJwt, when stateless authentication is appropriate\u003C/td\u003E\n\u003Ctd\u003EIndependent JWT validation without mandatory session infrastructure\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUAuthHub\u003C/td\u003E\n\u003Ctd\u003EDepends on its configured role and operation\u003C/td\u003E\n\u003Ctd\u003EHosting the authentication system is not itself an authentication mode\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese recommendations describe suitable architectural choices.\u003C/p\u003E\n\u003Cp\u003EThey are not a guarantee that every listed mode is the current implementation default for that profile.\u003C/p\u003E\n\u003Cp\u003EIn particular, the \u003Ccode\u003EUAuthHub\u003C/code\u003E profile should not be interpreted as an authentication mode. UAuthHub is the authentication host, and its supported operations may serve clients using different modes.\u003C/p\u003E\n\u003Cp\u003EFor the full comparison of validation and lifecycle guarantees, see \u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022profile-resolution-and-request-context\u0022\u003EProfile resolution and request context\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth can serve clients with different profiles through the same authentication infrastructure.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor Server Client\n |\n | Profile: BlazorServer\n |\n \u002B--------------------\u002B\n |\nBlazor WASM Client |\n | |\n | Profile: BlazorWasm |\n | v\n \u002B---------------\u0026gt; UAuthHub\n |\nMAUI Client |\n | |\n | Profile: Maui |\n | |\n \u002B--------------------\u002B\n |\n v\n AuthFlowContext\n |\n v\n Effective Mode\n Effective Policy\n Response Behavior\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server resolves the effective authentication context for each applicable operation.\u003C/p\u003E\n\u003Cp\u003EThis can include the Application Profile, authentication mode, tenant, security options, and credential delivery requirements.\u003C/p\u003E\n\u003Cp\u003EDifferent applications can therefore operate under different authentication strategies without requiring separate authentication architectures.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022per-request-resolution-does-not-mean-arbitrary-mode-switching\u0022\u003EPer-request resolution does not mean arbitrary mode switching\u003C/h3\u003E\n\u003Cp\u003EThe effective profile and mode may differ between requests from different applications.\u003C/p\u003E\n\u003Cp\u003EHowever, they must remain consistent throughout an individual authentication operation.\u003C/p\u003E\n\u003Cp\u003EA request must not begin under one authentication policy and complete under another because different components interpreted its profile differently.\u003C/p\u003E\n\u003Cp\u003ELikewise, a client must not be allowed to change its declared profile to bypass validation requirements associated with an existing credential or session.\u003C/p\u003E\n\u003Cp\u003EAuthentication continuation must preserve the relevant security relationships established by the original authentication context.\u003C/p\u003E\n\u003Cp\u003EThe framework-controlled \u003Ccode\u003EAuthFlowContext\u003C/code\u003E provides a consistent boundary for these decisions.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/fundamentals/flow-based-auth\u0022\u003EFlow-Based Authentication\u003C/a\u003E for the conceptual model and \u003Ca href=\u0022/docs/auth-flows/overview\u0022\u003EAuth Flows\u003C/a\u003E for the technical request pipeline.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery-and-runtime-capabilities\u0022\u003ECredential delivery and runtime capabilities\u003C/h2\u003E\n\u003Cp\u003EDifferent applications have different capabilities for receiving and storing authentication credentials.\u003C/p\u003E\n\u003Cp\u003EApplication Profiles help the framework account for those differences.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-environments\u0022\u003EBrowser environments\u003C/h3\u003E\n\u003Cp\u003EBrowser applications can use cookies for authentication.\u003C/p\u003E\n\u003Cp\u003EWhen cookies carry sensitive authentication credentials, appropriate \u003Ccode\u003EHttpOnly\u003C/code\u003E, \u003Ccode\u003ESecure\u003C/code\u003E, and \u003Ccode\u003ESameSite\u003C/code\u003E policies should be applied.\u003C/p\u003E\n\u003Cp\u003ECookie-based authentication also requires appropriate CSRF protection.\u003C/p\u003E\n\u003Cp\u003EIn browser environments, a credential stored in an HttpOnly cookie is not directly readable by JavaScript or WebAssembly application code, although the browser can attach it to applicable requests.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-applications\u0022\u003ENative applications\u003C/h3\u003E\n\u003Cp\u003ENative applications generally communicate through HTTP clients and can use platform-specific secure credential storage.\u003C/p\u003E\n\u003Cp\u003ETheir credential transport and storage requirements differ from those of a browser.\u003C/p\u003E\n\u003Cp\u003EA native Application Profile can help select appropriate integration behavior, but secure storage remains an application and platform responsibility.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-hosted-applications\u0022\u003EServer-hosted applications\u003C/h3\u003E\n\u003Cp\u003EServer-hosted applications can manage authentication state without exposing all authentication implementation details to browser application code.\u003C/p\u003E\n\u003Cp\u003EThis often makes session-oriented authentication attractive.\u003C/p\u003E\n\u003Cp\u003EHowever, server execution alone does not guarantee security. Cookie protection, session validation, authorization, and long-lived connection behavior must still be handled correctly.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-apis\u0022\u003EResource APIs\u003C/h3\u003E\n\u003Cp\u003EResource APIs validate the credentials presented by callers.\u003C/p\u003E\n\u003Cp\u003ETheir authentication requirements must be enforced by trusted server configuration.\u003C/p\u003E\n\u003Cp\u003EA caller\u0027s declared Application Profile must not determine whether token signatures, session validity, tenant boundaries, or authorization requirements can be bypassed.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-and-trust-boundaries\u0022\u003ESecurity and trust boundaries\u003C/h2\u003E\n\u003Cp\u003EApplication Profiles must preserve a clear separation between runtime adaptation and security authority.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022profile-declarations-are-not-trusted-identity\u0022\u003EProfile declarations are not trusted identity\u003C/h3\u003E\n\u003Cp\u003EAn Application Profile does not prove that the caller is a particular application, device, or user.\u003C/p\u003E\n\u003Cp\u003EAdditional authentication mechanisms are required when an application needs to establish client identity.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-selection-is-server-controlled\u0022\u003EMode selection is server-controlled\u003C/h3\u003E\n\u003Cp\u003EA client may provide information relevant to mode resolution, but the server determines which authentication modes are permitted.\u003C/p\u003E\n\u003Cp\u003EA profile must not provide a path to downgrade authentication requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-validity-is-independent-of-profile-labels\u0022\u003ECredential validity is independent of profile labels\u003C/h3\u003E\n\u003Cp\u003EA valid-looking credential must still satisfy the validation requirements of its authentication mode.\u003C/p\u003E\n\u003Cp\u003EChanging a profile label must not turn an invalid credential into a valid one.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022transport-configuration-is-not-authorization\u0022\u003ETransport configuration is not authorization\u003C/h3\u003E\n\u003Cp\u003ESelecting cookies, headers, or another supported delivery mechanism does not grant access to protected resources.\u003C/p\u003E\n\u003Cp\u003EAuthentication and authorization decisions remain separate from credential transport.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022defaults-are-not-universal-guarantees\u0022\u003EDefaults are not universal guarantees\u003C/h3\u003E\n\u003Cp\u003EA secure default depends on the application\u0027s deployment, runtime, authentication mode, and security requirements.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth can provide suitable defaults, but developers remain responsible for selecting and configuring the policies appropriate to their applications.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-environments-and-extensibility\u0022\u003ECustom environments and extensibility\u003C/h2\u003E\n\u003Cp\u003ENot every application fits a predefined runtime category.\u003C/p\u003E\n\u003Cp\u003EA custom host, embedded client, hybrid application, or specialized integration may need explicit profile configuration or additional integration behavior.\u003C/p\u003E\n\u003Cp\u003EThe purpose of Application Profiles is to keep these differences at a defined architectural boundary.\u003C/p\u003E\n\u003Cp\u003ENew integrations should reuse the existing authentication model and flow infrastructure wherever possible, rather than introducing independent authentication implementations.\u003C/p\u003E\n\u003Cp\u003ECustom profile resolution and integration behavior must continue to respect server-controlled mode selection and authentication security policies.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EApplication Profiles allow UltimateAuth to adapt authentication integration to different application environments.\u003C/p\u003E\n\u003Cp\u003EThey provide a consistent way to describe runtime characteristics and influence suitable defaults without turning client-provided metadata into a security authority.\u003C/p\u003E\n\u003Cp\u003EThe fundamental distinctions are:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profile\u003C/strong\u003E describes the runtime environment and integration requirements.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthentication Mode\u003C/strong\u003E defines credential validation, session dependencies, and authentication lifecycle guarantees.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthFlowContext\u003C/strong\u003E establishes the effective security context for an authentication operation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EServer policy\u003C/strong\u003E determines which behavior is permitted.\u003C/p\u003E\n\u003Cp\u003ETogether, these concepts allow different applications to share the same UltimateAuth infrastructure while preserving explicit authentication boundaries.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-step\u0022\u003ENext step\u003C/h2\u003E\n\u003Cp\u003EContinue to \u003Ca href=\u0022/docs/fundamentals/runtime-architecture\u0022\u003ERuntime Architecture\u003C/a\u003E to understand how UltimateAuth\u0027s client, server, and hosting components work together across different application environments.\u003C/p\u003E\n", "Headings": [ { "Id": "what-is-an-application-profile", @@ -64,8 +64,8 @@ "Level": 0 }, { - "Id": "recommended-defaults", - "Text": "Recommended defaults", + "Id": "recommended-authentication-modes", + "Text": "Recommended Authentication Modes", "Level": 1 }, { @@ -149,6 +149,6 @@ "Level": 0 } ], - "SourceHash": "AACEC4C3729822D522B71024AC23F49C4EAA54C2E1AA1C1EFAD87202FE0826B7", + "SourceHash": "2325A6990BD64EC79999F4942D5AD8EF329DCA2FCA03352EAFB7D49407AA3394", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/auth-modes.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/auth-modes.json index 80acf7aa..6a6820ee 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/auth-modes.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/auth-modes.json @@ -1,7 +1,7 @@ { "Slug": "fundamentals/auth-modes", "Title": "Authentication Modes", - "Html": "\n\u003Cp\u003EUltimateAuth provides four authentication modes: \u003Cstrong\u003EPureOpaque\u003C/strong\u003E, \u003Cstrong\u003EHybrid\u003C/strong\u003E, \u003Cstrong\u003ESemiHybrid\u003C/strong\u003E, and \u003Cstrong\u003EPureJwt\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EEach mode defines how authentication credentials are issued, validated, renewed, and revoked. The modes share the same authentication and authorization architecture, but differ in their reliance on server-side sessions, credential formats, and lifecycle guarantees.\u003C/p\u003E\n\u003Cp\u003EThe choice of authentication mode affects more than performance. It determines where authentication state is maintained, whether a server-side session must be consulted during an authenticated request, and how quickly previously issued credentials can be invalidated.\u003C/p\u003E\n\u003Cblockquote\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailability\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EPureOpaque, Hybrid, and PureJwt are implemented authentication modes.\nSemiHybrid remains reserved for a future implementation and should not be used in production.\u003C/p\u003E\n\u003Cp\u003EPureJwt supports locally validated JWT access tokens and stateful refresh-token rotation without requiring server-side authentication sessions.\u003C/p\u003E\n\u003Cp\u003EResource API authentication is configured independently from the issuing UAuthHub. Matching authentication mode names alone do not guarantee credential compatibility.\u003C/p\u003E\n\u003C/blockquote\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022auth-credentials\u0022\u003EAuth credentials\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth distinguishes three credential concepts.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession credential\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EA session credential identifies an authenticated session maintained by the server. In PureOpaque, it is the credential presented by the client to authenticate requests.\u003C/p\u003E\n\u003Cp\u003EA session credential may be represented by an opaque, randomly generated value. It does not need to expose the internal database identifier of the session.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAccess token\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn access token is a credential used to authenticate requests to protected resources.\u003C/p\u003E\n\u003Cp\u003EDepending on the mode, it may be:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAn opaque token resolved and validated by the server.\u003C/li\u003E\n\u003Cli\u003EA JWT validated cryptographically without a session lookup.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EAn access token is not necessarily a session identifier. In Hybrid, the opaque access token is a separate credential associated with a server-side session.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ERefresh token\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EA refresh token allows an existing authentication context to continue by obtaining replacement credentials without requiring the user to authenticate again.\u003C/p\u003E\n\u003Cp\u003ERefresh tokens have their own validation, expiration, rotation, and replay-protection requirements.\u003C/p\u003E\n\u003Cp\u003ENot every authentication mode requires all three credential types.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-comparison\u0022\u003EMode comparison\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ECharacteristic\u003C/th\u003E\n\u003Cth\u003EPureOpaque\u003C/th\u003E\n\u003Cth\u003EHybrid\u003C/th\u003E\n\u003Cth\u003ESemiHybrid\u003C/th\u003E\n\u003Cth\u003EPureJwt\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession credential\u003C/td\u003E\n\u003Ctd\u003EOpaque\u003C/td\u003E\n\u003Ctd\u003EOpaque\u003C/td\u003E\n\u003Ctd\u003ESession-backed\u003C/td\u003E\n\u003Ctd\u003ENone\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess token\u003C/td\u003E\n\u003Ctd\u003ENone\u003C/td\u003E\n\u003Ctd\u003EJWT\u003C/td\u003E\n\u003Ctd\u003EJWT\u003C/td\u003E\n\u003Ctd\u003EJWT\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh token\u003C/td\u003E\n\u003Ctd\u003ENone\u003C/td\u003E\n\u003Ctd\u003EStateful\u003C/td\u003E\n\u003Ctd\u003EStateful\u003C/td\u003E\n\u003Ctd\u003EStateful\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EServer-side session\u003C/td\u003E\n\u003Ctd\u003ERequired\u003C/td\u003E\n\u003Ctd\u003ERequired\u003C/td\u003E\n\u003Ctd\u003ERequired\u003C/td\u003E\n\u003Ctd\u003ENot required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess validation\u003C/td\u003E\n\u003Ctd\u003ESession validation\u003C/td\u003E\n\u003Ctd\u003EMode-specific session authority\u003C/td\u003E\n\u003Ctd\u003EJWT validation\u003C/td\u003E\n\u003Ctd\u003ELocal JWT validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh continuity\u003C/td\u003E\n\u003Ctd\u003ESession touch\u003C/td\u003E\n\u003Ctd\u003ESession and refresh lifecycle\u003C/td\u003E\n\u003Ctd\u003ESession and refresh lifecycle\u003C/td\u003E\n\u003Ctd\u003ERefresh chain rotation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EImmediate session revocation\u003C/td\u003E\n\u003Ctd\u003EYes\u003C/td\u003E\n\u003Ctd\u003ESession-backed operations\u003C/td\u003E\n\u003Ctd\u003ESession-backed operations\u003C/td\u003E\n\u003Ctd\u003ENot applicable\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EImmediate JWT revocation\u003C/td\u003E\n\u003Ctd\u003ENot applicable\u003C/td\u003E\n\u003Ctd\u003EDepends on validation strategy\u003C/td\u003E\n\u003Ctd\u003EAdditional enforcement required\u003C/td\u003E\n\u003Ctd\u003ENot supported by local validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDevice binding\u003C/td\u003E\n\u003Ctd\u003ESession-based\u003C/td\u003E\n\u003Ctd\u003ESession/token-based\u003C/td\u003E\n\u003Ctd\u003EPlanned\u003C/td\u003E\n\u003Ctd\u003EJWT and refresh-token binding\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EResource API support\u003C/td\u003E\n\u003Ctd\u003EOpaque session validation\u003C/td\u003E\n\u003Ctd\u003ESession validation path; JWT integration incomplete\u003C/td\u003E\n\u003Ctd\u003ENot implemented\u003C/td\u003E\n\u003Ctd\u003ELocal JWT validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMain advantage\u003C/td\u003E\n\u003Ctd\u003ESimple, centrally controlled sessions\u003C/td\u003E\n\u003Ctd\u003ESeparate token lifecycle with session authority\u003C/td\u003E\n\u003Ctd\u003EStateless access validation with session management\u003C/td\u003E\n\u003Ctd\u003EMinimal authentication-state dependencies\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMain trade-off\u003C/td\u003E\n\u003Ctd\u003ESession lookup on each authenticated request\u003C/td\u003E\n\u003Ctd\u003EMore credentials and lifecycle complexity\u003C/td\u003E\n\u003Ctd\u003EExisting JWTs can remain valid after session revocation\u003C/td\u003E\n\u003Ctd\u003ENo immediate server-side session revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe comparison describes authentication behavior, not guaranteed throughput rankings. Actual performance depends on token validation costs, storage infrastructure, caching, network latency, request volume, and application architecture.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque\u0022\u003EPureOpaque\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022fully-session-based-authentication\u0022\u003EFully session-based authentication\u003C/h3\u003E\n\u003Cp\u003EPureOpaque is UltimateAuth\u0027s simplest stateful authentication mode.\u003C/p\u003E\n\u003Cp\u003EAuthentication is represented by a server-side session. The client receives an opaque session credential and presents it on subsequent authenticated requests.\u003C/p\u003E\n\u003Cp\u003EThe server resolves the credential, validates the session and its applicable security policies, and establishes the authenticated identity.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient\n |\n | Session Credential\n v\nSession Resolution\n |\n v\nSession Validation\n |\n v\nAuthenticated Identity\n |\n v\nAccessContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EPureOpaque does not issue a separate access token or refresh token.\u003C/p\u003E\n\u003Cp\u003EThe session credential itself is sufficient to identify the authentication context, provided the server determines that the session remains valid.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-continuation\u0022\u003ESession continuation\u003C/h3\u003E\n\u003Cp\u003EPureOpaque does not use refresh-token rotation.\u003C/p\u003E\n\u003Cp\u003EInstead, an existing session may continue through session touch operations, subject to the configured session policies.\u003C/p\u003E\n\u003Cp\u003EDepending on the configuration, these policies may include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESession lifetime.\u003C/li\u003E\n\u003Cli\u003ESliding expiration.\u003C/li\u003E\n\u003Cli\u003EIdle timeout.\u003C/li\u003E\n\u003Cli\u003ETouch interval.\u003C/li\u003E\n\u003Cli\u003EAbsolute expiration limits.\u003C/li\u003E\n\u003Cli\u003ESession revocation.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA touch operation does not necessarily extend the session lifetime. It updates session state only when the applicable policy requires it.\u003C/p\u003E\n\u003Cp\u003EAn expired or revoked session cannot be restored merely by touching it.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022advantages\u0022\u003EAdvantages\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EMinimal credential complexity\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThere is no separate access-token lifecycle, refresh-token storage, or refresh-token rotation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImmediate session revocation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhen a session is revoked, subsequent authentication evaluations that validate that session reject the credential.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECentralized authentication control\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe server remains authoritative for session validity and can enforce current session policies.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ENatural integration with server-rendered applications\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications already maintaining server-side authentication state can use a single session credential without introducing additional token-management mechanisms.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022limitations\u0022\u003ELimitations\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession validation is required\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EEvery authenticated request must validate the server-side session. Depending on the deployment, this can involve a database or distributed cache lookup.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailability depends on session infrastructure\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EA distributed deployment needs reliable access to shared session state or an equivalent session-validation mechanism.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe session credential is sensitive\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EPossession of a valid session credential may be sufficient to authenticate as the session owner. It must be protected against disclosure, replay, and session fixation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ELong-lived connections require special handling\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIn environments such as Blazor Server, an established SignalR circuit may outlive the authentication state initially used to establish it. Appropriate revalidation and authorization checks remain necessary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-applications\u0022\u003ERecommended applications\u003C/h3\u003E\n\u003Cp\u003EPureOpaque is generally a strong default for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBlazor Server applications.\u003C/li\u003E\n\u003Cli\u003EASP.NET Core MVC and Razor Pages applications.\u003C/li\u003E\n\u003Cli\u003EInternal applications using centrally managed sessions.\u003C/li\u003E\n\u003Cli\u003EBrowser applications using secure, HttpOnly session cookies.\u003C/li\u003E\n\u003Cli\u003ESystems that prioritize simple session lifecycle management and immediate server-side revocation.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EPureOpaque is not restricted to server-to-server communication. It can also be used safely with browser and mobile clients when credentials are stored, transported, and validated appropriately.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid\u0022\u003EHybrid\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-backed-authentication-with-separate-tokens\u0022\u003ESession-backed authentication with separate tokens\u003C/h3\u003E\n\u003Cp\u003EHybrid combines server-side authentication sessions with separately issued access and refresh tokens.\u003C/p\u003E\n\u003Cp\u003EThe current implementation supports opaque session credentials and JWT access tokens. The server-side session remains authoritative for session-backed authentication and lifecycle operations.\u003C/p\u003E\n\u003Cp\u003EHybrid should not be confused with PureJwt. A JWT issued within a Hybrid authentication context may retain a relationship with the server-side session.\u003C/p\u003E\n\u003Cp\u003EResource API support is currently limited to the session-validation path. Automatic selection between opaque session validation and Hybrid JWT validation is not yet implemented.\u003C/p\u003E\n\u003Cp\u003EConsequently, applications must explicitly configure compatible credentials and validation behavior when integrating Hybrid clients with separate Resource APIs.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient\n |\n | Opaque Access Token\n v\nAccess Token Resolution\n |\n v\nAssociated Session\n |\n v\nSession Validation\n |\n v\nAuthenticated Identity\n |\n v\nAccessContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe opaque access token and internal session identifier represent different concepts.\u003C/p\u003E\n\u003Cp\u003EThe access token is a client-facing authentication credential with its own lifetime. The session represents the server-authoritative authentication state.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-and-session-lifecycle\u0022\u003ERefresh and session lifecycle\u003C/h3\u003E\n\u003Cp\u003EHybrid uses refresh tokens to continue authentication without requiring a new login.\u003C/p\u003E\n\u003Cp\u003EA successful refresh validates the relevant session and refresh-token state, applies the configured session policies, and issues replacement credentials.\u003C/p\u003E\n\u003Cp\u003EAccess-token lifetime and session lifetime can therefore be managed separately.\u003C/p\u003E\n\u003Cp\u003EFor example, an application may use a short-lived opaque access token while maintaining a longer-lived session, subject to refresh-token expiration and revocation rules.\u003C/p\u003E\n\u003Cp\u003EA valid refresh token must not be allowed to restore an expired or revoked session.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022advantages-1\u0022\u003EAdvantages\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003ESeparate credential lifetimes\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAccess tokens can expire independently of the underlying session.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImmediate session-based revocation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EBecause session validity is enforced during authentication, revoking the session prevents associated access tokens from authenticating on subsequent validations.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EOpaque access credentials\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe access token does not disclose identity claims, roles, tenant information, or other application data through a readable token payload.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECentralized security policies\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESession status and related security conditions can be enforced as part of authentication.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESuitable for API-oriented clients\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications can use access and refresh tokens while retaining server-side control over the authenticated session.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022limitations-1\u0022\u003ELimitations\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EMore complex lifecycle\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EHybrid requires access-token issuance, refresh-token management, rotation, replay protection, and session lifecycle coordination.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EServer-side validation remains mandatory\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EOpaque access tokens do not provide stateless JWT validation. The server must resolve the token and enforce the associated session state.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAdditional infrastructure dependencies\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EToken resolution and session validation may require storage or cache access.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECredential theft remains a risk\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EOpaque tokens conceal claims but remain bearer credentials. Their format does not prevent unauthorized use if they are stolen.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-applications-1\u0022\u003ERecommended applications\u003C/h3\u003E\n\u003Cp\u003EHybrid is generally appropriate for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBlazor WebAssembly applications communicating with an API.\u003C/li\u003E\n\u003Cli\u003EWeb applications with a separate backend API.\u003C/li\u003E\n\u003Cli\u003EMobile and desktop applications requiring refresh-token continuity.\u003C/li\u003E\n\u003Cli\u003EFull-stack applications needing centrally controlled authentication.\u003C/li\u003E\n\u003Cli\u003ESystems requiring separate access-token expiration and immediate session revocation.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EHybrid is particularly useful when the application benefits from access/refresh token semantics but does not want to sacrifice server-authoritative session validation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022semihybrid\u0022\u003ESemiHybrid\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022stateless-jwt-validation-with-server-side-session-lifecycle\u0022\u003EStateless JWT validation with server-side session lifecycle\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid combines JWT access tokens with server-side session management.\u003C/p\u003E\n\u003Cp\u003EIts defining characteristic is the separation between \u003Cstrong\u003Eaccess-token validation\u003C/strong\u003E and \u003Cstrong\u003Esession lifecycle operations\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EFor normal authenticated requests, the server validates the JWT cryptographically. A session lookup is not required by default.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient\n |\n | JWT Access Token\n v\nJWT Validation\n |\n v\nAuthenticated Identity\n |\n v\nAccessContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server-side session is not consulted during this normal authentication path.\u003C/p\u003E\n\u003Cp\u003EHowever, the session remains relevant when the authentication lifecycle must be managed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-session-metadata-is-used-for\u0022\u003EWhat session metadata is used for\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid maintains server-side session state for operations such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ERefresh-token validation and rotation.\u003C/li\u003E\n\u003Cli\u003ELogout and session termination.\u003C/li\u003E\n\u003Cli\u003ERevoking an individual session.\u003C/li\u003E\n\u003Cli\u003ERevoking all sessions belonging to a user.\u003C/li\u003E\n\u003Cli\u003EListing active sessions or devices.\u003C/li\u003E\n\u003Cli\u003EEnforcing session expiration and continuation policies.\u003C/li\u003E\n\u003Cli\u003ERecording session lifecycle information.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThis state is a \u003Cstrong\u003Elifecycle control mechanism\u003C/strong\u003E, not a mandatory source of identity validation on every API request.\u003C/p\u003E\n\u003Cp\u003EFor example, when a user logs out, the server can revoke the session and prevent subsequent refresh operations from continuing it.\u003C/p\u003E\n\u003Cp\u003EHowever, a previously issued JWT may remain valid until its expiration because normal JWT validation does not consult that session.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022revocation-semantics\u0022\u003ERevocation semantics\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid must distinguish two separate guarantees.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession revocation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ERevoking the session prevents authentication continuation through that session, including refresh operations that require it.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAccess-token revocation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ERevoking the session does not automatically invalidate an already issued JWT.\u003C/p\u003E\n\u003Cp\u003EImmediate rejection of an issued JWT requires an additional mechanism, such as a revocation lookup against a distributed cache.\u003C/p\u003E\n\u003Cp\u003ESuch a mechanism can be supported as an explicit policy, but it introduces an additional request-time dependency and validation cost.\u003C/p\u003E\n\u003Cp\u003EWithout that policy, JWT expiration remains the boundary for an already issued access token.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022advantages-2\u0022\u003EAdvantages\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EStateless normal request validation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EProtected API requests can authenticate JWTs without consulting the session store.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECentralized lifecycle management\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications retain the ability to manage sessions, devices, refresh operations, and future authentication continuity.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EReduced request-time storage dependencies\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESession infrastructure is not part of the default JWT validation path.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EConfigurable revocation trade-offs\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications can choose whether to introduce additional request-time revocation enforcement when stronger invalidation guarantees are required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022limitations-2\u0022\u003ELimitations\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession revocation does not automatically revoke issued JWTs\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn access token can remain valid after logout until its expiration unless an additional revocation mechanism is enforced.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ELifecycle state is still required\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESemiHybrid is not a session-free mode. Refresh and session management depend on server-side state.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EMore complex expiration semantics\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EJWT expiration, refresh-token expiration, session expiration, and session activity policies must be coordinated.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EOptional revocation checks reduce statelessness\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIf immediate access-token revocation is enabled, the request pipeline may need an additional cache or store lookup.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-applications-2\u0022\u003ERecommended applications\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid is intended for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EHigh-throughput APIs that still require centralized session management.\u003C/li\u003E\n\u003Cli\u003EDistributed applications using short-lived JWT access tokens.\u003C/li\u003E\n\u003Cli\u003EApplications offering device and active-session management.\u003C/li\u003E\n\u003Cli\u003ESystems that need JWT validation performance without giving up refresh and session lifecycle control.\u003C/li\u003E\n\u003Cli\u003EArchitectures where access-token expiration is an acceptable default revocation boundary.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003ESemiHybrid should not be described as providing immediate JWT revocation unless an additional enforcement mechanism is enabled.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt\u0022\u003EPureJwt\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-independent-authentication-with-stateful-refresh\u0022\u003ESession-independent authentication with stateful refresh\u003C/h3\u003E\n\u003Cp\u003EPureJwt authenticates protected requests using cryptographically signed JWT access tokens without requiring Root, Chain, or Session records.\u003C/p\u003E\n\u003Cp\u003EUnlike a fully stateless authentication system, UltimateAuth\u0027s PureJwt implementation maintains server-side state for refresh-token lifecycle management.\u003C/p\u003E\n\u003Cp\u003EThis distinction is intentional:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAccess-token validation is stateless.\u003C/li\u003E\n\u003Cli\u003ERefresh-token validation and rotation are stateful.\u003C/li\u003E\n\u003Cli\u003ERefresh tokens are associated with a refresh chain and device context.\u003C/li\u003E\n\u003Cli\u003ELogout can revoke the corresponding refresh chain.\u003C/li\u003E\n\u003Cli\u003EPreviously issued JWT access tokens remain independently valid until expiration unless another validation condition invalidates them.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication\u0022\u003EAuthentication\u003C/h3\u003E\n\u003Cp\u003EAfter successful authentication, UltimateAuth issues a JWT access token and a refresh token.\u003C/p\u003E\n\u003Cp\u003EThe JWT includes the authenticated subject, tenant, device identifier, and applicable identity claims.\u003C/p\u003E\n\u003Cp\u003EA PureJwt access token does not contain a framework session identity.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022access-token-validation\u0022\u003EAccess-token validation\u003C/h3\u003E\n\u003Cp\u003EA Resource API validates JWT access tokens locally using:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ETrusted verification keys selected by key ID (\u003Ccode\u003Ekid\u003C/code\u003E).\u003C/li\u003E\n\u003Cli\u003EAn explicitly allowed signing algorithm.\u003C/li\u003E\n\u003Cli\u003EExpected issuer and audience.\u003C/li\u003E\n\u003Cli\u003EToken signature and lifetime.\u003C/li\u003E\n\u003Cli\u003EThe UltimateAuth access-token type (\u003Ccode\u003Euauth-access\u002Bjwt\u003C/code\u003E).\u003C/li\u003E\n\u003Cli\u003ETenant and subject claims.\u003C/li\u003E\n\u003Cli\u003EDevice binding according to the configured device policy.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EPureJwt Resource APIs do not require \u003Ccode\u003EHub.BaseUrl\u003C/code\u003E for normal access-token validation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-lifecycle\u0022\u003ERefresh-token lifecycle\u003C/h3\u003E\n\u003Cp\u003ERefresh tokens are persisted and rotated through a dedicated refresh chain.\u003C/p\u003E\n\u003Cp\u003EA successful refresh consumes the previous refresh token and issues replacement access and refresh credentials.\u003C/p\u003E\n\u003Cp\u003ERefresh rotation preserves the authenticated user, tenant, device, and refresh-chain relationships without creating a server-side authentication session.\u003C/p\u003E\n\u003Cp\u003ERefresh-token reuse outside the configured concurrent-request window can trigger refresh-chain revocation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout\u0022\u003ELogout\u003C/h3\u003E\n\u003Cp\u003EPureJwt logout can revoke the refresh chain associated with a validated refresh token.\u003C/p\u003E\n\u003Cp\u003ERevocation prevents subsequent refresh operations using that chain.\u003C/p\u003E\n\u003Cp\u003ELogout does not retroactively invalidate JWT access tokens already issued to the client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity considerations\u003C/h3\u003E\n\u003Cp\u003EPureJwt provides independent access-token validation, but it does not provide immediate access-token revocation through session state.\u003C/p\u003E\n\u003Cp\u003EChanges to user status, permissions, or account existence do not automatically invalidate an existing JWT when the Resource API performs only local token validation.\u003C/p\u003E\n\u003Cp\u003EApplications should use appropriately short access-token lifetimes and avoid placing sensitive information in JWT payloads.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-a-mode\u0022\u003EChoosing a mode\u003C/h2\u003E\n\u003Cp\u003EThe most useful selection criterion is not the client technology alone, but the authentication guarantees the application requires.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication or requirement\u003C/th\u003E\n\u003Cth\u003ERecommended mode\u003C/th\u003E\n\u003Cth\u003EReason\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003EServer-controlled sessions without a separate access/refresh token lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EASP.NET Core MVC or Razor Pages\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ESimple cookie-based session authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EInternal administrative application\u003C/td\u003E\n\u003Ctd\u003EPureOpaque or Hybrid\u003C/td\u003E\n\u003Ctd\u003ECentralized session control and immediate revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WebAssembly with a separate API\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EAccess/refresh tokens with authoritative session validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMobile or desktop client\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EIndependent token lifetimes with centralized session control\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EWeb application with separate frontend and API\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EToken-based access without losing server-side revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHigh-throughput API with session management\u003C/td\u003E\n\u003Ctd\u003ESemiHybrid\u003C/td\u003E\n\u003Ctd\u003EStateless JWT validation alongside managed session lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMulti-device application with session controls\u003C/td\u003E\n\u003Ctd\u003ESemiHybrid or Hybrid\u003C/td\u003E\n\u003Ctd\u003ECentralized device/session management; different access-validation costs\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDistributed resource APIs\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003EIndependent JWT validation without mandatory session lookup\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EExternal service integration\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003EStateless token validation across service boundaries\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EImmediate access revocation is essential\u003C/td\u003E\n\u003Ctd\u003EPureOpaque or Hybrid\u003C/td\u003E\n\u003Ctd\u003EEvery authentication evaluation enforces server-side session validity\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ENo session infrastructure is desired\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003EAuthentication does not require session persistence\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese are recommendations, not restrictions.\u003C/p\u003E\n\u003Cp\u003EFor example, Blazor WebAssembly can use PureOpaque through a secure cookie-based backend-for-frontend architecture. Similarly, a server-rendered application can use JWT authentication when its broader system requirements justify it.\u003C/p\u003E\n\u003Cp\u003EThe runtime does not inherently determine the security model.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profiles-and-authentication-modes\u0022\u003EApplication Profiles and authentication modes\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports different client environments through Application Profiles.\u003C/p\u003E\n\u003Cp\u003EAn Application Profile can provide suitable defaults for a runtime, including credential delivery and authentication-mode selection.\u003C/p\u003E\n\u003Cp\u003EHowever, an Application Profile and an authentication mode represent different concerns.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profile\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EDescribes how the application interacts with the authentication system, including runtime characteristics and credential transport.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthentication Mode\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EDefines the authentication credential model, session dependencies, validation strategy, and lifecycle guarantees.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server profile may default to PureOpaque, while a Blazor WebAssembly profile may default to Hybrid.\u003C/p\u003E\n\u003Cp\u003EThese defaults do not mean the modes are exclusive to those environments.\u003C/p\u003E\n\u003Cp\u003EApplications can override the effective mode through supported configuration and context-resolution mechanisms.\u003C/p\u003E\n\u003Cp\u003EWhen different clients share the same UAuthHub, the server must resolve the effective mode through trusted configuration and framework-controlled context. An untrusted client must not be allowed to select a weaker authentication policy arbitrarily.\u003C/p\u003E\n\u003Cp\u003EThe effective mode must remain stable throughout a single authentication operation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations-1\u0022\u003ESecurity considerations\u003C/h2\u003E\n\u003Cp\u003EAll four modes can support secure applications when implemented and configured correctly. None should be described as universally more secure than the others.\u003C/p\u003E\n\u003Cp\u003ETheir security guarantees differ.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-confidentiality\u0022\u003ECredential confidentiality\u003C/h3\u003E\n\u003Cp\u003EOpaque credentials do not expose readable claims, but possession of a valid bearer credential may still permit authentication.\u003C/p\u003E\n\u003Cp\u003EJWT signatures protect integrity and authenticity; they do not conceal the payload.\u003C/p\u003E\n\u003Cp\u003EAll credentials require appropriate transport and storage protections.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022revocation-guarantees\u0022\u003ERevocation guarantees\u003C/h3\u003E\n\u003Cp\u003EPureOpaque and Hybrid enforce server-side session validity during authenticated requests.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid enforces session validity during lifecycle operations but does not require it during normal JWT validation.\u003C/p\u003E\n\u003Cp\u003EPureJwt does not depend on sessions and does not provide session-based revocation.\u003C/p\u003E\n\u003Cp\u003EThese differences must be considered when selecting token lifetimes and logout behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-security\u0022\u003EBrowser security\u003C/h3\u003E\n\u003Cp\u003EWhen authentication credentials are delivered through cookies, appropriate \u003Ccode\u003EHttpOnly\u003C/code\u003E, \u003Ccode\u003ESecure\u003C/code\u003E, and \u003Ccode\u003ESameSite\u003C/code\u003E settings should be applied.\u003C/p\u003E\n\u003Cp\u003ECookie-based authentication also requires appropriate CSRF protections.\u003C/p\u003E\n\u003Cp\u003EWhen tokens are accessible to browser application code, XSS and token-exfiltration risks require particular attention.\u003C/p\u003E\n\u003Cp\u003EThe authentication mode does not eliminate these browser security requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-remains-separate\u0022\u003EAuthorization remains separate\u003C/h3\u003E\n\u003Cp\u003EAuthentication establishes the identity of the current actor.\u003C/p\u003E\n\u003Cp\u003EAuthorization determines what that actor is permitted to do.\u003C/p\u003E\n\u003Cp\u003EAll modes must produce trusted authentication state before authorization policies are evaluated.\u003C/p\u003E\n\u003Cp\u003EChoosing a stateless mode does not remove the need for authorization checks or appropriate handling of stale authorization claims.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s four authentication modes represent four distinct strategies:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EPureOpaque\u003C/strong\u003E uses a server-side session as the authentication authority and avoids a separate access/refresh token lifecycle.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EHybrid\u003C/strong\u003E uses separate opaque access and refresh tokens while requiring authoritative session validation for authenticated requests.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESemiHybrid\u003C/strong\u003E uses JWT access tokens for stateless request authentication while retaining server-side sessions for refresh, logout, revocation, and device management.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EPureJwt\u003C/strong\u003E uses JWT access tokens without requiring server-side session infrastructure.\u003C/p\u003E\n\u003Cp\u003EThe correct mode is the one whose validation, lifecycle, revocation, and operational guarantees match the application\u0027s requirements.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth preserves a consistent authentication and authorization architecture while allowing these underlying strategies to differ.\u003C/p\u003E\n", + "Html": "\n\u003Cp\u003EUltimateAuth provides four authentication modes: \u003Cstrong\u003EPureOpaque\u003C/strong\u003E, \u003Cstrong\u003EHybrid\u003C/strong\u003E, \u003Cstrong\u003ESemiHybrid\u003C/strong\u003E, and \u003Cstrong\u003EPureJwt\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EEach mode defines how authentication credentials are issued, validated, renewed, and revoked. The modes share the same authentication and authorization architecture, but differ in their reliance on server-side sessions, credential formats, and lifecycle guarantees.\u003C/p\u003E\n\u003Cp\u003EThe choice of authentication mode affects more than performance. It determines where authentication state is maintained, whether a server-side session must be consulted during an authenticated request, and how quickly previously issued credentials can be invalidated.\u003C/p\u003E\n\u003Cblockquote\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailability\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EPureOpaque, Hybrid, and PureJwt are implemented authentication modes.\nSemiHybrid remains reserved for a future implementation and should not be used in production.\u003C/p\u003E\n\u003Cp\u003EPureJwt supports locally validated JWT access tokens and stateful refresh-token rotation without requiring server-side authentication sessions.\u003C/p\u003E\n\u003Cp\u003EResource API authentication is configured independently from the issuing UAuthHub. Matching authentication mode names alone do not guarantee credential compatibility.\u003C/p\u003E\n\u003C/blockquote\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022auth-credentials\u0022\u003EAuth credentials\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth distinguishes three credential concepts.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession credential\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EA session credential identifies an authenticated session maintained by the server. In PureOpaque, it is the credential presented by the client to authenticate requests.\u003C/p\u003E\n\u003Cp\u003EA session credential may be represented by an opaque, randomly generated value. It does not need to expose the internal database identifier of the session.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAccess token\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn access token is a credential used to authenticate requests to protected resources.\u003C/p\u003E\n\u003Cp\u003EDepending on the mode, it may be:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAn opaque token resolved and validated by the server.\u003C/li\u003E\n\u003Cli\u003EA JWT validated cryptographically without a session lookup.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EAn access token is not a session identifier. In Hybrid, the JWT access token is a separate credential issued alongside a server-side session. The session remains authoritative for session-backed authentication and lifecycle management.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ERefresh token\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EA refresh token allows an existing authentication context to continue by obtaining replacement credentials without requiring the user to authenticate again.\u003C/p\u003E\n\u003Cp\u003ERefresh tokens have their own validation, expiration, rotation, and replay-protection requirements.\u003C/p\u003E\n\u003Cp\u003ENot every authentication mode requires all three credential types.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022mode-comparison\u0022\u003EMode comparison\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ECharacteristic\u003C/th\u003E\n\u003Cth\u003EPureOpaque\u003C/th\u003E\n\u003Cth\u003EHybrid\u003C/th\u003E\n\u003Cth\u003ESemiHybrid\u003C/th\u003E\n\u003Cth\u003EPureJwt\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESession credential\u003C/td\u003E\n\u003Ctd\u003EOpaque\u003C/td\u003E\n\u003Ctd\u003EOpaque\u003C/td\u003E\n\u003Ctd\u003ESession-backed\u003C/td\u003E\n\u003Ctd\u003ENone\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess token\u003C/td\u003E\n\u003Ctd\u003ENone\u003C/td\u003E\n\u003Ctd\u003EJWT\u003C/td\u003E\n\u003Ctd\u003EJWT\u003C/td\u003E\n\u003Ctd\u003EJWT\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh token\u003C/td\u003E\n\u003Ctd\u003ENone\u003C/td\u003E\n\u003Ctd\u003EStateful\u003C/td\u003E\n\u003Ctd\u003EStateful\u003C/td\u003E\n\u003Ctd\u003EStateful\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EServer-side session\u003C/td\u003E\n\u003Ctd\u003ERequired\u003C/td\u003E\n\u003Ctd\u003ERequired\u003C/td\u003E\n\u003Ctd\u003ERequired\u003C/td\u003E\n\u003Ctd\u003ENot required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess validation\u003C/td\u003E\n\u003Ctd\u003ESession validation\u003C/td\u003E\n\u003Ctd\u003EMode-specific session authority\u003C/td\u003E\n\u003Ctd\u003EJWT validation\u003C/td\u003E\n\u003Ctd\u003ELocal JWT validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERefresh continuity\u003C/td\u003E\n\u003Ctd\u003ESession touch\u003C/td\u003E\n\u003Ctd\u003ESession and refresh lifecycle\u003C/td\u003E\n\u003Ctd\u003ESession and refresh lifecycle\u003C/td\u003E\n\u003Ctd\u003ERefresh chain rotation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EImmediate session revocation\u003C/td\u003E\n\u003Ctd\u003EYes\u003C/td\u003E\n\u003Ctd\u003ESession-backed operations\u003C/td\u003E\n\u003Ctd\u003ESession-backed operations\u003C/td\u003E\n\u003Ctd\u003ENot applicable\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EImmediate JWT revocation\u003C/td\u003E\n\u003Ctd\u003ENot applicable\u003C/td\u003E\n\u003Ctd\u003EDepends on validation strategy\u003C/td\u003E\n\u003Ctd\u003EAdditional enforcement required\u003C/td\u003E\n\u003Ctd\u003ENot supported by local validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDevice binding\u003C/td\u003E\n\u003Ctd\u003ESession-based\u003C/td\u003E\n\u003Ctd\u003ESession/token-based\u003C/td\u003E\n\u003Ctd\u003EPlanned\u003C/td\u003E\n\u003Ctd\u003EJWT and refresh-token binding\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EResource API support\u003C/td\u003E\n\u003Ctd\u003EOpaque session validation\u003C/td\u003E\n\u003Ctd\u003ESession validation path; JWT integration incomplete\u003C/td\u003E\n\u003Ctd\u003ENot implemented\u003C/td\u003E\n\u003Ctd\u003ELocal JWT validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMain advantage\u003C/td\u003E\n\u003Ctd\u003ESimple, centrally controlled sessions\u003C/td\u003E\n\u003Ctd\u003ESeparate token lifecycle with session authority\u003C/td\u003E\n\u003Ctd\u003EStateless access validation with session management\u003C/td\u003E\n\u003Ctd\u003EMinimal authentication-state dependencies\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMain trade-off\u003C/td\u003E\n\u003Ctd\u003ESession lookup on each authenticated request\u003C/td\u003E\n\u003Ctd\u003EMore credentials and lifecycle complexity\u003C/td\u003E\n\u003Ctd\u003EExisting JWTs can remain valid after session revocation\u003C/td\u003E\n\u003Ctd\u003ENo immediate server-side session revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe comparison describes authentication behavior, not guaranteed throughput rankings. Actual performance depends on token validation costs, storage infrastructure, caching, network latency, request volume, and application architecture.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque\u0022\u003EPureOpaque\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022fully-session-based-authentication\u0022\u003EFully session-based authentication\u003C/h3\u003E\n\u003Cp\u003EPureOpaque is UltimateAuth\u0027s simplest stateful authentication mode.\u003C/p\u003E\n\u003Cp\u003EAuthentication is represented by a server-side session. The client receives an opaque session credential and presents it on subsequent authenticated requests.\u003C/p\u003E\n\u003Cp\u003EThe server resolves the credential, validates the session and its applicable security policies, and establishes the authenticated identity.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient\n |\n | Session Credential\n v\nSession Resolution\n |\n v\nSession Validation\n |\n v\nAuthenticated Identity\n |\n v\nAccessContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EPureOpaque does not issue a separate access token or refresh token.\u003C/p\u003E\n\u003Cp\u003EThe session credential itself is sufficient to identify the authentication context, provided the server determines that the session remains valid.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-continuation\u0022\u003ESession continuation\u003C/h3\u003E\n\u003Cp\u003EPureOpaque does not use refresh-token rotation.\u003C/p\u003E\n\u003Cp\u003EInstead, an existing session may continue through session touch operations, subject to the configured session policies.\u003C/p\u003E\n\u003Cp\u003EDepending on the configuration, these policies may include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESession lifetime.\u003C/li\u003E\n\u003Cli\u003ESliding expiration.\u003C/li\u003E\n\u003Cli\u003EIdle timeout.\u003C/li\u003E\n\u003Cli\u003ETouch interval.\u003C/li\u003E\n\u003Cli\u003EAbsolute expiration limits.\u003C/li\u003E\n\u003Cli\u003ESession revocation.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA touch operation does not necessarily extend the session lifetime. It updates session state only when the applicable policy requires it.\u003C/p\u003E\n\u003Cp\u003EAn expired or revoked session cannot be restored merely by touching it.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022advantages\u0022\u003EAdvantages\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EMinimal credential complexity\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThere is no separate access-token lifecycle, refresh-token storage, or refresh-token rotation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImmediate session revocation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhen a session is revoked, subsequent authentication evaluations that validate that session reject the credential.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECentralized authentication control\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe server remains authoritative for session validity and can enforce current session policies.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ENatural integration with server-rendered applications\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications already maintaining server-side authentication state can use a single session credential without introducing additional token-management mechanisms.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022limitations\u0022\u003ELimitations\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession validation is required\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EEvery authenticated request must validate the server-side session. Depending on the deployment, this can involve a database or distributed cache lookup.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailability depends on session infrastructure\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EA distributed deployment needs reliable access to shared session state or an equivalent session-validation mechanism.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe session credential is sensitive\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EPossession of a valid session credential may be sufficient to authenticate as the session owner. It must be protected against disclosure, replay, and session fixation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ELong-lived connections require special handling\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIn environments such as Blazor Server, an established SignalR circuit may outlive the authentication state initially used to establish it. Appropriate revalidation and authorization checks remain necessary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-applications\u0022\u003ERecommended applications\u003C/h3\u003E\n\u003Cp\u003EPureOpaque is generally a strong default for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBlazor Server applications.\u003C/li\u003E\n\u003Cli\u003EASP.NET Core MVC and Razor Pages applications.\u003C/li\u003E\n\u003Cli\u003EInternal applications using centrally managed sessions.\u003C/li\u003E\n\u003Cli\u003EBrowser applications using secure, HttpOnly session cookies.\u003C/li\u003E\n\u003Cli\u003ESystems that prioritize simple session lifecycle management and immediate server-side revocation.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EPureOpaque is not restricted to server-to-server communication. It can also be used safely with browser and mobile clients when credentials are stored, transported, and validated appropriately.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid\u0022\u003EHybrid\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-backed-authentication-with-separate-tokens\u0022\u003ESession-backed authentication with separate tokens\u003C/h3\u003E\n\u003Cp\u003EHybrid combines server-authoritative authentication sessions with JWT access tokens and opaque refresh tokens.\u003C/p\u003E\n\u003Cp\u003EA successful login establishes a server-side session and issues separate access and refresh credentials.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EAuthentication\n |\n \u002B----\u0026gt; Opaque Session Credential\n | |\n | Session Validation\n | |\n | Root / Chain / Session\n |\n \u002B----\u0026gt; JWT Access Token\n |\n \u002B----\u0026gt; Opaque Refresh Token\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe session identifier, access token, and refresh token represent different credentials with different responsibilities.\u003C/p\u003E\n\u003Cp\u003EThe server-side session remains authoritative for session-backed authentication. Issuing a JWT does not automatically make Hybrid authentication stateless.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022current-resource-api-support\u0022\u003ECurrent Resource API support\u003C/h3\u003E\n\u003Cp\u003EIn the current implementation, Hybrid Resource APIs authenticate requests using the opaque session credential and validate the session remotely through UAuthHub.\u003C/p\u003E\n\u003Cp\u003EHybrid-aware JWT access-token validation in separate Resource APIs is not yet implemented.\u003C/p\u003E\n\u003Cp\u003EApplications requiring independent JWT validation should explicitly select PureJwt and configure compatible signing and verification keys.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-and-session-lifecycle\u0022\u003ERefresh and session lifecycle\u003C/h3\u003E\n\u003Cp\u003EHybrid uses refresh tokens to continue authentication without requiring the user to authenticate again.\u003C/p\u003E\n\u003Cp\u003EA successful refresh validates the relevant session and refresh-token state, applies the configured session policies, and issues replacement credentials.\u003C/p\u003E\n\u003Cp\u003ESession lifetime, access-token lifetime, and refresh-token lifetime are separate concerns.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022advantages-1\u0022\u003EAdvantages\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EServer-authoritative authentication\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESession-backed requests remain subject to server-side session validation and lifecycle policies.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECentralized session management\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications retain access to device-associated sessions, session chains, revocation, and other session-management capabilities.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESeparate credential lifetimes\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAccess and refresh credentials can have lifetimes appropriate to their individual responsibilities.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUnified application integration\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EHybrid provides a common authentication model for browser applications, native clients, and centralized authentication deployments.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022limitations-1\u0022\u003ELimitations\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EServer-side state\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EHybrid requires session infrastructure and refresh-token lifecycle management.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ERemote validation dependency\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESeparate Resource APIs using session validation depend on the availability of the authentication server.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EJWT integration boundaries\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EHybrid JWT access tokens must not be treated as interchangeable with PureJwt access tokens. The current Resource API implementation does not support Hybrid-aware JWT validation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECredential confidentiality\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EJWT payloads are readable by their holders. Signing protects integrity and authenticity, not confidentiality.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-applications-1\u0022\u003ERecommended applications\u003C/h3\u003E\n\u003Cp\u003EHybrid is particularly useful for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EBlazor WebAssembly applications.\u003C/li\u003E\n\u003Cli\u003ENative and mobile applications.\u003C/li\u003E\n\u003Cli\u003EApplications using centralized authentication through UAuthHub.\u003C/li\u003E\n\u003Cli\u003EApplications requiring token-based credential delivery while retaining server-authoritative session management.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EHybrid is the default authentication mode for application profiles other than BlazorServer under the built-in mode resolver.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022semihybrid\u0022\u003ESemiHybrid\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022stateless-jwt-validation-with-server-side-session-lifecycle\u0022\u003EStateless JWT validation with server-side session lifecycle\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid combines JWT access tokens with server-side session management.\u003C/p\u003E\n\u003Cp\u003EIts defining characteristic is the separation between \u003Cstrong\u003Eaccess-token validation\u003C/strong\u003E and \u003Cstrong\u003Esession lifecycle operations\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EFor normal authenticated requests, the server validates the JWT cryptographically. A session lookup is not required by default.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient\n |\n | JWT Access Token\n v\nJWT Validation\n |\n v\nAuthenticated Identity\n |\n v\nAccessContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server-side session is not consulted during this normal authentication path.\u003C/p\u003E\n\u003Cp\u003EHowever, the session remains relevant when the authentication lifecycle must be managed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-session-metadata-is-used-for\u0022\u003EWhat session metadata is used for\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid maintains server-side session state for operations such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ERefresh-token validation and rotation.\u003C/li\u003E\n\u003Cli\u003ELogout and session termination.\u003C/li\u003E\n\u003Cli\u003ERevoking an individual session.\u003C/li\u003E\n\u003Cli\u003ERevoking all sessions belonging to a user.\u003C/li\u003E\n\u003Cli\u003EListing active sessions or devices.\u003C/li\u003E\n\u003Cli\u003EEnforcing session expiration and continuation policies.\u003C/li\u003E\n\u003Cli\u003ERecording session lifecycle information.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThis state is a \u003Cstrong\u003Elifecycle control mechanism\u003C/strong\u003E, not a mandatory source of identity validation on every API request.\u003C/p\u003E\n\u003Cp\u003EFor example, when a user logs out, the server can revoke the session and prevent subsequent refresh operations from continuing it.\u003C/p\u003E\n\u003Cp\u003EHowever, a previously issued JWT may remain valid until its expiration because normal JWT validation does not consult that session.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022revocation-semantics\u0022\u003ERevocation semantics\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid must distinguish two separate guarantees.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession revocation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ERevoking the session prevents authentication continuation through that session, including refresh operations that require it.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAccess-token revocation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ERevoking the session does not automatically invalidate an already issued JWT.\u003C/p\u003E\n\u003Cp\u003EImmediate rejection of an issued JWT requires an additional mechanism, such as a revocation lookup against a distributed cache.\u003C/p\u003E\n\u003Cp\u003ESuch a mechanism can be supported as an explicit policy, but it introduces an additional request-time dependency and validation cost.\u003C/p\u003E\n\u003Cp\u003EWithout that policy, JWT expiration remains the boundary for an already issued access token.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022advantages-2\u0022\u003EAdvantages\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EStateless normal request validation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EProtected API requests can authenticate JWTs without consulting the session store.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ECentralized lifecycle management\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications retain the ability to manage sessions, devices, refresh operations, and future authentication continuity.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EReduced request-time storage dependencies\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESession infrastructure is not part of the default JWT validation path.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EConfigurable revocation trade-offs\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EApplications can choose whether to introduce additional request-time revocation enforcement when stronger invalidation guarantees are required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022limitations-2\u0022\u003ELimitations\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession revocation does not automatically revoke issued JWTs\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAn access token can remain valid after logout until its expiration unless an additional revocation mechanism is enforced.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ELifecycle state is still required\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESemiHybrid is not a session-free mode. Refresh and session management depend on server-side state.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EMore complex expiration semantics\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EJWT expiration, refresh-token expiration, session expiration, and session activity policies must be coordinated.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EOptional revocation checks reduce statelessness\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIf immediate access-token revocation is enabled, the request pipeline may need an additional cache or store lookup.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-applications-2\u0022\u003ERecommended applications\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid is intended for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EHigh-throughput APIs that still require centralized session management.\u003C/li\u003E\n\u003Cli\u003EDistributed applications using short-lived JWT access tokens.\u003C/li\u003E\n\u003Cli\u003EApplications offering device and active-session management.\u003C/li\u003E\n\u003Cli\u003ESystems that need JWT validation performance without giving up refresh and session lifecycle control.\u003C/li\u003E\n\u003Cli\u003EArchitectures where access-token expiration is an acceptable default revocation boundary.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003ESemiHybrid should not be described as providing immediate JWT revocation unless an additional enforcement mechanism is enabled.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt\u0022\u003EPureJwt\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-independent-authentication-with-stateful-refresh\u0022\u003ESession-independent authentication with stateful refresh\u003C/h3\u003E\n\u003Cp\u003EPureJwt authenticates protected requests using cryptographically signed JWT access tokens without requiring Root, Chain, or Session records.\u003C/p\u003E\n\u003Cp\u003EUnlike a fully stateless authentication system, UltimateAuth\u0027s PureJwt implementation maintains server-side state for refresh-token lifecycle management.\u003C/p\u003E\n\u003Cp\u003EThis distinction is intentional:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAccess-token validation is stateless.\u003C/li\u003E\n\u003Cli\u003ERefresh-token validation and rotation are stateful.\u003C/li\u003E\n\u003Cli\u003ERefresh tokens are associated with a refresh chain and device context.\u003C/li\u003E\n\u003Cli\u003ELogout can revoke the corresponding refresh chain.\u003C/li\u003E\n\u003Cli\u003EPreviously issued JWT access tokens remain independently valid until expiration unless another validation condition invalidates them.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication\u0022\u003EAuthentication\u003C/h3\u003E\n\u003Cp\u003EAfter successful authentication, UltimateAuth issues a JWT access token and a refresh token.\u003C/p\u003E\n\u003Cp\u003EThe JWT includes the authenticated subject, tenant, device identifier, and applicable identity claims.\u003C/p\u003E\n\u003Cp\u003EA PureJwt access token does not contain a framework session identity.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022access-token-validation\u0022\u003EAccess-token validation\u003C/h3\u003E\n\u003Cp\u003EA Resource API validates JWT access tokens locally using:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ETrusted verification keys selected by key ID (\u003Ccode\u003Ekid\u003C/code\u003E).\u003C/li\u003E\n\u003Cli\u003EAn explicitly allowed signing algorithm.\u003C/li\u003E\n\u003Cli\u003EExpected issuer and audience.\u003C/li\u003E\n\u003Cli\u003EToken signature and lifetime.\u003C/li\u003E\n\u003Cli\u003EThe UltimateAuth access-token type (\u003Ccode\u003Euauth-access\u002Bjwt\u003C/code\u003E).\u003C/li\u003E\n\u003Cli\u003ETenant and subject claims.\u003C/li\u003E\n\u003Cli\u003EDevice binding according to the configured device policy.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EPureJwt Resource APIs do not require \u003Ccode\u003EHub.BaseUrl\u003C/code\u003E for normal access-token validation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-lifecycle\u0022\u003ERefresh-token lifecycle\u003C/h3\u003E\n\u003Cp\u003ERefresh tokens are persisted and rotated through a dedicated refresh chain.\u003C/p\u003E\n\u003Cp\u003EA successful refresh consumes the previous refresh token and issues replacement access and refresh credentials.\u003C/p\u003E\n\u003Cp\u003ERefresh rotation preserves the authenticated user, tenant, device, and refresh-chain relationships without creating a server-side authentication session.\u003C/p\u003E\n\u003Cp\u003ERefresh-token reuse outside the configured concurrent-request window can trigger refresh-chain revocation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout\u0022\u003ELogout\u003C/h3\u003E\n\u003Cp\u003EPureJwt logout can revoke the refresh chain associated with a validated refresh token.\u003C/p\u003E\n\u003Cp\u003ERevocation prevents subsequent refresh operations using that chain.\u003C/p\u003E\n\u003Cp\u003ELogout does not retroactively invalidate JWT access tokens already issued to the client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations\u0022\u003ESecurity considerations\u003C/h3\u003E\n\u003Cp\u003EPureJwt provides independent access-token validation, but it does not provide immediate access-token revocation through session state.\u003C/p\u003E\n\u003Cp\u003EChanges to user status, permissions, or account existence do not automatically invalidate an existing JWT when the Resource API performs only local token validation.\u003C/p\u003E\n\u003Cp\u003EApplications should use appropriately short access-token lifetimes and avoid placing sensitive information in JWT payloads.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-a-mode\u0022\u003EChoosing a mode\u003C/h2\u003E\n\u003Cp\u003EThe most useful selection criterion is not the client technology alone, but the authentication guarantees the application requires.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication or requirement\u003C/th\u003E\n\u003Cth\u003ERecommended mode\u003C/th\u003E\n\u003Cth\u003EReason\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003EServer-controlled sessions without a separate access/refresh token lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EASP.NET Core MVC or Razor Pages\u003C/td\u003E\n\u003Ctd\u003EPureOpaque\u003C/td\u003E\n\u003Ctd\u003ESimple cookie-based session authentication\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EInternal administrative application\u003C/td\u003E\n\u003Ctd\u003EPureOpaque or Hybrid\u003C/td\u003E\n\u003Ctd\u003ECentralized session control and immediate revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WebAssembly with a separate API\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EAccess/refresh tokens with authoritative session validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMobile or desktop client\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EIndependent token lifetimes with centralized session control\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EWeb application with separate frontend and API\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003Ctd\u003EToken-based access without losing server-side revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHigh-throughput API with session management\u003C/td\u003E\n\u003Ctd\u003ESemiHybrid\u003C/td\u003E\n\u003Ctd\u003EStateless JWT validation alongside managed session lifecycle\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMulti-device application with session controls\u003C/td\u003E\n\u003Ctd\u003ESemiHybrid or Hybrid\u003C/td\u003E\n\u003Ctd\u003ECentralized device/session management; different access-validation costs\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDistributed resource APIs\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003EIndependent JWT validation without mandatory session lookup\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EExternal service integration\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003EStateless token validation across service boundaries\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EImmediate access revocation is essential\u003C/td\u003E\n\u003Ctd\u003EPureOpaque or Hybrid\u003C/td\u003E\n\u003Ctd\u003EEvery authentication evaluation enforces server-side session validity\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ENo session infrastructure is desired\u003C/td\u003E\n\u003Ctd\u003EPureJwt\u003C/td\u003E\n\u003Ctd\u003EAuthentication does not require session persistence\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese are recommendations, not restrictions.\u003C/p\u003E\n\u003Cp\u003EFor example, Blazor WebAssembly can use PureOpaque through a secure cookie-based backend-for-frontend architecture. Similarly, a server-rendered application can use JWT authentication when its broader system requirements justify it.\u003C/p\u003E\n\u003Cp\u003EThe runtime does not inherently determine the security model.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profiles-and-authentication-modes\u0022\u003EApplication Profiles and authentication modes\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth supports different client environments through Application Profiles.\u003C/p\u003E\n\u003Cp\u003EAn Application Profile can provide suitable defaults for a runtime, including credential delivery and authentication-mode selection.\u003C/p\u003E\n\u003Cp\u003EHowever, an Application Profile and an authentication mode represent different concerns.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplication Profile\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EDescribes how the application interacts with the authentication system, including runtime characteristics and credential transport.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthentication Mode\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EDefines the authentication credential model, session dependencies, validation strategy, and lifecycle guarantees.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server profile may default to PureOpaque, while a Blazor WebAssembly profile may default to Hybrid.\u003C/p\u003E\n\u003Cp\u003EThese defaults do not mean the modes are exclusive to those environments.\u003C/p\u003E\n\u003Cp\u003EApplications can override the effective mode through supported configuration and context-resolution mechanisms.\u003C/p\u003E\n\u003Cp\u003EWhen different clients share the same UAuthHub, the server must resolve the effective mode through trusted configuration and framework-controlled context. An untrusted client must not be allowed to select a weaker authentication policy arbitrarily.\u003C/p\u003E\n\u003Cp\u003EThe effective mode must remain stable throughout a single authentication operation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-considerations-1\u0022\u003ESecurity considerations\u003C/h2\u003E\n\u003Cp\u003EAll four modes can support secure applications when implemented and configured correctly. None should be described as universally more secure than the others.\u003C/p\u003E\n\u003Cp\u003ETheir security guarantees differ.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-confidentiality\u0022\u003ECredential confidentiality\u003C/h3\u003E\n\u003Cp\u003EOpaque credentials do not expose readable claims, but possession of a valid bearer credential may still permit authentication.\u003C/p\u003E\n\u003Cp\u003EJWT signatures protect integrity and authenticity; they do not conceal the payload.\u003C/p\u003E\n\u003Cp\u003EAll credentials require appropriate transport and storage protections.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022revocation-guarantees\u0022\u003ERevocation guarantees\u003C/h3\u003E\n\u003Cp\u003EPureOpaque and Hybrid enforce server-side session validity during authenticated requests.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid enforces session validity during lifecycle operations but does not require it during normal JWT validation.\u003C/p\u003E\n\u003Cp\u003EPureJwt does not depend on sessions and does not provide session-based revocation.\u003C/p\u003E\n\u003Cp\u003EThese differences must be considered when selecting token lifetimes and logout behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-security\u0022\u003EBrowser security\u003C/h3\u003E\n\u003Cp\u003EWhen authentication credentials are delivered through cookies, appropriate \u003Ccode\u003EHttpOnly\u003C/code\u003E, \u003Ccode\u003ESecure\u003C/code\u003E, and \u003Ccode\u003ESameSite\u003C/code\u003E settings should be applied.\u003C/p\u003E\n\u003Cp\u003ECookie-based authentication also requires appropriate CSRF protections.\u003C/p\u003E\n\u003Cp\u003EWhen tokens are accessible to browser application code, XSS and token-exfiltration risks require particular attention.\u003C/p\u003E\n\u003Cp\u003EThe authentication mode does not eliminate these browser security requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-remains-separate\u0022\u003EAuthorization remains separate\u003C/h3\u003E\n\u003Cp\u003EAuthentication establishes the identity of the current actor.\u003C/p\u003E\n\u003Cp\u003EAuthorization determines what that actor is permitted to do.\u003C/p\u003E\n\u003Cp\u003EAll modes must produce trusted authentication state before authorization policies are evaluated.\u003C/p\u003E\n\u003Cp\u003EChoosing a stateless mode does not remove the need for authorization checks or appropriate handling of stale authorization claims.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s four authentication modes represent four distinct strategies:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EPureOpaque\u003C/strong\u003E uses a server-side session as the authentication authority and avoids a separate access/refresh token lifecycle.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EHybrid\u003C/strong\u003E combines server-authoritative sessions with JWT access tokens and opaque refresh tokens. The current Resource API implementation authenticates Hybrid requests through remote session validation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESemiHybrid\u003C/strong\u003E uses JWT access tokens for stateless request authentication while retaining server-side sessions for refresh, logout, revocation, and device management.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EPureJwt\u003C/strong\u003E uses JWT access tokens without requiring server-side session infrastructure.\u003C/p\u003E\n\u003Cp\u003EThe correct mode is the one whose validation, lifecycle, revocation, and operational guarantees match the application\u0027s requirements.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth preserves a consistent authentication and authorization architecture while allowing these underlying strategies to differ.\u003C/p\u003E\n", "Headings": [ { "Id": "auth-credentials", @@ -53,6 +53,11 @@ "Text": "Session-backed authentication with separate tokens", "Level": 1 }, + { + "Id": "current-resource-api-support", + "Text": "Current Resource API support", + "Level": 1 + }, { "Id": "refresh-and-session-lifecycle", "Text": "Refresh and session lifecycle", @@ -184,6 +189,6 @@ "Level": 0 } ], - "SourceHash": "40890178BF6F512777874CE8E0FD600569C66E433120EE2B1C4167D7F1B0BBA6", + "SourceHash": "26106ACEBA42452DDDDB6CC4D34476242082FE9BD0E1E0AADA3CAC4C12867F6A", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/runtime-architecture.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/runtime-architecture.json index faccc53d..f5317dfa 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/runtime-architecture.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/fundamentals/runtime-architecture.json @@ -1,7 +1,7 @@ { "Slug": "fundamentals/runtime-architecture", "Title": "Runtime Architecture", - "Html": "\n\u003Cp\u003EUltimateAuth is designed to provide a unified authentication architecture across different .NET application environments.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server application, a standalone Blazor WebAssembly application, a native MAUI application, and a resource API may have different execution models, but they should not require entirely separate authentication systems.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth addresses this through a separation between \u003Cstrong\u003Eauthentication infrastructure, client integration, hosting, and protected resources\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThis separation allows authentication behavior to remain consistent while adapting to the capabilities and responsibilities of each runtime.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022architectural-overview\u0022\u003EArchitectural overview\u003C/h2\u003E\n\u003Cp\u003EAt a high level, UltimateAuth consists of several cooperating layers:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ECore:\u003C/strong\u003E Shared authentication contracts, models, and foundational abstractions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EServer:\u003C/strong\u003E Authentication operations, security decisions, credential management, and persistence coordination.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient:\u003C/strong\u003E Client-side integration, authentication requests, and credential lifecycle handling.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUAuthHub:\u003C/strong\u003E The application hosting UltimateAuth\u0027s authentication endpoints and services.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EResource applications:\u003C/strong\u003E Applications and APIs that consume authenticated identity and enforce authorization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese are architectural responsibilities, not necessarily separate processes or deployments.\u003C/p\u003E\n\u003Cp\u003EA single application may host multiple responsibilities. Alternatively, they can be distributed across independently deployed services.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Application Clients\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 \u2502 \u2502\n Blazor WASM MAUI Other Clients\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u2502 HTTP\n \u25BC\n UAuthHub\n \u2502\n UltimateAuth Server\n \u2502\n Authentication Services\n \u2502\n Stores / Providers\n \u2502\n \u25BC\n Persistent State\n\n\n Protected Resources\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 \u2502 \u2502\n Resource API Web App Other Services\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n Authentication Validation\n \u2502\n Authorization\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis diagram illustrates the separation of responsibilities.\u003C/p\u003E\n\u003Cp\u003EIt does not imply that every authenticated resource request must pass through UAuthHub.\u003C/p\u003E\n\u003Cp\u003EWhether a protected resource needs to consult server-side authentication infrastructure depends on the effective authentication mode and its validation requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022core-shared-authentication-foundations\u0022\u003ECore: shared authentication foundations\u003C/h2\u003E\n\u003Cp\u003EThe Core layer defines the common concepts used throughout UltimateAuth.\u003C/p\u003E\n\u003Cp\u003EIts responsibility is to provide stable contracts and abstractions without depending on a particular client runtime or application host.\u003C/p\u003E\n\u003Cp\u003EThese foundations include concepts such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication modes.\u003C/li\u003E\n\u003Cli\u003EAuthentication and security contexts.\u003C/li\u003E\n\u003Cli\u003EAuthentication results and contracts.\u003C/li\u003E\n\u003Cli\u003EDomain models and shared abstractions.\u003C/li\u003E\n\u003Cli\u003ESecurity-related options and definitions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe Core layer provides the common vocabulary used by client integrations, server services, and other framework components.\u003C/p\u003E\n\u003Cp\u003EIt should not contain assumptions that authentication always occurs through an HTTP endpoint, a browser cookie, or a particular hosting model.\u003C/p\u003E\n\u003Cp\u003EThis separation is important because UltimateAuth supports both stateful and stateless authentication strategies.\u003C/p\u003E\n\u003Cp\u003EA shared authentication contract must not implicitly require session persistence when the selected mode does not use sessions.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-authentication-execution-and-lifecycle\u0022\u003EServer: authentication execution and lifecycle\u003C/h2\u003E\n\u003Cp\u003EThe Server layer implements the server-side authentication capabilities.\u003C/p\u003E\n\u003Cp\u003EIt coordinates the operations required to establish, continue, validate, and terminate authentication according to the effective mode and security policies.\u003C/p\u003E\n\u003Cp\u003EIts responsibilities include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication flow execution.\u003C/li\u003E\n\u003Cli\u003ECredential validation and management.\u003C/li\u003E\n\u003Cli\u003ESession and token lifecycle operations.\u003C/li\u003E\n\u003Cli\u003EAuthentication security decisions.\u003C/li\u003E\n\u003Cli\u003ECoordination with persistence providers.\u003C/li\u003E\n\u003Cli\u003ECredential issuance and validation.\u003C/li\u003E\n\u003Cli\u003EIntegration with server-side authorization infrastructure.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe Server layer contains multiple cooperating services rather than one universal authentication engine responsible for every decision.\u003C/p\u003E\n\u003Cp\u003EFor example, session lifecycle operations, credential verification, and authorization may follow different execution paths while sharing common security contracts.\u003C/p\u003E\n\u003Cp\u003EThe architecture separates orchestration from the underlying services that perform domain-specific work.\u003C/p\u003E\n\u003Cp\u003EFor the detailed execution pipeline, see \u003Ca href=\u0022/docs/auth-flows/overview\u0022\u003EAuth Flows\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-runtime-integration\u0022\u003EClient: runtime integration\u003C/h2\u003E\n\u003Cp\u003EThe Client layer provides the integration between an application and UltimateAuth\u0027s authentication services.\u003C/p\u003E\n\u003Cp\u003EIts purpose is to reduce the amount of authentication infrastructure that application developers need to implement themselves.\u003C/p\u003E\n\u003Cp\u003EDepending on the supported runtime and configuration, client integration may handle:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EInitiating authentication flows.\u003C/li\u003E\n\u003Cli\u003ECommunicating with UAuthHub.\u003C/li\u003E\n\u003Cli\u003EProcessing authentication outcomes.\u003C/li\u003E\n\u003Cli\u003EManaging supported credential delivery mechanisms.\u003C/li\u003E\n\u003Cli\u003ECoordinating authentication state with the application.\u003C/li\u003E\n\u003Cli\u003EIntegrating authenticated requests with protected resources.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe client SDK does not replace server-side authentication validation.\u003C/p\u003E\n\u003Cp\u003EIt provides an application-facing interface to the authentication infrastructure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-integration-is-runtime-aware\u0022\u003EClient integration is runtime-aware\u003C/h3\u003E\n\u003Cp\u003EDifferent client runtimes have different capabilities.\u003C/p\u003E\n\u003Cp\u003EA browser-based WebAssembly application executes within browser security restrictions.\u003C/p\u003E\n\u003Cp\u003EA native MAUI application has access to platform-specific capabilities.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server application executes application logic on the server while maintaining an interactive connection with the browser.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth accounts for these differences through runtime-specific integrations and Application Profiles.\u003C/p\u003E\n\u003Cp\u003EThe authentication model remains shared even when the implementation of credential transport or application state differs.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/fundamentals/application-profiles\u0022\u003EApplication Profiles\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022uauthhub-the-authentication-host\u0022\u003EUAuthHub: the authentication host\u003C/h2\u003E\n\u003Cp\u003EUAuthHub is the application hosting UltimateAuth\u0027s server-side authentication infrastructure.\u003C/p\u003E\n\u003Cp\u003EIt provides the environment in which authentication endpoints and the required server services are available.\u003C/p\u003E\n\u003Cp\u003EDepending on the deployment, UAuthHub can be responsible for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAccepting authentication requests.\u003C/li\u003E\n\u003Cli\u003EResolving the applicable tenant and authentication context.\u003C/li\u003E\n\u003Cli\u003EExecuting authentication flows.\u003C/li\u003E\n\u003Cli\u003EManaging credentials and sessions.\u003C/li\u003E\n\u003Cli\u003EIssuing authentication credentials.\u003C/li\u003E\n\u003Cli\u003EApplying configured authentication policies.\u003C/li\u003E\n\u003Cli\u003EExposing the supported authentication endpoints.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EUAuthHub is a hosting role, not an authentication mode.\u003C/p\u003E\n\u003Cp\u003EA single UAuthHub can support multiple client environments and authentication strategies, subject to its configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022centralized-hosting\u0022\u003ECentralized hosting\u003C/h3\u003E\n\u003Cp\u003EIn a centralized deployment, several applications can use the same UAuthHub.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor WASM Application \u2500\u2500\u2510\n \u2502\nMAUI Application \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u25BA UAuthHub\n \u2502 \u2502\nWeb Application \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n \u25BC\n Authentication Services\n \u2502\n \u25BC\n Authentication Storage\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows applications to share authentication infrastructure without requiring each application to implement its own credential management and authentication lifecycle.\u003C/p\u003E\n\u003Cp\u003EHowever, centralized authentication hosting does not mean that all protected resource requests must be routed through UAuthHub.\u003C/p\u003E\n\u003Cp\u003EThe resource authentication strategy remains mode-dependent.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-applications-and-apis\u0022\u003EResource applications and APIs\u003C/h2\u003E\n\u003Cp\u003EA resource application is an application or service that exposes functionality requiring authentication and authorization.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EA protected Web API.\u003C/li\u003E\n\u003Cli\u003EAn administrative web application.\u003C/li\u003E\n\u003Cli\u003EA business application backend.\u003C/li\u003E\n\u003Cli\u003EAn independently deployed service.\u003C/li\u003E\n\u003Cli\u003EA server-rendered application with protected operations.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA resource application must establish the caller\u0027s authenticated identity before allowing access to protected functionality.\u003C/p\u003E\n\u003Cp\u003EIt must then enforce the relevant authorization policies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-validation-depends-on-the-mode\u0022\u003EAuthentication validation depends on the mode\u003C/h3\u003E\n\u003Cp\u003EIn PureOpaque and Hybrid, authentication requires server-side session authority.\u003C/p\u003E\n\u003Cp\u003EThe resource authentication path must therefore have access to the infrastructure necessary to enforce the relevant session validation requirements.\u003C/p\u003E\n\u003Cp\u003EIn SemiHybrid and PureJwt, normal access-token authentication uses JWT validation without a mandatory session lookup.\u003C/p\u003E\n\u003Cp\u003EThis can allow a resource API to validate access tokens locally when it has the required verification keys and token-validation configuration.\u003C/p\u003E\n\u003Cp\u003EThe authentication mode therefore affects the resource application\u0027s infrastructure dependencies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-remains-local-to-the-protected-operation\u0022\u003EAuthorization remains local to the protected operation\u003C/h3\u003E\n\u003Cp\u003EAuthentication establishes who the caller is.\u003C/p\u003E\n\u003Cp\u003EAuthorization determines whether that caller may perform the requested operation.\u003C/p\u003E\n\u003Cp\u003EA valid authentication credential does not automatically grant permission to every resource.\u003C/p\u003E\n\u003Cp\u003EResource applications must continue to enforce their authorization requirements through the applicable framework and application policies.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth\u0027s authentication integration should preserve these boundaries rather than replacing resource authorization with client-side assumptions.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022deployment-topology\u0022\u003EDeployment topology\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates architectural responsibilities from physical deployment boundaries.\u003C/p\u003E\n\u003Cp\u003EThis means the same authentication architecture can support different deployment topologies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022integrated-deployment\u0022\u003EIntegrated deployment\u003C/h3\u003E\n\u003Cp\u003EAn integrated deployment hosts authentication infrastructure and application functionality within the same server application.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EASP.NET Core Application\n \u2502\n \u251C\u2500\u2500 UltimateAuth Server\n \u2502\n \u251C\u2500\u2500 Authentication Services\n \u2502\n \u251C\u2500\u2500 Application Services\n \u2502\n \u2514\u2500\u2500 Protected Endpoints\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this model, authentication services and protected application functionality may share the same dependency injection container and process.\u003C/p\u003E\n\u003Cp\u003EWhere supported, internal operations can interact with server-side services directly without requiring an HTTP call to the same application.\u003C/p\u003E\n\u003Cp\u003EThis can simplify deployment and avoid unnecessary network communication.\u003C/p\u003E\n\u003Cp\u003EHowever, direct service access must still respect the required authentication and authorization boundaries.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022distributed-deployment\u0022\u003EDistributed deployment\u003C/h3\u003E\n\u003Cp\u003EA distributed deployment separates the authentication host from one or more resource applications.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E UAuthHub\n \u2502\n \u2502 Authentication\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 \u2502\n Web Application Mobile Client\n \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u25BC\n Resource API\n \u2502\n \u25BC\n Application Services\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this model, clients communicate with UAuthHub for the applicable authentication operations and access resource APIs using the supported credentials.\u003C/p\u003E\n\u003Cp\u003EResource APIs validate those credentials according to the configured authentication mode.\u003C/p\u003E\n\u003Cp\u003EThis architecture supports independently deployed applications while maintaining shared authentication policies and identity infrastructure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-a-topology\u0022\u003EChoosing a topology\u003C/h3\u003E\n\u003Cp\u003EIntegrated and distributed deployments are not different authentication modes.\u003C/p\u003E\n\u003Cp\u003EThey describe where application components execute and how they communicate.\u003C/p\u003E\n\u003Cp\u003EThe appropriate topology depends on:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EApplication boundaries.\u003C/li\u003E\n\u003Cli\u003EDeployment and operational requirements.\u003C/li\u003E\n\u003Cli\u003ENetwork and infrastructure constraints.\u003C/li\u003E\n\u003Cli\u003EAuthentication mode dependencies.\u003C/li\u003E\n\u003Cli\u003EService ownership and scaling requirements.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA distributed deployment is not inherently more secure or more scalable than an integrated deployment.\u003C/p\u003E\n\u003Cp\u003EBoth require correct authentication validation, authorization enforcement, and infrastructure configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-architecture\u0022\u003EBlazor Server architecture\u003C/h2\u003E\n\u003Cp\u003EBlazor Server has a distinct execution model.\u003C/p\u003E\n\u003Cp\u003EThe browser maintains an interactive connection to an application whose component logic executes on the server.\u003C/p\u003E\n\u003Cp\u003EThis makes it possible to keep many application operations and authentication-related services within the server environment.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBrowser\n \u2502\n \u2502 Interactive Connection\n \u25BC\nBlazor Server Application\n \u2502\n \u251C\u2500\u2500 UI Components\n \u2502\n \u251C\u2500\u2500 Application Services\n \u2502\n \u251C\u2500\u2500 UltimateAuth Integration\n \u2502\n \u2514\u2500\u2500 Protected Operations\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EPureOpaque is a natural default for this environment because it provides server-controlled authentication without requiring a separate access/refresh token lifecycle.\u003C/p\u003E\n\u003Cp\u003EHowever, the hosting model does not require PureOpaque exclusively.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-service-access\u0022\u003EDirect service access\u003C/h3\u003E\n\u003Cp\u003EWhen authentication infrastructure and application services are hosted in the same process, server-side code may be able to use registered services directly.\u003C/p\u003E\n\u003Cp\u003EThis can avoid unnecessary HTTP requests between components of the same application.\u003C/p\u003E\n\u003Cp\u003EThe distinction is between an application service call and a remote API request.\u003C/p\u003E\n\u003Cp\u003EA direct service call must not bypass security checks merely because it avoids HTTP.\u003C/p\u003E\n\u003Cp\u003EAuthorization requirements must still be enforced at the appropriate trusted boundary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022long-lived-interactive-connections\u0022\u003ELong-lived interactive connections\u003C/h3\u003E\n\u003Cp\u003EBlazor Server introduces an additional consideration: authentication state may change while an interactive circuit remains active.\u003C/p\u003E\n\u003Cp\u003EA session can expire or be revoked after the circuit was established.\u003C/p\u003E\n\u003Cp\u003EApplications must therefore account for authentication-state revalidation and authorization of sensitive operations.\u003C/p\u003E\n\u003Cp\u003EAn authenticated circuit must not be treated as permanently authorized solely because its initial connection succeeded.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-webassembly-architecture\u0022\u003EBlazor WebAssembly architecture\u003C/h2\u003E\n\u003Cp\u003EBlazor WebAssembly executes application code in the browser.\u003C/p\u003E\n\u003Cp\u003EUnlike Blazor Server, it cannot directly access private server-side authentication services.\u003C/p\u003E\n\u003Cp\u003EAuthentication and protected application operations therefore cross an HTTP boundary.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBrowser\n \u2502\n \u2514\u2500\u2500 Blazor WebAssembly\n \u2502\n \u251C\u2500\u2500 UltimateAuth Client\n \u2502 \u2502\n \u2502 \u25BC\n \u2502 UAuthHub\n \u2502\n \u2514\u2500\u2500 Application API Client\n \u2502\n \u25BC\n Resource API\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EHybrid is a suitable authentication strategy for applications that need separate access and refresh tokens while retaining server-authoritative session validation.\u003C/p\u003E\n\u003Cp\u003EHowever, a browser application can also use other modes when the corresponding transport and security architecture supports them.\u003C/p\u003E\n\u003Cp\u003EFor example, a backend-for-frontend architecture may use secure session cookies rather than exposing bearer tokens to browser application code.\u003C/p\u003E\n\u003Cp\u003EThe runtime determines which integration techniques are available; the authentication mode determines the security and lifecycle model.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-application-architecture\u0022\u003ENative application architecture\u003C/h2\u003E\n\u003Cp\u003ENative applications, including .NET MAUI applications, execute outside the browser environment.\u003C/p\u003E\n\u003Cp\u003EThey generally communicate with authentication hosts and resource APIs through HTTP.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EMAUI Application\n \u2502\n \u251C\u2500\u2500 UltimateAuth Client\n \u2502 \u2502\n \u2502 \u25BC\n \u2502 UAuthHub\n \u2502\n \u251C\u2500\u2500 Secure Credential Storage\n \u2502\n \u2514\u2500\u2500 Resource API Client\n \u2502\n \u25BC\n Resource API\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENative applications can use platform-specific secure storage for sensitive credentials.\u003C/p\u003E\n\u003Cp\u003ETheir credential delivery and persistence requirements differ from browser applications.\u003C/p\u003E\n\u003Cp\u003EHybrid can provide a suitable model for applications requiring refresh-token continuity and centralized session control.\u003C/p\u003E\n\u003Cp\u003EThe choice remains configurable according to the supported authentication modes and application requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022shared-components-across-runtimes\u0022\u003EShared components across runtimes\u003C/h2\u003E\n\u003Cp\u003EA unified authentication architecture should minimize unnecessary duplication between client environments.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth separates shared authentication behavior from runtime-specific integration.\u003C/p\u003E\n\u003Cp\u003EFor example, Blazor Server and Blazor WebAssembly applications may share:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication-related UI components.\u003C/li\u003E\n\u003Cli\u003ELogin and logout interaction patterns.\u003C/li\u003E\n\u003Cli\u003ERequest and response contracts.\u003C/li\u003E\n\u003Cli\u003EApplication-facing client abstractions.\u003C/li\u003E\n\u003Cli\u003EAuthentication-state presentation logic.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EAt the same time, they may require different implementations for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ECredential storage.\u003C/li\u003E\n\u003Cli\u003EHTTP communication.\u003C/li\u003E\n\u003Cli\u003EBrowser interaction.\u003C/li\u003E\n\u003Cli\u003EServer-side service access.\u003C/li\u003E\n\u003Cli\u003EAuthentication-state synchronization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe goal is not to force every runtime to execute identical code.\u003C/p\u003E\n\u003Cp\u003EThe goal is to share behavior and contracts where appropriate while preserving each runtime\u0027s security and execution requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022http-boundaries-and-direct-execution\u0022\u003EHTTP boundaries and direct execution\u003C/h2\u003E\n\u003Cp\u003EAn important architectural distinction is whether an operation crosses an HTTP boundary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022remote-execution\u0022\u003ERemote execution\u003C/h3\u003E\n\u003Cp\u003EA remote client communicates with an authentication host or resource API through HTTP.\u003C/p\u003E\n\u003Cp\u003EThe server must independently validate the request, credentials, and authorization requirements.\u003C/p\u003E\n\u003Cp\u003EClient-side checks are not sufficient.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022in-process-execution\u0022\u003EIn-process execution\u003C/h3\u003E\n\u003Cp\u003EAn application may host UltimateAuth services and protected application services within the same process.\u003C/p\u003E\n\u003Cp\u003EIn that case, some operations may use direct service calls instead of HTTP.\u003C/p\u003E\n\u003Cp\u003EThis can reduce serialization and network overhead.\u003C/p\u003E\n\u003Cp\u003EHowever, HTTP middleware and endpoint authorization attributes do not automatically execute during arbitrary direct service calls.\u003C/p\u003E\n\u003Cp\u003EThe application must ensure that equivalent security requirements are enforced through the appropriate service or authorization boundary.\u003C/p\u003E\n\u003Cp\u003EDirect execution is an optimization and integration choice, not permission to bypass authentication or authorization.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022infrastructure-and-persistence\u0022\u003EInfrastructure and persistence\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses abstractions to separate authentication behavior from infrastructure implementations.\u003C/p\u003E\n\u003Cp\u003EDepending on the configured mode and services, the system may require storage for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EUser and credential information.\u003C/li\u003E\n\u003Cli\u003EAuthentication security state.\u003C/li\u003E\n\u003Cli\u003ESession lineage.\u003C/li\u003E\n\u003Cli\u003ERefresh-token lifecycle.\u003C/li\u003E\n\u003Cli\u003EDevice-associated authentication state.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese dependencies vary by authentication mode.\u003C/p\u003E\n\u003Cp\u003EFor example, PureOpaque and Hybrid require session infrastructure for authentication.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid requires session infrastructure for lifecycle management but not for normal JWT validation.\u003C/p\u003E\n\u003Cp\u003EPureJwt does not require server-side session infrastructure. Optional refresh-token functionality may introduce independent renewal-state requirements.\u003C/p\u003E\n\u003Cp\u003EThe architecture must preserve these distinctions.\u003C/p\u003E\n\u003Cp\u003EInfrastructure abstractions allow the authentication services to remain independent of a particular persistence implementation, while the selected mode determines which capabilities are required.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022architectural-boundaries\u0022\u003EArchitectural boundaries\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s runtime architecture depends on several boundaries remaining explicit.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-and-server\u0022\u003EClient and server\u003C/h3\u003E\n\u003Cp\u003EClients initiate operations and present credentials.\u003C/p\u003E\n\u003Cp\u003EServers establish trusted authentication state and enforce security requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-and-authorization\u0022\u003EAuthentication and authorization\u003C/h3\u003E\n\u003Cp\u003EAuthentication determines identity.\u003C/p\u003E\n\u003Cp\u003EAuthorization determines whether an operation is permitted.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hosting-and-authentication-mode\u0022\u003EHosting and authentication mode\u003C/h3\u003E\n\u003Cp\u003EUAuthHub and resource applications describe hosting responsibilities.\u003C/p\u003E\n\u003Cp\u003EPureOpaque, Hybrid, SemiHybrid, and PureJwt describe authentication strategies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022shared-contracts-and-runtime-integration\u0022\u003EShared contracts and runtime integration\u003C/h3\u003E\n\u003Cp\u003EShared contracts define consistent behavior.\u003C/p\u003E\n\u003Cp\u003ERuntime integrations adapt that behavior to browser, native, and server-side environments.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022orchestration-and-infrastructure\u0022\u003EOrchestration and infrastructure\u003C/h3\u003E\n\u003Cp\u003EOrchestration coordinates authentication operations.\u003C/p\u003E\n\u003Cp\u003EInfrastructure services provide persistence, token operations, and other required capabilities.\u003C/p\u003E\n\u003Cp\u003EThese boundaries allow UltimateAuth to evolve without requiring every client integration or authentication mode to duplicate the complete authentication implementation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s runtime architecture separates authentication responsibilities from application hosting and client execution environments.\u003C/p\u003E\n\u003Cp\u003EIts main architectural components are:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ECore\u003C/strong\u003E, which defines shared contracts and authentication foundations.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EServer\u003C/strong\u003E, which implements authentication operations and lifecycle management.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient\u003C/strong\u003E, which provides application-facing authentication integration.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUAuthHub\u003C/strong\u003E, which hosts the authentication infrastructure.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EResource applications\u003C/strong\u003E, which authenticate callers and enforce authorization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese components can operate within an integrated application or across distributed services.\u003C/p\u003E\n\u003Cp\u003EDifferent client runtimes can share authentication contracts and behavior while using integration mechanisms appropriate to their environments.\u003C/p\u003E\n\u003Cp\u003EAuthentication modes determine the required validation and state dependencies.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe architecture is unified because its security contracts and responsibilities remain consistent\u2014not because every runtime, mode, or deployment follows an identical execution path.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-step\u0022\u003ENext step\u003C/h2\u003E\n\u003Cp\u003EContinue to \u003Ca href=\u0022/docs/fundamentals/request-lifecycle\u0022\u003ERequest Lifecycle\u003C/a\u003E to understand how an incoming request moves through authentication validation, identity establishment, and authorization before reaching a protected operation.\u003C/p\u003E\n", + "Html": "\n\u003Cp\u003EUltimateAuth is designed to provide a unified authentication architecture across different .NET application environments.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server application, a standalone Blazor WebAssembly application, a native MAUI application, and a resource API may have different execution models, but they should not require entirely separate authentication systems.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth addresses this through a separation between \u003Cstrong\u003Eauthentication infrastructure, client integration, hosting, and protected resources\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThis separation allows authentication behavior to remain consistent while adapting to the capabilities and responsibilities of each runtime.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022architectural-overview\u0022\u003EArchitectural overview\u003C/h2\u003E\n\u003Cp\u003EAt a high level, UltimateAuth consists of several cooperating layers:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ECore:\u003C/strong\u003E Shared authentication contracts, models, and foundational abstractions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EServer:\u003C/strong\u003E Authentication operations, security decisions, credential management, and persistence coordination.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient:\u003C/strong\u003E Client-side integration, authentication requests, and credential lifecycle handling.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUAuthHub:\u003C/strong\u003E The application hosting UltimateAuth\u0027s authentication endpoints and services.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EResource applications:\u003C/strong\u003E Applications and APIs that consume authenticated identity and enforce authorization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese are architectural responsibilities, not necessarily separate processes or deployments.\u003C/p\u003E\n\u003Cp\u003EA single application may host multiple responsibilities. Alternatively, they can be distributed across independently deployed services.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Application Clients\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 \u2502 \u2502\n Blazor WASM MAUI Other Clients\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u2502 HTTP\n \u25BC\n UAuthHub\n \u2502\n UltimateAuth Server\n \u2502\n Authentication Services\n \u2502\n Stores / Providers\n \u2502\n \u25BC\n Persistent State\n\n\n Protected Resources\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 \u2502 \u2502\n Resource API Web App Other Services\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n Authentication Validation\n \u2502\n Authorization\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis diagram illustrates the separation of responsibilities.\u003C/p\u003E\n\u003Cp\u003EIt does not imply that every authenticated resource request must pass through UAuthHub.\u003C/p\u003E\n\u003Cp\u003EWhether a protected resource needs to consult server-side authentication infrastructure depends on the effective authentication mode and its validation requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022core-shared-authentication-foundations\u0022\u003ECore: shared authentication foundations\u003C/h2\u003E\n\u003Cp\u003EThe Core layer defines the common concepts used throughout UltimateAuth.\u003C/p\u003E\n\u003Cp\u003EIts responsibility is to provide stable contracts and abstractions without depending on a particular client runtime or application host.\u003C/p\u003E\n\u003Cp\u003EThese foundations include concepts such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication modes.\u003C/li\u003E\n\u003Cli\u003EAuthentication and security contexts.\u003C/li\u003E\n\u003Cli\u003EAuthentication results and contracts.\u003C/li\u003E\n\u003Cli\u003EDomain models and shared abstractions.\u003C/li\u003E\n\u003Cli\u003ESecurity-related options and definitions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe Core layer provides the common vocabulary used by client integrations, server services, and other framework components.\u003C/p\u003E\n\u003Cp\u003EIt should not contain assumptions that authentication always occurs through an HTTP endpoint, a browser cookie, or a particular hosting model.\u003C/p\u003E\n\u003Cp\u003EThis separation is important because UltimateAuth supports both stateful and stateless authentication strategies.\u003C/p\u003E\n\u003Cp\u003EA shared authentication contract must not implicitly require session persistence when the selected mode does not use sessions.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-authentication-execution-and-lifecycle\u0022\u003EServer: authentication execution and lifecycle\u003C/h2\u003E\n\u003Cp\u003EThe Server layer implements the server-side authentication capabilities.\u003C/p\u003E\n\u003Cp\u003EIt coordinates the operations required to establish, continue, validate, and terminate authentication according to the effective mode and security policies.\u003C/p\u003E\n\u003Cp\u003EIts responsibilities include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication flow execution.\u003C/li\u003E\n\u003Cli\u003ECredential validation and management.\u003C/li\u003E\n\u003Cli\u003ESession and token lifecycle operations.\u003C/li\u003E\n\u003Cli\u003EAuthentication security decisions.\u003C/li\u003E\n\u003Cli\u003ECoordination with persistence providers.\u003C/li\u003E\n\u003Cli\u003ECredential issuance and validation.\u003C/li\u003E\n\u003Cli\u003EIntegration with server-side authorization infrastructure.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe Server layer contains multiple cooperating services rather than one universal authentication engine responsible for every decision.\u003C/p\u003E\n\u003Cp\u003EFor example, session lifecycle operations, credential verification, and authorization may follow different execution paths while sharing common security contracts.\u003C/p\u003E\n\u003Cp\u003EThe architecture separates orchestration from the underlying services that perform domain-specific work.\u003C/p\u003E\n\u003Cp\u003EFor the detailed execution pipeline, see \u003Ca href=\u0022/docs/auth-flows/overview\u0022\u003EAuth Flows\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-runtime-integration\u0022\u003EClient: runtime integration\u003C/h2\u003E\n\u003Cp\u003EThe Client layer provides the integration between an application and UltimateAuth\u0027s authentication services.\u003C/p\u003E\n\u003Cp\u003EIts purpose is to reduce the amount of authentication infrastructure that application developers need to implement themselves.\u003C/p\u003E\n\u003Cp\u003EDepending on the supported runtime and configuration, client integration may handle:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EInitiating authentication flows.\u003C/li\u003E\n\u003Cli\u003ECommunicating with UAuthHub.\u003C/li\u003E\n\u003Cli\u003EProcessing authentication outcomes.\u003C/li\u003E\n\u003Cli\u003EManaging supported credential delivery mechanisms.\u003C/li\u003E\n\u003Cli\u003ECoordinating authentication state with the application.\u003C/li\u003E\n\u003Cli\u003EIntegrating authenticated requests with protected resources.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe client SDK does not replace server-side authentication validation.\u003C/p\u003E\n\u003Cp\u003EIt provides an application-facing interface to the authentication infrastructure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-integration-is-runtime-aware\u0022\u003EClient integration is runtime-aware\u003C/h3\u003E\n\u003Cp\u003EDifferent client runtimes have different capabilities.\u003C/p\u003E\n\u003Cp\u003EA browser-based WebAssembly application executes within browser security restrictions.\u003C/p\u003E\n\u003Cp\u003EA native MAUI application has access to platform-specific capabilities.\u003C/p\u003E\n\u003Cp\u003EA Blazor Server application executes application logic on the server while maintaining an interactive connection with the browser.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth accounts for these differences through runtime-specific integrations and Application Profiles.\u003C/p\u003E\n\u003Cp\u003EThe authentication model remains shared even when the implementation of credential transport or application state differs.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/fundamentals/application-profiles\u0022\u003EApplication Profiles\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022uauthhub-the-authentication-host\u0022\u003EUAuthHub: the authentication host\u003C/h2\u003E\n\u003Cp\u003EUAuthHub is the application hosting UltimateAuth\u0027s server-side authentication infrastructure.\u003C/p\u003E\n\u003Cp\u003EIt provides the environment in which authentication endpoints and the required server services are available.\u003C/p\u003E\n\u003Cp\u003EDepending on the deployment, UAuthHub can be responsible for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAccepting authentication requests.\u003C/li\u003E\n\u003Cli\u003EResolving the applicable tenant and authentication context.\u003C/li\u003E\n\u003Cli\u003EExecuting authentication flows.\u003C/li\u003E\n\u003Cli\u003EManaging credentials and sessions.\u003C/li\u003E\n\u003Cli\u003EIssuing authentication credentials.\u003C/li\u003E\n\u003Cli\u003EApplying configured authentication policies.\u003C/li\u003E\n\u003Cli\u003EExposing the supported authentication endpoints.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EUAuthHub is a hosting role, not an authentication mode.\u003C/p\u003E\n\u003Cp\u003EA single UAuthHub can support multiple client environments and authentication strategies, subject to its configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022centralized-hosting\u0022\u003ECentralized hosting\u003C/h3\u003E\n\u003Cp\u003EIn a centralized deployment, several applications can use the same UAuthHub.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBlazor WASM Application \u2500\u2500\u2510\n \u2502\nMAUI Application \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u25BA UAuthHub\n \u2502 \u2502\nWeb Application \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n \u25BC\n Authentication Services\n \u2502\n \u25BC\n Authentication Storage\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis allows applications to share authentication infrastructure without requiring each application to implement its own credential management and authentication lifecycle.\u003C/p\u003E\n\u003Cp\u003EHowever, centralized authentication hosting does not mean that all protected resource requests must be routed through UAuthHub.\u003C/p\u003E\n\u003Cp\u003EThe resource authentication strategy remains mode-dependent.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-applications-and-apis\u0022\u003EResource applications and APIs\u003C/h2\u003E\n\u003Cp\u003EA resource application is an application or service that exposes functionality requiring authentication and authorization.\u003C/p\u003E\n\u003Cp\u003EExamples include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EA protected Web API.\u003C/li\u003E\n\u003Cli\u003EAn administrative web application.\u003C/li\u003E\n\u003Cli\u003EA business application backend.\u003C/li\u003E\n\u003Cli\u003EAn independently deployed service.\u003C/li\u003E\n\u003Cli\u003EA server-rendered application with protected operations.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA resource application must establish the caller\u0027s authenticated identity before allowing access to protected functionality.\u003C/p\u003E\n\u003Cp\u003EIt must then enforce the relevant authorization policies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-validation-depends-on-the-mode\u0022\u003EAuthentication validation depends on the mode\u003C/h3\u003E\n\u003Cp\u003EThe authentication mode determines how a resource application establishes the caller\u0027s authenticated identity.\u003C/p\u003E\n\u003Cp\u003EIn PureOpaque and Hybrid, the current Resource API implementation relies on remote session validation through UAuthHub.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient\n |\n | Session credential\n v\nResource API\n |\n | Remote session validation\n v\nUAuthHub\n |\n v\nSession infrastructure\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn PureJwt, the Resource API validates JWT access tokens locally using trusted verification keys and explicit token-validation configuration.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient\n |\n | JWT access token\n v\nResource API\n |\n v\nLocal JWT validation\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUAuthHub remains responsible for authentication flows, credential issuance, and refresh-token lifecycle management.\u003C/p\u003E\n\u003Cp\u003EA PureJwt Resource API does not need to contact UAuthHub for ordinary access-token validation.\u003C/p\u003E\n\u003Cp\u003EHybrid-aware JWT validation in separate Resource APIs is not yet implemented.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid remains a planned authentication mode.\u003C/p\u003E\n\u003Cp\u003EAuthentication mode selection therefore determines the resource application\u0027s infrastructure dependencies, revocation semantics, and authorization freshness guarantees.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-remains-local-to-the-protected-operation\u0022\u003EAuthorization remains local to the protected operation\u003C/h3\u003E\n\u003Cp\u003EAuthentication establishes who the caller is.\u003C/p\u003E\n\u003Cp\u003EAuthorization determines whether that caller may perform the requested operation.\u003C/p\u003E\n\u003Cp\u003EA valid authentication credential does not automatically grant permission to every resource.\u003C/p\u003E\n\u003Cp\u003EResource applications must continue to enforce their authorization requirements through the applicable framework and application policies.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth\u0027s authentication integration should preserve these boundaries rather than replacing resource authorization with client-side assumptions.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022deployment-topology\u0022\u003EDeployment topology\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates architectural responsibilities from physical deployment boundaries.\u003C/p\u003E\n\u003Cp\u003EThis means the same authentication architecture can support different deployment topologies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022integrated-deployment\u0022\u003EIntegrated deployment\u003C/h3\u003E\n\u003Cp\u003EAn integrated deployment hosts authentication infrastructure and application functionality within the same server application.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EASP.NET Core Application\n \u2502\n \u251C\u2500\u2500 UltimateAuth Server\n \u2502\n \u251C\u2500\u2500 Authentication Services\n \u2502\n \u251C\u2500\u2500 Application Services\n \u2502\n \u2514\u2500\u2500 Protected Endpoints\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this model, authentication services and protected application functionality may share the same dependency injection container and process.\u003C/p\u003E\n\u003Cp\u003EWhere supported, internal operations can interact with server-side services directly without requiring an HTTP call to the same application.\u003C/p\u003E\n\u003Cp\u003EThis can simplify deployment and avoid unnecessary network communication.\u003C/p\u003E\n\u003Cp\u003EHowever, direct service access must still respect the required authentication and authorization boundaries.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022distributed-deployment\u0022\u003EDistributed deployment\u003C/h3\u003E\n\u003Cp\u003EA distributed deployment separates the authentication host from one or more resource applications.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E UAuthHub\n \u2502\n \u2502 Authentication\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 \u2502\n Web Application Mobile Client\n \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u25BC\n Resource API\n \u2502\n \u25BC\n Application Services\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIn this model, clients communicate with UAuthHub for the applicable authentication operations and access resource APIs using the supported credentials.\u003C/p\u003E\n\u003Cp\u003EResource APIs validate those credentials according to the configured authentication mode.\u003C/p\u003E\n\u003Cp\u003EThis architecture supports independently deployed applications while maintaining shared authentication policies and identity infrastructure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-a-topology\u0022\u003EChoosing a topology\u003C/h3\u003E\n\u003Cp\u003EIntegrated and distributed deployments are not different authentication modes.\u003C/p\u003E\n\u003Cp\u003EThey describe where application components execute and how they communicate.\u003C/p\u003E\n\u003Cp\u003EThe appropriate topology depends on:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EApplication boundaries.\u003C/li\u003E\n\u003Cli\u003EDeployment and operational requirements.\u003C/li\u003E\n\u003Cli\u003ENetwork and infrastructure constraints.\u003C/li\u003E\n\u003Cli\u003EAuthentication mode dependencies.\u003C/li\u003E\n\u003Cli\u003EService ownership and scaling requirements.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA distributed deployment is not inherently more secure or more scalable than an integrated deployment.\u003C/p\u003E\n\u003Cp\u003EBoth require correct authentication validation, authorization enforcement, and infrastructure configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-architecture\u0022\u003EBlazor Server architecture\u003C/h2\u003E\n\u003Cp\u003EBlazor Server has a distinct execution model.\u003C/p\u003E\n\u003Cp\u003EThe browser maintains an interactive connection to an application whose component logic executes on the server.\u003C/p\u003E\n\u003Cp\u003EThis makes it possible to keep many application operations and authentication-related services within the server environment.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBrowser\n \u2502\n \u2502 Interactive Connection\n \u25BC\nBlazor Server Application\n \u2502\n \u251C\u2500\u2500 UI Components\n \u2502\n \u251C\u2500\u2500 Application Services\n \u2502\n \u251C\u2500\u2500 UltimateAuth Integration\n \u2502\n \u2514\u2500\u2500 Protected Operations\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EPureOpaque is a natural default for this environment because it provides server-controlled authentication without requiring a separate access/refresh token lifecycle.\u003C/p\u003E\n\u003Cp\u003EHowever, the hosting model does not require PureOpaque exclusively.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022direct-service-access\u0022\u003EDirect service access\u003C/h3\u003E\n\u003Cp\u003EWhen authentication infrastructure and application services are hosted in the same process, server-side code may be able to use registered services directly.\u003C/p\u003E\n\u003Cp\u003EThis can avoid unnecessary HTTP requests between components of the same application.\u003C/p\u003E\n\u003Cp\u003EThe distinction is between an application service call and a remote API request.\u003C/p\u003E\n\u003Cp\u003EA direct service call must not bypass security checks merely because it avoids HTTP.\u003C/p\u003E\n\u003Cp\u003EAuthorization requirements must still be enforced at the appropriate trusted boundary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022long-lived-interactive-connections\u0022\u003ELong-lived interactive connections\u003C/h3\u003E\n\u003Cp\u003EBlazor Server introduces an additional consideration: authentication state may change while an interactive circuit remains active.\u003C/p\u003E\n\u003Cp\u003EA session can expire or be revoked after the circuit was established.\u003C/p\u003E\n\u003Cp\u003EApplications must therefore account for authentication-state revalidation and authorization of sensitive operations.\u003C/p\u003E\n\u003Cp\u003EAn authenticated circuit must not be treated as permanently authorized solely because its initial connection succeeded.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-webassembly-architecture\u0022\u003EBlazor WebAssembly architecture\u003C/h2\u003E\n\u003Cp\u003EBlazor WebAssembly executes application code in the browser.\u003C/p\u003E\n\u003Cp\u003EUnlike Blazor Server, it cannot directly access private server-side authentication services.\u003C/p\u003E\n\u003Cp\u003EAuthentication and protected application operations therefore cross an HTTP boundary.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EBrowser\n \u2502\n \u2514\u2500\u2500 Blazor WebAssembly\n \u2502\n \u251C\u2500\u2500 UltimateAuth Client\n \u2502 \u2502\n \u2502 \u25BC\n \u2502 UAuthHub\n \u2502\n \u2514\u2500\u2500 Application API Client\n \u2502\n \u25BC\n Resource API\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EHybrid is a suitable authentication strategy for applications that need separate access and refresh tokens while retaining server-authoritative session validation.\u003C/p\u003E\n\u003Cp\u003EHowever, a browser application can also use other modes when the corresponding transport and security architecture supports them.\u003C/p\u003E\n\u003Cp\u003EFor example, a backend-for-frontend architecture may use secure session cookies rather than exposing bearer tokens to browser application code.\u003C/p\u003E\n\u003Cp\u003EThe runtime determines which integration techniques are available; the authentication mode determines the security and lifecycle model.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-application-architecture\u0022\u003ENative application architecture\u003C/h2\u003E\n\u003Cp\u003ENative applications, including .NET MAUI applications, execute outside the browser environment.\u003C/p\u003E\n\u003Cp\u003EThey generally communicate with authentication hosts and resource APIs through HTTP.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EMAUI Application\n \u2502\n \u251C\u2500\u2500 UltimateAuth Client\n \u2502 \u2502\n \u2502 \u25BC\n \u2502 UAuthHub\n \u2502\n \u251C\u2500\u2500 Secure Credential Storage\n \u2502\n \u2514\u2500\u2500 Resource API Client\n \u2502\n \u25BC\n Resource API\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENative applications can use platform-specific secure storage for sensitive credentials.\u003C/p\u003E\n\u003Cp\u003ETheir credential delivery and persistence requirements differ from browser applications.\u003C/p\u003E\n\u003Cp\u003EHybrid can provide a suitable model for applications requiring refresh-token continuity and centralized session control.\u003C/p\u003E\n\u003Cp\u003EThe choice remains configurable according to the supported authentication modes and application requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022shared-components-across-runtimes\u0022\u003EShared components across runtimes\u003C/h2\u003E\n\u003Cp\u003EA unified authentication architecture should minimize unnecessary duplication between client environments.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth separates shared authentication behavior from runtime-specific integration.\u003C/p\u003E\n\u003Cp\u003EFor example, Blazor Server and Blazor WebAssembly applications may share:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication-related UI components.\u003C/li\u003E\n\u003Cli\u003ELogin and logout interaction patterns.\u003C/li\u003E\n\u003Cli\u003ERequest and response contracts.\u003C/li\u003E\n\u003Cli\u003EApplication-facing client abstractions.\u003C/li\u003E\n\u003Cli\u003EAuthentication-state presentation logic.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EAt the same time, they may require different implementations for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ECredential storage.\u003C/li\u003E\n\u003Cli\u003EHTTP communication.\u003C/li\u003E\n\u003Cli\u003EBrowser interaction.\u003C/li\u003E\n\u003Cli\u003EServer-side service access.\u003C/li\u003E\n\u003Cli\u003EAuthentication-state synchronization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe goal is not to force every runtime to execute identical code.\u003C/p\u003E\n\u003Cp\u003EThe goal is to share behavior and contracts where appropriate while preserving each runtime\u0027s security and execution requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022http-boundaries-and-direct-execution\u0022\u003EHTTP boundaries and direct execution\u003C/h2\u003E\n\u003Cp\u003EAn important architectural distinction is whether an operation crosses an HTTP boundary.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022remote-execution\u0022\u003ERemote execution\u003C/h3\u003E\n\u003Cp\u003EA remote client communicates with an authentication host or resource API through HTTP.\u003C/p\u003E\n\u003Cp\u003EThe server must independently validate the request, credentials, and authorization requirements.\u003C/p\u003E\n\u003Cp\u003EClient-side checks are not sufficient.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022in-process-execution\u0022\u003EIn-process execution\u003C/h3\u003E\n\u003Cp\u003EAn application may host UltimateAuth services and protected application services within the same process.\u003C/p\u003E\n\u003Cp\u003EIn that case, some operations may use direct service calls instead of HTTP.\u003C/p\u003E\n\u003Cp\u003EThis can reduce serialization and network overhead.\u003C/p\u003E\n\u003Cp\u003EHowever, HTTP middleware and endpoint authorization attributes do not automatically execute during arbitrary direct service calls.\u003C/p\u003E\n\u003Cp\u003EThe application must ensure that equivalent security requirements are enforced through the appropriate service or authorization boundary.\u003C/p\u003E\n\u003Cp\u003EDirect execution is an optimization and integration choice, not permission to bypass authentication or authorization.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022infrastructure-and-persistence\u0022\u003EInfrastructure and persistence\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses abstractions to separate authentication behavior from infrastructure implementations.\u003C/p\u003E\n\u003Cp\u003EDepending on the configured mode and services, the system may require storage for:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EUser and credential information.\u003C/li\u003E\n\u003Cli\u003EAuthentication security state.\u003C/li\u003E\n\u003Cli\u003ESession lineage.\u003C/li\u003E\n\u003Cli\u003ERefresh-token lifecycle.\u003C/li\u003E\n\u003Cli\u003EDevice-associated authentication state.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese dependencies vary by authentication mode.\u003C/p\u003E\n\u003Cp\u003EFor example, PureOpaque and Hybrid require session infrastructure for authentication.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid requires session infrastructure for lifecycle management but not for normal JWT validation.\u003C/p\u003E\n\u003Cp\u003EPureJwt does not require server-side session infrastructure. Optional refresh-token functionality may introduce independent renewal-state requirements.\u003C/p\u003E\n\u003Cp\u003EThe architecture must preserve these distinctions.\u003C/p\u003E\n\u003Cp\u003EInfrastructure abstractions allow the authentication services to remain independent of a particular persistence implementation, while the selected mode determines which capabilities are required.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022architectural-boundaries\u0022\u003EArchitectural boundaries\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s runtime architecture depends on several boundaries remaining explicit.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-and-server\u0022\u003EClient and server\u003C/h3\u003E\n\u003Cp\u003EClients initiate operations and present credentials.\u003C/p\u003E\n\u003Cp\u003EServers establish trusted authentication state and enforce security requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-and-authorization\u0022\u003EAuthentication and authorization\u003C/h3\u003E\n\u003Cp\u003EAuthentication determines identity.\u003C/p\u003E\n\u003Cp\u003EAuthorization determines whether an operation is permitted.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hosting-and-authentication-mode\u0022\u003EHosting and authentication mode\u003C/h3\u003E\n\u003Cp\u003EUAuthHub and resource applications describe hosting responsibilities.\u003C/p\u003E\n\u003Cp\u003EPureOpaque, Hybrid, SemiHybrid, and PureJwt describe authentication strategies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022shared-contracts-and-runtime-integration\u0022\u003EShared contracts and runtime integration\u003C/h3\u003E\n\u003Cp\u003EShared contracts define consistent behavior.\u003C/p\u003E\n\u003Cp\u003ERuntime integrations adapt that behavior to browser, native, and server-side environments.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022orchestration-and-infrastructure\u0022\u003EOrchestration and infrastructure\u003C/h3\u003E\n\u003Cp\u003EOrchestration coordinates authentication operations.\u003C/p\u003E\n\u003Cp\u003EInfrastructure services provide persistence, token operations, and other required capabilities.\u003C/p\u003E\n\u003Cp\u003EThese boundaries allow UltimateAuth to evolve without requiring every client integration or authentication mode to duplicate the complete authentication implementation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022summary\u0022\u003ESummary\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s runtime architecture separates authentication responsibilities from application hosting and client execution environments.\u003C/p\u003E\n\u003Cp\u003EIts main architectural components are:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003ECore\u003C/strong\u003E, which defines shared contracts and authentication foundations.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EServer\u003C/strong\u003E, which implements authentication operations and lifecycle management.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EClient\u003C/strong\u003E, which provides application-facing authentication integration.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUAuthHub\u003C/strong\u003E, which hosts the authentication infrastructure.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EResource applications\u003C/strong\u003E, which authenticate callers and enforce authorization.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese components can operate within an integrated application or across distributed services.\u003C/p\u003E\n\u003Cp\u003EDifferent client runtimes can share authentication contracts and behavior while using integration mechanisms appropriate to their environments.\u003C/p\u003E\n\u003Cp\u003EAuthentication modes determine the required validation and state dependencies.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe architecture is unified because its security contracts and responsibilities remain consistent\u2014not because every runtime, mode, or deployment follows an identical execution path.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-step\u0022\u003ENext step\u003C/h2\u003E\n\u003Cp\u003EContinue to \u003Ca href=\u0022/docs/fundamentals/request-lifecycle\u0022\u003ERequest Lifecycle\u003C/a\u003E to understand how an incoming request moves through authentication validation, identity establishment, and authorization before reaching a protected operation.\u003C/p\u003E\n", "Headings": [ { "Id": "architectural-overview", @@ -164,6 +164,6 @@ "Level": 0 } ], - "SourceHash": "CBD1E21178F2B81FC43506CCED460A77C27FA446BE7D2A86015F5A8D04AC74D5", + "SourceHash": "6AE4FE8C07C29812F05664F335FBA7EAC2214D594C9ED806DCEC916EF71F5103", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/index.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/index.json index 3e8497ad..7750abce 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/index.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/index.json @@ -1,7 +1,7 @@ { "Slug": "getting-started/index", "Title": "Getting Started", - "Html": "\n\u003Cp\u003E\u003Cstrong\u003EModern authentication and authorization for .NET \u2014 built around a unified security lifecycle.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAuthentication starts with a login. But it doesn\u0027t end there.\u003C/p\u003E\n\u003Cp\u003EAs applications grow, they introduce new challenges: multiple clients, refresh tokens, device sessions, credential recovery, tenant isolation, permissions, and revocation. What begins as a simple login system can gradually become a collection of disconnected security mechanisms.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth takes a different approach.\u003C/p\u003E\n\u003Cp\u003EIt brings authentication, authorization, users, credentials, sessions, and client integration into \u003Cstrong\u003Eone coherent framework\u003C/strong\u003E, with a shared model for how security decisions are made and how authentication state changes over time.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EOne framework. Multiple client environments. A consistent security lifecycle.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EExplore the Source\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-ultimateauth\u0022\u003EWhy UltimateAuth?\u003C/h2\u003E\n\u003Cp\u003EMost applications don\u0027t struggle with generating an access token.\u003C/p\u003E\n\u003Cp\u003EThey struggle with everything that comes afterward.\u003C/p\u003E\n\u003Cp\u003EConsider an application that starts with a single web frontend. Eventually, it adds a mobile application, an administration panel, multiple organizations, and external APIs.\u003C/p\u003E\n\u003Cp\u003ESuddenly, authentication raises questions that a basic login implementation doesn\u0027t answer:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EHow should browser sessions and API tokens coexist?\u003C/li\u003E\n\u003Cli\u003ECan users see and revoke sessions associated with their devices?\u003C/li\u003E\n\u003Cli\u003EWhat happens to existing sessions after a password reset?\u003C/li\u003E\n\u003Cli\u003EHow do we prevent refresh token replay?\u003C/li\u003E\n\u003Cli\u003EHow do we enforce tenant boundaries consistently?\u003C/li\u003E\n\u003Cli\u003EHow do we keep authorization decisions separate from authentication?\u003C/li\u003E\n\u003Cli\u003ECan multiple application types use the same backend security model?\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese concerns are related. Implementing each independently makes the system harder to maintain, audit, and extend.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth is designed to manage these concerns as parts of the same security lifecycle.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-different-way-to-think-about-authentication\u0022\u003EA Different Way to Think About Authentication\u003C/h2\u003E\n\u003Cp\u003ETraditional authentication integration is often organized around credentials and their immediate results:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ECredentials\n \u2193\nValidate\n \u2193\nIssue Token\n \u2193\nAuthenticated\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThat sequence is necessary, but incomplete.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth approaches authentication as a longer-running lifecycle:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E UltimateAuth\n \u2502\n \u25BC\n Request Context\n Client \u00B7 Tenant \u00B7 Device\n \u2502\n \u25BC\n Authentication\n Validation \u00B7 Decisions\n \u2502\n \u25BC\n Security State\n User \u00B7 Root \u00B7 Chain \u00B7 Session\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC \u25BC\n Refresh Logout Revoke\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25BC\n Controlled State\n Transitions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis model makes it possible to reason about authentication beyond a single request.\u003C/p\u003E\n\u003Cp\u003ELogin establishes authentication. Refresh evaluates whether it may continue. Logout and revocation terminate authentication at the appropriate scope. Credential changes and security policies can affect existing sessions.\u003C/p\u003E\n\u003Cp\u003EThe result is a framework where these operations share a consistent security vocabulary.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-makes-ultimateauth-different\u0022\u003EWhat Makes UltimateAuth Different?\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003E\u003Cescape\u003E\u003C/escape\u003E\u003C/th\u003E\n\u003Cth\u003ECapability\u003C/th\u003E\n\u003Cth\u003EUltimateAuth\u0027s approach\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EUnified architecture\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication, sessions, users, credentials, and authorization share a common foundation\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EClient-aware behavior\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication can adapt to the application profile and effective server configuration\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ESession lifecycle\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ERoot, chain, and session concepts support different scopes of session management\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EFlow-driven execution\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication operations use explicit context, validation, decisions, and state transitions\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ECredential lifecycle\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential changes, recovery, and session invalidation are related security operations\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ETenant awareness\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant context participates in authentication and access decisions\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EModularity\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECore, Server, Client, and domain packages separate responsibilities\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ESelf-hosting\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EApplications can operate their own authentication infrastructure\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\n\u003Cp\u003EUltimateAuth does not claim that tokens, sessions, PKCE, or policy-based authorization are new concepts.\u003C/p\u003E\n\u003Cp\u003EIts value is in \u003Cstrong\u003Ebringing established security concepts together under a consistent architecture\u003C/strong\u003E, rather than requiring every application to connect them independently.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022one-security-model-across-different-clients\u0022\u003EOne Security Model Across Different Clients\u003C/h2\u003E\n\u003Cp\u003EA browser application, a server-rendered application, and a native client have different security constraints.\u003C/p\u003E\n\u003Cp\u003EThey should not necessarily use identical credential storage, transport, or authentication flows.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth separates the common authentication model from client-specific integration.\u003C/p\u003E\n\u003Cp\u003E\u003Cescape\u003E\u0060\u0060\u0060text\nYour .NET Applications\u003C/escape\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode\u003EBlazor Server Blazor WebAssembly\n \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n UltimateAuth Client\n \u2502\n \u25BC\n UltimateAuth Server\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC \u25BC\n Users Sessions Authorization\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25BC\n Shared Security\n Lifecycle\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003E\u0026LT;/ESCAPE\u0026GT;\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-\u0026lt;/escape\u0026gt;\u0022\u003E\nThe architecture also provides foundations for .NET MAUI, traditional ASP.NET Core applications, and API-oriented integrations.\n\n**Support depends on the client adapter and authentication modes available in the installed version.** A supported architectural profile should not be confused with a fully released platform adapter.\n\nThe goal is to share authentication concepts without pretending that all clients have the same trust boundaries.\n\n## Sessions Are More Than Tokens\n\nOne of UltimateAuth\u0027s central concepts is its stateful session hierarchy.\n\n\u0060\u0060\u0060text\nUser\n \u2514\u2500\u2500 Root\n \u251C\u2500\u2500 Chain \u2014 Browser A\n \u2502 \u251C\u2500\u2500 Session\n \u2502 \u2514\u2500\u2500 Session\n \u2502\n \u2514\u2500\u2500 Chain \u2014 Device B\n \u251C\u2500\u2500 Session\n \u2514\u2500\u2500 Session\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEach level represents a different security scope.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ERoot\u003C/strong\u003E represents a broader authentication security boundary.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EChain\u003C/strong\u003E represents the continuity of authentication associated with a device or client context.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession\u003C/strong\u003E represents an individual authentication instance within that chain.\u003C/p\u003E\n\u003Cp\u003EThis distinction makes several operations easier to express:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EEnd the current session.\u003C/li\u003E\n\u003Cli\u003ERevoke a particular device-associated chain.\u003C/li\u003E\n\u003Cli\u003ERevoke other active chains while preserving the current one.\u003C/li\u003E\n\u003Cli\u003ERevoke a broader authentication scope after a security-sensitive event.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA token is a credential used to access the system. It is not necessarily the complete record of the user\u0027s authentication lifecycle.\u003C/p\u003E\n\u003Cp\u003EThe hierarchy applies to session-backed authentication modes; different modes can have different persistence and validation characteristics.\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EExplore Session Management\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-flows-not-disconnected-endpoints\u0022\u003EAuthentication Flows, Not Disconnected Endpoints\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth organizes security-sensitive operations around explicit flows.\u003C/p\u003E\n\u003Cp\u003EA flow can combine:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003ERequest and tenant context.\u003C/li\u003E\n\u003Cli\u003EUser, credential, and session resolution.\u003C/li\u003E\n\u003Cli\u003EInput and security validation.\u003C/li\u003E\n\u003Cli\u003EAuthorization and authority decisions.\u003C/li\u003E\n\u003Cli\u003EControlled state transitions.\u003C/li\u003E\n\u003Cli\u003EClient-appropriate results and responses.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ERequest\n \u2193\nAuthFlowContext\n \u2193\nValidation\n \u2193\nSecurity Decision\n \u2193\nExecution\n \u2193\nState Transition\n \u2193\nResponse\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis approach provides a consistent place for security rules to be evaluated.\u003C/p\u003E\n\u003Cp\u003EIt also makes individual operations easier to test and inspect because the important decisions are part of an explicit execution model.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe purpose is not abstraction for its own sake. It is to make authentication behavior understandable and predictable.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-continues-after-login\u0022\u003ESecurity Continues After Login\u003C/h2\u003E\n\u003Cp\u003EA secure authentication system must account for events that happen after a user signs in.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EEvent\u003C/th\u003E\n\u003Cth\u003EUltimateAuth concept\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA user signs in\u003C/td\u003E\n\u003Ctd\u003ELogin flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA session needs renewal\u003C/td\u003E\n\u003Ctd\u003ERefresh flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA user signs out\u003C/td\u003E\n\u003Ctd\u003ELogout flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA device should lose access\u003C/td\u003E\n\u003Ctd\u003EChain revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA credential is changed\u003C/td\u003E\n\u003Ctd\u003ECredential lifecycle and session policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAn account is recovered\u003C/td\u003E\n\u003Ctd\u003ERecovery proof and session invalidation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA user requests a protected resource\u003C/td\u003E\n\u003Ctd\u003EAuthorization decision\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA request targets a tenant\u003C/td\u003E\n\u003Ctd\u003ETenant-aware security context\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThis is why UltimateAuth treats session management, credential management, and authorization as connected parts of the system.\u003C/p\u003E\n\u003Cp\u003EFor example, a password reset is not simply a database update. It can also affect the validity of existing authentication sessions according to the configured credential session policy.\u003C/p\u003E\n\u003Cp\u003ESimilarly, logout and revocation are not interchangeable operations. They have different scopes and consequences.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-and-authorization-together\u0022\u003EAuthentication and Authorization Together\u003C/h2\u003E\n\u003Cp\u003EKnowing who a user is does not determine what that user is allowed to do.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth separates authentication from authorization while keeping them within the same overall security architecture.\u003C/p\u003E\n\u003Cp\u003EAuthentication establishes identity and applicable security context.\u003C/p\u003E\n\u003Cp\u003EAuthorization evaluates whether an actor may perform an action on a resource.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EActor: Authenticated user\nAction: update\nResource: products\nResult: Allowed or Denied\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERoles and permissions can be managed through the authorization domain, while the server remains responsible for enforcing access decisions.\u003C/p\u003E\n\u003Cp\u003EThis separation helps applications avoid spreading authorization logic across UI components, controllers, and unrelated service methods.\u003C/p\u003E\n\u003Cp\u003EClient-side authorization checks can improve the interface, but \u003Cstrong\u003Eserver-side enforcement remains the security boundary\u003C/strong\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022tenant-aware-by-design\u0022\u003ETenant-Aware by Design\u003C/h2\u003E\n\u003Cp\u003EMulti-tenant authentication involves more than adding a tenant identifier to a user record.\u003C/p\u003E\n\u003Cp\u003EA request must be interpreted within the correct tenant context, and security operations must respect that boundary.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides tenant resolution and propagation mechanisms that participate in its request and flow infrastructure.\u003C/p\u003E\n\u003Cp\u003EThis allows applications to build tenant-aware authentication and authorization behavior without treating tenancy as an unrelated afterthought.\u003C/p\u003E\n\u003Cp\u003ETenant context must still be configured correctly, and a client-supplied tenant identifier is never sufficient proof of authorization.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022modular-without-becoming-fragmented\u0022\u003EModular Without Becoming Fragmented\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is divided into packages with distinct responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EPackage or domain\u003C/th\u003E\n\u003Cth\u003EResponsibility\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ECore\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EShared contracts, domain concepts, and authentication foundations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EServer\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication execution, runtime configuration, and server integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EClient\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EPlatform-independent authentication and domain APIs\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EClient.Blazor\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor-specific transport, storage, and authentication state integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EUsers\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EUser lifecycle, profiles, and identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ECredentials\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential operations, changes, and recovery\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EAuthorization\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ERoles, permissions, and access checks\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EPolicies\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EApplication access policy integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThis structure supports both a straightforward integration experience and deeper customization where the application requires it.\u003C/p\u003E\n\u003Cp\u003EDevelopers can begin with the public registration and client APIs without first learning every internal service.\u003C/p\u003E\n\u003Cp\u003EWhen necessary, they can explore the underlying flows, policies, stores, and extension points.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022designed-for-practical.net-development\u0022\u003EDesigned for Practical .NET Development\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is intended to fit naturally into .NET applications.\u003C/p\u003E\n\u003Cp\u003EA server application begins by registering UltimateAuth and configuring the security behavior it needs:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.CredentialSessionPolicy.OnRecovery = CredentialSessionBehavior.RevokeAll;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA Blazor application registers the client adapter:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese examples illustrate the configuration entry points rather than a complete application setup.\u003C/p\u003E\n\u003Cp\u003EThe server and client have different responsibilities, and a complete deployment also needs the appropriate hosting, persistence, transport, and authentication integration.\u003C/p\u003E\n\u003Cp\u003EThe important idea is that common behavior is configured through structured options rather than scattered application-specific code.\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EStart with QuickStart\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022who-is-ultimateauth-for\u0022\u003EWho Is UltimateAuth For?\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is particularly relevant if you are building:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EA Blazor application\u003C/strong\u003E that needs authentication and authorization integrated with its hosting model.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA multi-client .NET system\u003C/strong\u003E where different frontends should share the same authentication backend.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EAn application with device-aware sessions\u003C/strong\u003E where users or administrators need control over active authentication.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA multi-tenant platform\u003C/strong\u003E with explicit tenant resolution and security boundaries.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA security-sensitive application\u003C/strong\u003E that requires controlled refresh, credential recovery, and revocation behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA self-hosted system\u003C/strong\u003E where the team wants visibility into and control over its authentication infrastructure.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003E\u003Cstrong\u003EFrom a simple login page to a complex authentication platform, UltimateAuth is designed to make getting started easy without limiting what comes next.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EYou shouldn\u0027t need to understand an entire identity framework just to add authentication to a small .NET application. And you shouldn\u0027t need to replace your authentication system when that application grows.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth is built for both.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022simple-applications.simple-beginnings\u0022\u003ESimple Applications. Simple Beginnings.\u003C/h3\u003E\n\u003Cp\u003EFor a small application, authentication should be straightforward.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth aims to provide a lightweight integration experience with clear configuration, sensible defaults, and ready-to-use authentication flows.\u003C/p\u003E\n\u003Cp\u003EInstead of requiring developers to assemble numerous identity components before they can begin, UltimateAuth provides a cohesive foundation that can be configured through a small number of well-defined entry points.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EStart with what you need. You don\u0027t have to configure everything the framework supports.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022complex-applications.room-to-grow\u0022\u003EComplex Applications. Room to Grow.\u003C/h3\u003E\n\u003Cp\u003EWhen requirements become more demanding, the same framework provides a deeper security architecture.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth is particularly useful for applications requiring multiple client types, device-aware session management, tenant isolation, advanced authorization, credential recovery, controlled refresh, and targeted revocation.\u003C/p\u003E\n\u003Cp\u003EIts modular architecture, explicit authentication flows, configurable policies, and extension points allow developers to introduce additional capabilities without abandoning the original authentication foundation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe complexity of your application should not determine how difficult authentication is to begin with.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022one-framework-for-both\u0022\u003EOne Framework for Both\u003C/h3\u003E\n\u003Cp\u003EWhether you\u0027re building a small personal project, a business application, a SaaS platform, or a larger distributed system, UltimateAuth follows the same principle:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EEasy to start. Powerful when needed. Consistent as you grow.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EYou can begin with a straightforward authentication setup and progressively adopt the capabilities your application actually requires.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth can also serve smaller applications, but its architecture becomes especially valuable when authentication requirements extend beyond a basic login form.\u003C/p\u003E\n\u003Cp\u003EIf your application only needs a minimal authentication mechanism, evaluate whether UltimateAuth\u0027s broader lifecycle model provides enough value for your use case.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022current-scope-and-maturity\u0022\u003ECurrent Scope and Maturity\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is an evolving open-source framework.\u003C/p\u003E\n\u003Cp\u003EIts architecture covers several authentication models and client environments, but not every designed capability is necessarily available in the current release.\u003C/p\u003E\n\u003Cp\u003EIn particular:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication mode availability must be checked against the current server implementation.\u003C/li\u003E\n\u003Cli\u003EClient adapter availability varies by platform.\u003C/li\u003E\n\u003Cli\u003ESome advanced session and device policy options may be reserved for future enforcement.\u003C/li\u003E\n\u003Cli\u003EProduction adoption requires appropriate configuration, persistence, deployment security, and testing.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe documentation distinguishes supported behavior from planned or partially implemented capabilities.\u003C/p\u003E\n\u003Cp\u003EThis matters because a trustworthy authentication framework should be clear not only about what it can do, but also about its current limits.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022open-source-first.self-hosted-by-design\u0022\u003EOpen Source First. Self-Hosted by Design.\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is developed as an open-source project with self-hosting at its foundation.\u003C/p\u003E\n\u003Cp\u003EThe project\u0027s direction is to keep self-hosted authentication free, while a potential managed hosting service could provide an alternative for teams that prefer not to operate the infrastructure themselves.\u003C/p\u003E\n\u003Cp\u003EThe intention is not to divide authentication capabilities into free and paid feature tiers.\u003C/p\u003E\n\u003Cp\u003EIt is to make the framework accessible, inspectable, extensible, and useful to the .NET community.\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EView UltimateAuth on GitHub\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choose-your-starting-point\u0022\u003EChoose Your Starting Point\u003C/h2\u003E\n\u003Cp\u003EYou do not need to understand the entire architecture before building your first application.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EI want to\u2026\u003C/th\u003E\n\u003Cth\u003EStart here\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESet up UltimateAuth for the first time\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EQuickStart\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUnderstand how authentication works internally\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/auth-flows/overview\u0022\u003EAuth Flows\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EConfigure session, token, and security behavior\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/configuration/server-options\u0022\u003EServer Options\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EIntegrate authentication into a Blazor application\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUnderstand the source code and contribute\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EGitHub Repository\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Chr\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-is-a-lifecycle-not-a-login-endpoint\u0022\u003EAuthentication is a lifecycle, not a login endpoint.\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth brings together the concepts needed to establish, maintain, evaluate, and terminate authentication within a consistent .NET architecture.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EStart simple. Understand the security model. Extend when you need to.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EContinue to QuickStart\u003C/a\u003E\u003C/p\u003E\n", + "Html": "\n\u003Cp\u003E\u003Cstrong\u003EModern authentication and authorization for .NET \u2014 built around a unified security lifecycle.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EAuthentication starts with a login. But it doesn\u0027t end there.\u003C/p\u003E\n\u003Cp\u003EAs applications grow, they introduce new challenges: multiple clients, refresh tokens, device sessions, credential recovery, tenant isolation, permissions, and revocation. What begins as a simple login system can gradually become a collection of disconnected security mechanisms.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth takes a different approach.\u003C/p\u003E\n\u003Cp\u003EIt brings authentication, authorization, users, credentials, sessions, and client integration into \u003Cstrong\u003Eone coherent framework\u003C/strong\u003E, with a shared model for how security decisions are made and how authentication state changes over time.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EOne framework. Multiple client environments. A consistent security lifecycle.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EExplore the Source\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-ultimateauth\u0022\u003EWhy UltimateAuth?\u003C/h2\u003E\n\u003Cp\u003EMost applications don\u0027t struggle with generating an access token.\u003C/p\u003E\n\u003Cp\u003EThey struggle with everything that comes afterward.\u003C/p\u003E\n\u003Cp\u003EConsider an application that starts with a single web frontend. Eventually, it adds a mobile application, an administration panel, multiple organizations, and external APIs.\u003C/p\u003E\n\u003Cp\u003ESuddenly, authentication raises questions that a basic login implementation doesn\u0027t answer:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EHow should browser sessions and API tokens coexist?\u003C/li\u003E\n\u003Cli\u003ECan users see and revoke sessions associated with their devices?\u003C/li\u003E\n\u003Cli\u003EWhat happens to existing sessions after a password reset?\u003C/li\u003E\n\u003Cli\u003EHow do we prevent refresh token replay?\u003C/li\u003E\n\u003Cli\u003EHow do we enforce tenant boundaries consistently?\u003C/li\u003E\n\u003Cli\u003EHow do we keep authorization decisions separate from authentication?\u003C/li\u003E\n\u003Cli\u003ECan multiple application types use the same backend security model?\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese concerns are related. Implementing each independently makes the system harder to maintain, audit, and extend.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth is designed to manage these concerns as parts of the same security lifecycle.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-different-way-to-think-about-authentication\u0022\u003EA Different Way to Think About Authentication\u003C/h2\u003E\n\u003Cp\u003ETraditional authentication integration is often organized around credentials and their immediate results:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ECredentials\n \u2193\nValidate\n \u2193\nIssue Token\n \u2193\nAuthenticated\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThat sequence is necessary, but incomplete.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth approaches authentication as a longer-running lifecycle:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E UltimateAuth\n \u2502\n \u25BC\n Request Context\n Client \u00B7 Tenant \u00B7 Device\n \u2502\n \u25BC\n Authentication\n Validation \u00B7 Decisions\n \u2502\n \u25BC\n Security State\n User \u00B7 Root \u00B7 Chain \u00B7 Session\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC \u25BC\n Refresh Logout Revoke\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25BC\n Controlled State\n Transitions\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis model makes it possible to reason about authentication beyond a single request.\u003C/p\u003E\n\u003Cp\u003ELogin establishes authentication. Refresh evaluates whether it may continue. Logout and revocation terminate authentication at the appropriate scope. Credential changes and security policies can affect existing sessions.\u003C/p\u003E\n\u003Cp\u003EThe result is a framework where these operations share a consistent security vocabulary.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-makes-ultimateauth-different\u0022\u003EWhat Makes UltimateAuth Different?\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003E\u003Cescape\u003E\u003C/escape\u003E\u003C/th\u003E\n\u003Cth\u003ECapability\u003C/th\u003E\n\u003Cth\u003EUltimateAuth\u0027s approach\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EUnified architecture\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication, sessions, users, credentials, and authorization share a common foundation\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EClient-aware behavior\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication can adapt to the application profile and effective server configuration\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ESession lifecycle\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ERoot, chain, and session concepts support different scopes of session management\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EFlow-driven execution\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication operations use explicit context, validation, decisions, and state transitions\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ECredential lifecycle\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential changes, recovery, and session invalidation are related security operations\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ETenant awareness\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ETenant context participates in authentication and access decisions\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EModularity\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECore, Server, Client, and domain packages separate responsibilities\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ESelf-hosting\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EApplications can operate their own authentication infrastructure\u003C/td\u003E\n\u003Ctd\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\n\u003Cp\u003EUltimateAuth does not claim that tokens, sessions, PKCE, or policy-based authorization are new concepts.\u003C/p\u003E\n\u003Cp\u003EIts value is in \u003Cstrong\u003Ebringing established security concepts together under a consistent architecture\u003C/strong\u003E, rather than requiring every application to connect them independently.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022one-security-model-across-different-clients\u0022\u003EOne Security Model Across Different Clients\u003C/h2\u003E\n\u003Cp\u003EA browser application, a server-rendered application, and a native client have different security constraints.\u003C/p\u003E\n\u003Cp\u003EThey should not necessarily use identical credential storage, transport, or authentication flows.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth separates the common authentication model from client-specific integration.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Your .NET Applications\n\n Blazor Server Blazor WebAssembly\n \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n UltimateAuth Client\n \u2502\n \u25BC\n UltimateAuth Server\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC \u25BC\n Users Sessions Authorization\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u25BC\n Shared Security\n Lifecycle\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe architecture also provides foundations for .NET MAUI, traditional ASP.NET Core applications, and API-oriented integrations.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESupport depends on the client adapter and authentication modes available in the installed version.\u003C/strong\u003E A supported architectural profile should not be confused with a fully released platform adapter.\u003C/p\u003E\n\u003Cp\u003EThe goal is to share authentication concepts without pretending that all clients have the same trust boundaries.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022sessions-are-more-than-tokens\u0022\u003ESessions Are More Than Tokens\u003C/h2\u003E\n\u003Cp\u003EOne of UltimateAuth\u0027s central concepts is its stateful session hierarchy.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUser\n \u2514\u2500\u2500 Root\n \u251C\u2500\u2500 Chain \u2014 Browser A\n \u2502 \u251C\u2500\u2500 Session\n \u2502 \u2514\u2500\u2500 Session\n \u2502\n \u2514\u2500\u2500 Chain \u2014 Device B\n \u251C\u2500\u2500 Session\n \u2514\u2500\u2500 Session\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEach level represents a different security scope.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ERoot\u003C/strong\u003E represents a broader authentication security boundary.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EChain\u003C/strong\u003E represents the continuity of authentication associated with a device or client context.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ESession\u003C/strong\u003E represents an individual authentication instance within that chain.\u003C/p\u003E\n\u003Cp\u003EThis distinction makes several operations easier to express:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EEnd the current session.\u003C/li\u003E\n\u003Cli\u003ERevoke a particular device-associated chain.\u003C/li\u003E\n\u003Cli\u003ERevoke other active chains while preserving the current one.\u003C/li\u003E\n\u003Cli\u003ERevoke a broader authentication scope after a security-sensitive event.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA token is a credential used to access the system. It is not necessarily the complete record of the user\u0027s authentication lifecycle.\u003C/p\u003E\n\u003Cp\u003EThe hierarchy applies to session-backed authentication modes; different modes can have different persistence and validation characteristics.\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EExplore Session Management\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-flows-not-disconnected-endpoints\u0022\u003EAuthentication Flows, Not Disconnected Endpoints\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth organizes security-sensitive operations around explicit flows.\u003C/p\u003E\n\u003Cp\u003EA flow can combine:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003ERequest and tenant context.\u003C/li\u003E\n\u003Cli\u003EUser, credential, and session resolution.\u003C/li\u003E\n\u003Cli\u003EInput and security validation.\u003C/li\u003E\n\u003Cli\u003EAuthorization and authority decisions.\u003C/li\u003E\n\u003Cli\u003EControlled state transitions.\u003C/li\u003E\n\u003Cli\u003EClient-appropriate results and responses.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ERequest\n \u2193\nAuthFlowContext\n \u2193\nValidation\n \u2193\nSecurity Decision\n \u2193\nExecution\n \u2193\nState Transition\n \u2193\nResponse\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis approach provides a consistent place for security rules to be evaluated.\u003C/p\u003E\n\u003Cp\u003EIt also makes individual operations easier to test and inspect because the important decisions are part of an explicit execution model.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe purpose is not abstraction for its own sake. It is to make authentication behavior understandable and predictable.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-continues-after-login\u0022\u003ESecurity Continues After Login\u003C/h2\u003E\n\u003Cp\u003EA secure authentication system must account for events that happen after a user signs in.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EEvent\u003C/th\u003E\n\u003Cth\u003EUltimateAuth concept\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA user signs in\u003C/td\u003E\n\u003Ctd\u003ELogin flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA session needs renewal\u003C/td\u003E\n\u003Ctd\u003ERefresh flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA user signs out\u003C/td\u003E\n\u003Ctd\u003ELogout flow\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA device should lose access\u003C/td\u003E\n\u003Ctd\u003EChain revocation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA credential is changed\u003C/td\u003E\n\u003Ctd\u003ECredential lifecycle and session policy\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAn account is recovered\u003C/td\u003E\n\u003Ctd\u003ERecovery proof and session invalidation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA user requests a protected resource\u003C/td\u003E\n\u003Ctd\u003EAuthorization decision\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA request targets a tenant\u003C/td\u003E\n\u003Ctd\u003ETenant-aware security context\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThis is why UltimateAuth treats session management, credential management, and authorization as connected parts of the system.\u003C/p\u003E\n\u003Cp\u003EFor example, a password reset is not simply a database update. It can also affect the validity of existing authentication sessions according to the configured credential session policy.\u003C/p\u003E\n\u003Cp\u003ESimilarly, logout and revocation are not interchangeable operations. They have different scopes and consequences.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-and-authorization-together\u0022\u003EAuthentication and Authorization Together\u003C/h2\u003E\n\u003Cp\u003EKnowing who a user is does not determine what that user is allowed to do.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth separates authentication from authorization while keeping them within the same overall security architecture.\u003C/p\u003E\n\u003Cp\u003EAuthentication establishes identity and applicable security context.\u003C/p\u003E\n\u003Cp\u003EAuthorization evaluates whether an actor may perform an action on a resource.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EActor: Authenticated user\nAction: update\nResource: products\nResult: Allowed or Denied\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERoles and permissions can be managed through the authorization domain, while the server remains responsible for enforcing access decisions.\u003C/p\u003E\n\u003Cp\u003EThis separation helps applications avoid spreading authorization logic across UI components, controllers, and unrelated service methods.\u003C/p\u003E\n\u003Cp\u003EClient-side authorization checks can improve the interface, but \u003Cstrong\u003Eserver-side enforcement remains the security boundary\u003C/strong\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022tenant-aware-by-design\u0022\u003ETenant-Aware by Design\u003C/h2\u003E\n\u003Cp\u003EMulti-tenant authentication involves more than adding a tenant identifier to a user record.\u003C/p\u003E\n\u003Cp\u003EA request must be interpreted within the correct tenant context, and security operations must respect that boundary.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides tenant resolution and propagation mechanisms that participate in its request and flow infrastructure.\u003C/p\u003E\n\u003Cp\u003EThis allows applications to build tenant-aware authentication and authorization behavior without treating tenancy as an unrelated afterthought.\u003C/p\u003E\n\u003Cp\u003ETenant context must still be configured correctly, and a client-supplied tenant identifier is never sufficient proof of authorization.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022modular-without-becoming-fragmented\u0022\u003EModular Without Becoming Fragmented\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is divided into packages with distinct responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EPackage or domain\u003C/th\u003E\n\u003Cth\u003EResponsibility\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ECore\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EShared contracts, domain concepts, and authentication foundations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EServer\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthentication execution, runtime configuration, and server integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EClient\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EPlatform-independent authentication and domain APIs\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EClient.Blazor\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor-specific transport, storage, and authentication state integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EUsers\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EUser lifecycle, profiles, and identifiers\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ECredentials\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECredential operations, changes, and recovery\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EAuthorization\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ERoles, permissions, and access checks\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EPolicies\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EApplication access policy integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThis structure supports both a straightforward integration experience and deeper customization where the application requires it.\u003C/p\u003E\n\u003Cp\u003EDevelopers can begin with the public registration and client APIs without first learning every internal service.\u003C/p\u003E\n\u003Cp\u003EWhen necessary, they can explore the underlying flows, policies, stores, and extension points.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022designed-for-practical.net-development\u0022\u003EDesigned for Practical .NET Development\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is intended to fit naturally into .NET applications.\u003C/p\u003E\n\u003Cp\u003EA server application begins by registering UltimateAuth and configuring the security behavior it needs:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.CredentialSessionPolicy.OnRecovery = CredentialSessionBehavior.RevokeAll;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA Blazor application registers the client adapter:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.AutoDetectApplicationProfile = true;\n options.Endpoints.BasePath = \u0026quot;/auth\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese examples illustrate the configuration entry points rather than a complete application setup.\u003C/p\u003E\n\u003Cp\u003EThe server and client have different responsibilities, and a complete deployment also needs the appropriate hosting, persistence, transport, and authentication integration.\u003C/p\u003E\n\u003Cp\u003EThe important idea is that common behavior is configured through structured options rather than scattered application-specific code.\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EStart with QuickStart\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022who-is-ultimateauth-for\u0022\u003EWho Is UltimateAuth For?\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is particularly relevant if you are building:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EA Blazor application\u003C/strong\u003E that needs authentication and authorization integrated with its hosting model.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA multi-client .NET system\u003C/strong\u003E where different frontends should share the same authentication backend.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EAn application with device-aware sessions\u003C/strong\u003E where users or administrators need control over active authentication.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA multi-tenant platform\u003C/strong\u003E with explicit tenant resolution and security boundaries.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA security-sensitive application\u003C/strong\u003E that requires controlled refresh, credential recovery, and revocation behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EA self-hosted system\u003C/strong\u003E where the team wants visibility into and control over its authentication infrastructure.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003E\u003Cstrong\u003EFrom a simple login page to a complex authentication platform, UltimateAuth is designed to make getting started easy without limiting what comes next.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EYou shouldn\u0027t need to understand an entire identity framework just to add authentication to a small .NET application. And you shouldn\u0027t need to replace your authentication system when that application grows.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth is built for both.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022simple-applications.simple-beginnings\u0022\u003ESimple Applications. Simple Beginnings.\u003C/h3\u003E\n\u003Cp\u003EFor a small application, authentication should be straightforward.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth aims to provide a lightweight integration experience with clear configuration, sensible defaults, and ready-to-use authentication flows.\u003C/p\u003E\n\u003Cp\u003EInstead of requiring developers to assemble numerous identity components before they can begin, UltimateAuth provides a cohesive foundation that can be configured through a small number of well-defined entry points.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EStart with what you need. You don\u0027t have to configure everything the framework supports.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022complex-applications.room-to-grow\u0022\u003EComplex Applications. Room to Grow.\u003C/h3\u003E\n\u003Cp\u003EWhen requirements become more demanding, the same framework provides a deeper security architecture.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth is particularly useful for applications requiring multiple client types, device-aware session management, tenant isolation, advanced authorization, credential recovery, controlled refresh, and targeted revocation.\u003C/p\u003E\n\u003Cp\u003EIts modular architecture, explicit authentication flows, configurable policies, and extension points allow developers to introduce additional capabilities without abandoning the original authentication foundation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EThe complexity of your application should not determine how difficult authentication is to begin with.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022one-framework-for-both\u0022\u003EOne Framework for Both\u003C/h3\u003E\n\u003Cp\u003EWhether you\u0027re building a small personal project, a business application, a SaaS platform, or a larger distributed system, UltimateAuth follows the same principle:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EEasy to start. Powerful when needed. Consistent as you grow.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EYou can begin with a straightforward authentication setup and progressively adopt the capabilities your application actually requires.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth can also serve smaller applications, but its architecture becomes especially valuable when authentication requirements extend beyond a basic login form.\u003C/p\u003E\n\u003Cp\u003EIf your application only needs a minimal authentication mechanism, evaluate whether UltimateAuth\u0027s broader lifecycle model provides enough value for your use case.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022current-scope-and-maturity\u0022\u003ECurrent Scope and Maturity\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is an evolving open-source framework.\u003C/p\u003E\n\u003Cp\u003EIts architecture covers several authentication models and client environments, but not every designed capability is necessarily available in the current release.\u003C/p\u003E\n\u003Cp\u003EIn particular:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication mode availability must be checked against the current server implementation.\u003C/li\u003E\n\u003Cli\u003EClient adapter availability varies by platform.\u003C/li\u003E\n\u003Cli\u003ESome advanced session and device policy options may be reserved for future enforcement.\u003C/li\u003E\n\u003Cli\u003EProduction adoption requires appropriate configuration, persistence, deployment security, and testing.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe documentation distinguishes supported behavior from planned or partially implemented capabilities.\u003C/p\u003E\n\u003Cp\u003EThis matters because a trustworthy authentication framework should be clear not only about what it can do, but also about its current limits.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022open-source-first.self-hosted-by-design\u0022\u003EOpen Source First. Self-Hosted by Design.\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth is developed as an open-source project with self-hosting at its foundation.\u003C/p\u003E\n\u003Cp\u003EThe project\u0027s direction is to keep self-hosted authentication free, while a potential managed hosting service could provide an alternative for teams that prefer not to operate the infrastructure themselves.\u003C/p\u003E\n\u003Cp\u003EThe intention is not to divide authentication capabilities into free and paid feature tiers.\u003C/p\u003E\n\u003Cp\u003EIt is to make the framework accessible, inspectable, extensible, and useful to the .NET community.\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EView UltimateAuth on GitHub\u003C/a\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choose-your-starting-point\u0022\u003EChoose Your Starting Point\u003C/h2\u003E\n\u003Cp\u003EYou do not need to understand the entire architecture before building your first application.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EI want to\u2026\u003C/th\u003E\n\u003Cth\u003EStart here\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESet up UltimateAuth for the first time\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EQuickStart\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUnderstand how authentication works internally\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/auth-flows/overview\u0022\u003EAuth Flows\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EConfigure session, token, and security behavior\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/configuration/server-options\u0022\u003EServer Options\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EIntegrate authentication into a Blazor application\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUnderstand the source code and contribute\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth\u0022\u003EGitHub Repository\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Chr\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-is-a-lifecycle-not-a-login-endpoint\u0022\u003EAuthentication is a lifecycle, not a login endpoint.\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth brings together the concepts needed to establish, maintain, evaluate, and terminate authentication within a consistent .NET architecture.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EStart simple. Understand the security model. Extend when you need to.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EContinue to QuickStart\u003C/a\u003E\u003C/p\u003E\n", "Headings": [ { "Id": "why-ultimateauth", @@ -23,6 +23,11 @@ "Text": "One Security Model Across Different Clients", "Level": 0 }, + { + "Id": "sessions-are-more-than-tokens", + "Text": "Sessions Are More Than Tokens", + "Level": 0 + }, { "Id": "authentication-flows-not-disconnected-endpoints", "Text": "Authentication Flows, Not Disconnected Endpoints", @@ -94,6 +99,6 @@ "Level": 1 } ], - "SourceHash": "3B390CDC7564C2F9EFB7FA60BFFFCBA7ED666A5F30863CC9CA3D1CB8C12EF6D4", + "SourceHash": "3A868457D213F78331D24F076C007DC26666D004350B234C150C0A326408207B", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/real-world-setup.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/real-world-setup.json index 67690826..303e94da 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/real-world-setup.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/getting-started/real-world-setup.json @@ -1,7 +1,7 @@ { "Slug": "getting-started/real-world-setup", "Title": "Real World Setup", - "Html": "\n\u003Cp\u003E\u003Cstrong\u003EOne authentication framework. Different deployment models.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe \u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EQuickStart\u003C/a\u003E demonstrates UltimateAuth with Blazor Server and in-memory storage.\u003C/p\u003E\n\u003Cp\u003EReal applications may require persistent data, a separate authentication server, browser-based clients, or independently deployed APIs.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports these scenarios through different service registrations and hosting integrations. You can choose the architecture that fits your application without configuring every available component.\u003C/p\u003E\n\u003Cp\u003EThis guide covers the setup patterns demonstrated by the UltimateAuth samples.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choose-your-architecture\u0022\u003E1. Choose Your Architecture\u003C/h2\u003E\n\u003Cp\u003EStart by identifying where authentication is hosted and how your application communicates with it.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication architecture\u003C/th\u003E\n\u003Cth\u003EAuthentication host\u003C/th\u003E\n\u003Cth\u003EApplication registration\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server, single project\u003C/td\u003E\n\u003Ctd\u003ESame application\u003C/td\u003E\n\u003Ctd\u003EServer \u002B persistence \u002B Blazor client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server with EF Core\u003C/td\u003E\n\u003Ctd\u003ESame application\u003C/td\u003E\n\u003Ctd\u003EServer \u002B EF Core \u002B Blazor client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDedicated UAuthHub\u003C/td\u003E\n\u003Ctd\u003ESeparate authentication application\u003C/td\u003E\n\u003Ctd\u003EServer \u002B persistence \u002B Hub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EStandalone Blazor WASM\u003C/td\u003E\n\u003Ctd\u003ERemote UAuthHub\u003C/td\u003E\n\u003Ctd\u003EBlazor client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Web App, Interactive WASM\u003C/td\u003E\n\u003Ctd\u003ERemote UAuthHub\u003C/td\u003E\n\u003Ctd\u003EHost integration \u002B WASM client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESeparate Resource API\u003C/td\u003E\n\u003Ctd\u003ERemote UAuthHub\u003C/td\u003E\n\u003Ctd\u003EResource API integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese models can be combined.\u003C/p\u003E\n\u003Cp\u003EFor example, an application might use an EF Core-backed UAuthHub, a standalone Blazor WASM frontend, and a separate Resource API.\u003C/p\u003E\n\u003Cp\u003EThe frontend handles user interaction, UAuthHub manages authentication, and the Resource API enforces access to protected resources.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022cryptographic-key-configuration\u0022\u003ECryptographic Key Configuration\u003C/h2\u003E\n\u003Cp\u003EEvery application hosting UltimateAuth Server must configure its cryptographic secrets securely.\u003C/p\u003E\n\u003Cp\u003EThis applies to integrated Blazor Server applications, standalone UAuthHub deployments, and applications using either in-memory or Entity Framework Core persistence.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022required-key-configuration\u0022\u003ERequired key configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ESetting\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.TokenHashingKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHMAC-SHA256 hashing for server-managed token material\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.JwtSigningKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHS256 signing of JWT access tokens\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EBoth settings accept Base64-encoded keys containing at least 32 bytes of cryptographically secure random key material.\u003C/p\u003E\n\u003Cp\u003EPureOpaque does not issue JWT access tokens, but it should still configure the token-hashing key.\u003C/p\u003E\n\u003Cp\u003EHybrid and PureJwt require JWT signing capability.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-configuration\u0022\u003ERecommended configuration\u003C/h3\u003E\n\u003Cp\u003EStore secrets outside application source code.\u003C/p\u003E\n\u003Cp\u003EFor local development, use .NET User Secrets. For deployed applications, use environment variables or a trusted secret-management service.\u003C/p\u003E\n\u003Cp\u003EEnvironment variable names:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Cryptography__TokenHashingKey\nUltimateAuth__Cryptography__JwtSigningKey\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe double underscore (\u003Ccode\u003E__\u003C/code\u003E) represents a configuration hierarchy separator in .NET environment-variable configuration.\u003C/p\u003E\n\u003Cp\u003EConfigure the server:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;UltimateAuth token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;UltimateAuth JWT signing key is missing.\u0026quot;);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not generate new keys automatically on every application startup. Keys must remain consistent across application instances that share authentication state.\u003C/p\u003E\n\u003Cp\u003ENever use the same key for token hashing and JWT signing.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-verification-keys\u0022\u003EResource API verification keys\u003C/h3\u003E\n\u003Cp\u003EA Resource API using PureJwt validates JWT signatures with trusted verification keys.\u003C/p\u003E\n\u003Cp\u003EThe built-in HS256 configuration uses symmetric cryptography, so the Resource API must be configured with the same JWT key material used by the issuing UAuthHub.\u003C/p\u003E\n\u003Cp\u003EThe Resource API does not require the Hub\u0027s token-hashing key.\u003C/p\u003E\n\u003Cp\u003EProtect JWT verification keys as secrets when using symmetric signing algorithms.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022persistent-storage-with-entity-framework-core\u0022\u003E2. Persistent Storage with Entity Framework Core\u003C/h2\u003E\n\u003Cp\u003EFor applications that need authentication state to survive restarts, use a persistent storage provider.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides an Entity Framework Core bundle that registers its reference domain implementations and EF Core-backed stores.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022install-packages\u0022\u003EInstall packages\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle\ndotnet add package Microsoft.EntityFrameworkCore.Sqlite\ndotnet add package Microsoft.EntityFrameworkCore.Design\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe SQLite provider is used here for simplicity. You can use another compatible EF Core database provider.\u003C/p\u003E\n\u003Cp\u003EWhen using the EF Core bundle, you do not need the in-memory bundle.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022register-the-services\u0022\u003ERegister the services\u003C/h3\u003E\n\u003Cp\u003EIn \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing CodeBeam.UltimateAuth.Server.Extensions;\nusing Microsoft.EntityFrameworkCore;\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(\u0026quot;Data Source=uauth.db\u0026quot;, sqlite =\u0026gt; sqlite.MigrationsAssembly(typeof(Program).Assembly.GetName().Name!));\n });\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAddUltimateAuthEntityFrameworkCore()\u003C/code\u003E registers the EF Core stores and reference domain implementations.\u003C/p\u003E\n\u003Cp\u003EThe bundle provides a unified \u003Ccode\u003EUAuthDbContext\u003C/code\u003E for the supported authentication domains.\u003C/p\u003E\n\u003Cp\u003EYou do not need to register each user, session, credential, token, or authorization store individually.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-the-database-connection\u0022\u003EConfigure the database connection\u003C/h3\u003E\n\u003Cp\u003EFor a deployed application, prefer configuration over hardcoded connection strings.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003Eappsettings.json\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;ConnectionStrings\u0026quot;: {\n \u0026quot;UltimateAuth\u0026quot;: \u0026quot;Data Source=uauth.db\u0026quot;\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar connectionString = builder.Configuration.GetConnectionString(\u0026quot;UltimateAuth\u0026quot;)\n ?? throw new InvalidOperationException(\u0026quot;UltimateAuth connection string is missing.\u0026quot;);\n\nbuilder.Services.AddUltimateAuthServer()\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(connectionString);\n });\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor production databases, use your deployment environment\u0027s secret management facilities rather than storing credentials in source control.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022database-migrations\u0022\u003EDatabase migrations\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth does not automatically create or apply migrations when the EF Core bundle is registered.\u003C/p\u003E\n\u003Cp\u003EYour application owns the database migration lifecycle.\u003C/p\u003E\n\u003Cp\u003EInstall the EF Core CLI if necessary:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet tool install --global dotnet-ef\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ECreate the initial migration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet ef migrations add InitUAuth --context UAuthDbContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EApply it:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet ef database update --context UAuthDbContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor Visual Studio Package Manager Console:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EPOWERSHELL\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-powershell\u0022\u003EAdd-Migration InitUAuth -Context UAuthDbContext\nUpdate-Database -Context UAuthDbContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EInstall \u003Ccode\u003EMicrosoft.EntityFrameworkCore.Tools\u003C/code\u003E if required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022applying-migrations-programmatically\u0022\u003EApplying migrations programmatically\u003C/h3\u003E\n\u003Cp\u003EThe EF Core samples demonstrate initialization through a scoped \u003Ccode\u003EUAuthDbContext\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor a controlled development environment:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore;\n\nusing (var scope = app.Services.CreateScope())\n{\n var db = scope.ServiceProvider.GetRequiredService\u0026lt;UAuthDbContext\u0026gt;();\n await db.Database.MigrateAsync();\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis applies pending migrations. It does not generate migration files.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EProduction guidance:\u003C/strong\u003E Prefer applying reviewed migrations as a separate deployment step, particularly when multiple application instances share a database.\u003C/p\u003E\n\u003Cp\u003EDo not copy the sample initializer\u0027s \u003Ccode\u003Ereset: true\u003C/code\u003E behavior into production. The samples use database reset functionality for repeatable demonstrations, not as a safe deployment strategy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022optional-sample-accounts-with-ef-core\u0022\u003EOptional: sample accounts with EF Core\u003C/h3\u003E\n\u003Cp\u003EThe sample seed package can also work with EF Core persistence.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Sample.Seed\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister the scoped seed services:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScopedUltimateAuthSampleSeed();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAfter preparing the database:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eif (app.Environment.IsDevelopment())\n{\n await app.SeedUltimateAuthAsync();\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe difference matters:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EAddUltimateAuthSampleSeed()\u003C/code\u003E is used by the in-memory samples.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EAddScopedUltimateAuthSampleSeed()\u003C/code\u003E is used by the EF Core samples.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EDo not deploy the demonstration accounts and passwords to production.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-integrated-authentication\u0022\u003E3. Blazor Server \u2014 Integrated Authentication\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E A Blazor Server application that wants to host its own authentication system.\u003C/p\u003E\n\u003Cp\u003EThis is the simplest deployment model for a server-side Blazor application.\u003C/p\u003E\n\u003Cp\u003EThe application hosts UltimateAuth Server and uses the Blazor client adapter in the same project.\u003C/p\u003E\n\u003Cp\u003EA separate UAuthHub is not required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022packages\u0022\u003EPackages\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\ndotnet add package CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle\ndotnet add package Microsoft.EntityFrameworkCore.Sqlite\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022services\u0022\u003EServices\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing CodeBeam.UltimateAuth.Server.Extensions;\nusing Microsoft.EntityFrameworkCore;\n\nbuilder.Services\n .AddRazorComponents()\n .AddInteractiveServerComponents();\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(\u0026quot;Data Source=uauth.db\u0026quot;);\n });\n\nbuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pipeline\u0022\u003EPipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseHttpsRedirection();\napp.UseStaticFiles();\n\napp.UseUltimateAuthWithAspNetCore();\napp.UseAntiforgery();\n\napp.MapUltimateAuthEndpoints();\n\napp.MapRazorComponents\u0026lt;App\u0026gt;()\n .AddInteractiveServerRenderMode()\n .AddUltimateAuthRoutes(UAuthAssemblies.BlazorClient());\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAlso configure the \u003Ccode\u003EUAuthApp\u003C/code\u003E root component, login page, and UltimateAuth JavaScript file as demonstrated in QuickStart.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-behavior\u0022\u003EAuthentication behavior\u003C/h3\u003E\n\u003Cp\u003EThe default application profile resolution selects \u003Ccode\u003EPureOpaque\u003C/code\u003E for Blazor Server.\u003C/p\u003E\n\u003Cp\u003EThis uses session-oriented authentication rather than requiring the application to manage access and refresh tokens manually.\u003C/p\u003E\n\u003Cp\u003EYou can configure session lifetimes, login policies, credential policies, and other behavior through \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Identifiers.Behavior.AllowMultipleUsernames = true;\n options.Password.Level = PasswordPolicyLevel.Strict;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe effective authentication mode is resolved at runtime. The application does not need to select a single mode globally.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022password-security-configuration\u0022\u003EPassword Security Configuration\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth uses the Standard password policy by default. Applications can select Basic or Strict, or override individual requirements through \u003Ccode\u003Eoptions.Password\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor the preset comparison, configuration examples, and password-history settings, see \u003Ca href=\u0022/docs/security/password-policy\u0022\u003EPassword Policy \u0026amp; History\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022uauthhub-dedicated-authentication-server\u0022\u003E4. UAuthHub \u2014 Dedicated Authentication Server\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E Applications where multiple clients share one authentication authority.\u003C/p\u003E\n\u003Cp\u003EUAuthHub hosts UltimateAuth\u0027s authentication services separately from your frontend applications.\u003C/p\u003E\n\u003Cp\u003EIt is particularly relevant for standalone WASM applications, Interactive WASM applications, and systems with separate Resource APIs.\u003C/p\u003E\n\u003Cp\u003EA typical architecture looks like this:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Standalone WASM Interactive WASM\n \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u25BC\n UAuthHub\n Authentication\n Sessions \u0026amp; Users\n \u2502\n \u25BC\n Persistence\n\n Resource API \u2500\u2500\u2500\u25BA UAuthHub\n (validation)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022create-the-hub-application\u0022\u003ECreate the Hub application\u003C/h3\u003E\n\u003Cp\u003EA UAuthHub can be hosted in an ASP.NET Core Blazor Server application.\u003C/p\u003E\n\u003Cp\u003EThe current samples use Blazor Server to provide the Hub\u0027s login UI.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022in-memory-uauthhub\u0022\u003EIn-memory UAuthHub\u003C/h3\u003E\n\u003Cp\u003EFor development:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\ndotnet add package CodeBeam.UltimateAuth.InMemory.Bundle\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.InMemory;\nusing CodeBeam.UltimateAuth.Server.Extensions;\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthInMemory()\n .AddUAuthHub(options =\u0026gt;\n {\n options.AllowedClientOrigins.Add(\u0026quot;https://localhost:6130\u0026quot;);\n });\n\nbuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Hub\u0027s Blazor client registration is needed when the Hub itself hosts UltimateAuth-powered Blazor pages and login UI.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ef-core-uauthhub\u0022\u003EEF Core UAuthHub\u003C/h3\u003E\n\u003Cp\u003EFor persistent storage:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore;\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(\u0026quot;Data Source=uauthhub.db\u0026quot;);\n })\n .AddUAuthHub(options =\u0026gt;\n {\n options.AllowedClientOrigins.Add(\u0026quot;https://localhost:6132\u0026quot;);\n });\n\nbuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe \u003Ccode\u003EAllowedClientOrigins\u003C/code\u003E collection identifies browser origins permitted to interact with the Hub.\u003C/p\u003E\n\u003Cp\u003EUse exact origins, including scheme and port. Do not include paths such as \u003Ccode\u003E/home\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hub-pipeline\u0022\u003EHub pipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseHttpsRedirection();\n\napp.UseUltimateAuthWithAspNetCore();\napp.UseAntiforgery();\n\napp.MapUltimateAuthEndpoints();\napp.MapUAuthHub();\n\napp.MapStaticAssets();\n\napp.MapRazorComponents\u0026lt;App\u0026gt;()\n .AddInteractiveServerRenderMode()\n .AddUltimateAuthRoutes(UAuthAssemblies.BlazorClient());\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EMapUltimateAuthEndpoints()\u003C/code\u003E maps the authentication endpoints.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EMapUAuthHub()\u003C/code\u003E maps the Hub-specific entry endpoint.\u003C/p\u003E\n\u003Cp\u003EBoth registrations are used by the current UAuthHub samples.\u003C/p\u003E\n\u003Cp\u003EThe Hub also needs its login page and Blazor application lifecycle components.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-origins\u0022\u003EChoosing origins\u003C/h3\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication\u003C/th\u003E\n\u003Cth\u003EURL\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUAuthHub\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ehttps://localhost:6112\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EStandalone WASM\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ehttps://localhost:6130\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EInteractive WASM\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ehttps://localhost:6132\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EConfigure the Hub\u0027s allowed origins for the actual frontend applications it serves.\u003C/p\u003E\n\u003Cp\u003EThese localhost addresses are illustrative and must match your deployment.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-standalone-webassembly\u0022\u003E5. Blazor Standalone WebAssembly\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E A browser-hosted application with a separate UAuthHub.\u003C/p\u003E\n\u003Cp\u003EStandalone Blazor WASM runs in the browser. It does not host UltimateAuth Server or database persistence.\u003C/p\u003E\n\u003Cp\u003EAuthentication is handled by the remote UAuthHub.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-packages\u0022\u003EClient packages\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-services\u0022\u003EConfigure services\u003C/h3\u003E\n\u003Cp\u003EIn the standalone WASM application\u0027s \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.Core.Domain;\n\nvar builder = WebAssemblyHostBuilder.CreateDefault(args);\n\nbuilder.RootComponents.Add\u0026lt;App\u0026gt;(\u0026quot;#app\u0026quot;);\nbuilder.RootComponents.Add\u0026lt;HeadOutlet\u0026gt;(\u0026quot;head::after\u0026quot;);\n\nbuilder.Services.AddScoped(sp =\u0026gt; new HttpClient\n{\n BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)\n});\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6110/auth\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;https://localhost:6130/home\u0026quot;;\n options.Login.AllowCredentialPost = true;\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\nawait builder.Build().RunAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current standalone WASM sample explicitly configures \u003Ccode\u003ELogin.AllowCredentialPost\u003C/code\u003E and the PKCE return URL.\u003C/p\u003E\n\u003Cp\u003EThese are client-side settings. The UAuthHub must be configured independently.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-the-urls-mean\u0022\u003EWhat the URLs mean\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E points to the remote authentication endpoints.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EPkce.ReturnUrl\u003C/code\u003E identifies the frontend destination used by the relevant PKCE flow.\u003C/p\u003E\n\u003Cp\u003EThe Hub must recognize the frontend\u0027s origin, and any return URL used in an authentication flow must be validated against the application\u0027s security policy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022root-component\u0022\u003ERoot component\u003C/h3\u003E\n\u003Cp\u003EA standalone WASM application should initialize UltimateAuth through \u003Ccode\u003EUAuthApp\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor example, its root application or routing component can contain:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client.Blazor\n\n\u0026lt;UAuthApp UseBuiltInRouter=\u0026quot;true\u0026quot; AppAssembly=\u0026quot;typeof(Program).Assembly\u0026quot; DefaultLayout=\u0026quot;typeof(Layout.MainLayout)\u0026quot; /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EInclude the UltimateAuth JavaScript asset in the application\u0027s HTML host page.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-modes-and-signing-keys\u0022\u003EAuthentication modes and signing keys\u003C/h3\u003E\n\u003Cp\u003EA single UAuthHub can issue different authentication credentials according to the resolved application profile and server configuration.\u003C/p\u003E\n\u003Cp\u003EBlazor Server defaults to PureOpaque, while Blazor WebAssembly and MAUI default to Hybrid. API-oriented profiles default to PureJwt.\u003C/p\u003E\n\u003Cp\u003EJWT-enabled modes require a signing key. The UAuthHub remains responsible for protecting that key and issuing trusted access tokens.\u003C/p\u003E\n\u003Cp\u003EFor PureJwt, refresh-token persistence is still required even though authentication sessions are not created.\u003C/p\u003E\n\u003Cp\u003EA separate Resource API does not automatically inherit the authentication mode or cryptographic configuration of UAuthHub.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-web-app-interactive-webassembly\u0022\u003E6. Blazor Web App \u2014 Interactive WebAssembly\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E A Blazor Web App with an ASP.NET Core host and a separate \u003Ccode\u003E.Client\u003C/code\u003E project.\u003C/p\u003E\n\u003Cp\u003EThis scenario differs from standalone WASM because components may participate in both server-side rendering and browser-side interactivity.\u003C/p\u003E\n\u003Cp\u003EThe current UltimateAuth sample registers the Blazor client integration in \u003Cstrong\u003Eboth projects\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EIt also adds a separate ASP.NET Core compatibility registration in the host.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022project-structure\u0022\u003EProject structure\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EMyApplication/\n\u251C\u2500\u2500 MyApplication/\n\u2502 \u251C\u2500\u2500 Program.cs\n\u2502 \u2514\u2500\u2500 Components/\n\u2502 \u2514\u2500\u2500 App.razor\n\u2502\n\u2514\u2500\u2500 MyApplication.Client/\n \u251C\u2500\u2500 Program.cs\n \u2514\u2500\u2500 Pages/\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe host serves the application.\u003C/p\u003E\n\u003Cp\u003EThe \u003Ccode\u003E.Client\u003C/code\u003E project contains browser-executed components and services.\u003C/p\u003E\n\u003Cp\u003EA remote UAuthHub manages authentication.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022host-project-packages\u0022\u003E6.1 Host project packages\u003C/h3\u003E\n\u003Cp\u003EInstall the Blazor client integration and ASP.NET Core compatibility package in the host:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\ndotnet add package CodeBeam.UltimateAuth.Client.AspNetCore\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022host-project-services\u0022\u003E6.2 Host project services\u003C/h3\u003E\n\u003Cp\u003EIn the host \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.AspNetCore;\nusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.Core.Domain;\n\nbuilder.Services\n .AddRazorComponents()\n .AddInteractiveWebAssemblyComponents();\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;https://localhost:6132/home\u0026quot;;\n options.Login.AllowCredentialPost = true;\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\nbuilder.Services.AddUltimateAuthAspNetCoreCompatibility();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAddUltimateAuthAspNetCoreCompatibility()\u003C/code\u003E registers the compatibility authentication scheme and ASP.NET Core authorization services used by this hosting pattern.\u003C/p\u003E\n\u003Cp\u003EIt does \u003Cstrong\u003Enot\u003C/strong\u003E turn the host into an UltimateAuth authentication server.\u003C/p\u003E\n\u003Cp\u003EIt is also not equivalent to \u003Ccode\u003EAddUltimateAuthResourceApi()\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022host-project-pipeline\u0022\u003E6.3 Host project pipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseHttpsRedirection();\n\napp.UseAntiforgery();\n\napp.MapStaticAssets();\n\napp.MapRazorComponents\u0026lt;App\u0026gt;()\n .AddInteractiveWebAssemblyRenderMode()\n .AddAdditionalAssemblies(typeof(MyApplication.Client._Imports).Assembly, UAuthAssemblies.BlazorClient().First());\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EReplace \u003Ccode\u003EMyApplication.Client._Imports\u003C/code\u003E with the corresponding type from your client project.\u003C/p\u003E\n\u003Cp\u003EThe additional assemblies allow the host to discover routable components from the WASM client project and UltimateAuth\u0027s Blazor client assembly.\u003C/p\u003E\n\u003Cp\u003EThe sample does not register \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E in this host because authentication is delegated to a separate UAuthHub.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-project-packages\u0022\u003E6.4 Client project packages\u003C/h3\u003E\n\u003Cp\u003EInstall the Blazor client adapter in the \u003Ccode\u003E.Client\u003C/code\u003E project:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-project-services\u0022\u003E6.5 Client project services\u003C/h3\u003E\n\u003Cp\u003EIn \u003Ccode\u003EMyApplication.Client/Program.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.Core.Domain;\n\nvar builder = WebAssemblyHostBuilder.CreateDefault(args);\n\nbuilder.Services.AddScoped(sp =\u0026gt; new HttpClient\n{\n BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)\n});\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;https://localhost:6132/home\u0026quot;;\n options.Login.AllowCredentialPost = true;\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\nawait builder.Build().RunAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe host and client configurations should agree on the remote UAuthHub URL and authentication flow settings.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-both-registrations-are-necessary\u0022\u003EWhy both registrations are necessary\u003C/h3\u003E\n\u003Cp\u003EThe host and browser client have separate dependency injection containers.\u003C/p\u003E\n\u003Cp\u003ERegistering \u003Ccode\u003EAddUltimateAuthClientBlazor()\u003C/code\u003E in the host does not automatically register those services inside the WebAssembly runtime.\u003C/p\u003E\n\u003Cp\u003ELikewise, registering the client adapter only in the \u003Ccode\u003E.Client\u003C/code\u003E project does not supply the services required during server-side integration.\u003C/p\u003E\n\u003Cp\u003EThe additional ASP.NET Core compatibility registration addresses the host\u0027s ASP.NET Core authentication and authorization integration requirements.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E This compatibility layer is not a replacement for server-side authorization of your protected business APIs.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-separate-protected-backend\u0022\u003E7. Resource API \u2014 Separate Protected Backend\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E An API that needs UltimateAuth authentication validation but does not host the authentication system itself.\u003C/p\u003E\n\u003Cp\u003EA Resource API can be an ASP.NET Core Web API, MVC application, or another supported server-side application.\u003C/p\u003E\n\u003Cp\u003EIt does not need to be a Blazor application.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022architecture\u0022\u003EArchitecture\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Blazor Client\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC\n UAuthHub Resource API\n \u25B2 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n Authentication\n validation\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource API uses the configured UAuthHub for remote authentication and session validation behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022install-the-server-integration-package\u0022\u003EInstall the server integration package\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Server\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-services-1\u0022\u003EConfigure services\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E Resource API\u0027s \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar builder = WebApplication.CreateBuilder(args);\n\nbuilder.Services.AddControllers();\n\nbuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.Auth.Jwt = new UAuthJwtValidationOptions\n {\n Issuer = \u0026quot;https://auth.example.com\u0026quot;,\n Audience = \u0026quot;products-api\u0026quot;,\n ValidAlgorithms = [SecurityAlgorithms.HmacSha256]\n };\n\n options.Cryptography.JwtVerificationKeys.Add(\n new UAuthJwtVerificationKeyOptions\n {\n KeyId = \u0026quot;uauth-hs256-v1\u0026quot;,\n Key = builder.Configuration[\u0026quot;UltimateAuth:JwtVerificationKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT verification key is missing.\u0026quot;)\n });\n\n options.Auth.AccessToken.DeliveryMode = GrantDeliveryMode.Header;\n\n options.Cors.AllowedOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n});\n\nvar app = builder.Build();\n\napp.UseHttpsRedirection();\napp.UseUltimateAuthResourceApiWithAspNetCore();\n\napp.MapControllers();\napp.Run();\n\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E Resource API\u0027s \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.Auth.Mode = UAuthMode.PureOpaque;\n\n options.Hub.BaseUrl = \u0026quot;https://auth.example.com\u0026quot;;\n\n options.Auth.Session.DeliveryMode = GrantDeliveryMode.Cookie;\n\n options.Auth.Session.CookieName = \u0026quot;uas\u0026quot;;\n\n options.Cors.AllowedOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EHub.BaseUrl\u003C/code\u003E is the base address of the authentication server.\u003C/p\u003E\n\u003Cp\u003ENotice that this example uses the Hub origin without the \u003Ccode\u003E/auth\u003C/code\u003E suffix, matching the current Resource API samples.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedOrigins\u003C/code\u003E controls the browser origins permitted by the Resource API\u0027s CORS configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-the-pipeline\u0022\u003EConfigure the pipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar app = builder.Build();\n\napp.UseHttpsRedirection();\n\napp.UseUltimateAuthResourceApiWithAspNetCore();\n\napp.MapControllers();\n\napp.Run();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EUseUltimateAuthResourceApiWithAspNetCore()\u003C/code\u003E installs the Resource API integration middleware together with ASP.NET Core authentication and authorization middleware.\u003C/p\u003E\n\u003Cp\u003EYou do not need to register a local UltimateAuth Server or its persistence bundle in the Resource API.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022protecting-endpoints\u0022\u003EProtecting endpoints\u003C/h3\u003E\n\u003Cp\u003EUse ASP.NET Core authorization attributes for endpoints that require authentication:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Mvc;\n\n[ApiController]\n[Route(\u0026quot;api/products\u0026quot;)]\npublic class ProductsController : ControllerBase\n{\n [HttpGet]\n [Authorize]\n public IActionResult GetProducts()\n {\n return Ok(new[]\n {\n new { Id = 1, Name = \u0026quot;Example product\u0026quot; }\n });\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe authorization attribute is enforced by ASP.NET Core on the server.\u003C/p\u003E\n\u003Cp\u003EFor permission-specific rules, configure and apply the corresponding authorization policies.\u003C/p\u003E\n\u003Cp\u003EDo not rely on Blazor UI authorization checks to protect Resource API endpoints.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022account-status-enforcement\u0022\u003EAccount Status Enforcement\u003C/h3\u003E\n\u003Cp\u003EProtected Resource API endpoints enforce active-user authorization by default, including endpoints using \u003Ccode\u003E[Authorize]\u003C/code\u003E and role-based authorization.\u003C/p\u003E\n\u003Cp\u003EThe Resource API obtains the current user status through trusted UAuthHub session validation. Suspended and SelfSuspended users remain authenticated but cannot access ordinary protected resources.\u003C/p\u003E\n\u003Cp\u003ETo allow specific operations for suspended users, explicitly apply \u003Ccode\u003E[UAuthAllowInactive]\u003C/code\u003E alongside \u003Ccode\u003E[Authorize]\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe exception does not bypass other authorization requirements.\u003C/p\u003E\n\u003Cp\u003EFor the complete behavior and examples, see \u003Ca href=\u0022/docs/plugin-domains/authorization\u0022\u003EAuthorization\u003C/a\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022cors-configuration\u0022\u003ECORS configuration\u003C/h3\u003E\n\u003Cp\u003EThe current Resource API integration registers CORS from the configured allowed origins.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AllowedClientOrigins.Add(\u0026quot;https://localhost:6132\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EOnly add origins that should be allowed to call your API from a browser.\u003C/p\u003E\n\u003Cp\u003ECORS is a browser access control mechanism, not an authentication or authorization mechanism.\u003C/p\u003E\n\u003Cp\u003EA request must still pass the applicable authentication and authorization checks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-vs-uauthhub\u0022\u003EResource API vs UAuthHub\u003C/h3\u003E\n\u003Cp\u003EThese are different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EUAuthHub\u003C/th\u003E\n\u003Cth\u003EResource API\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHosts authentication flows\u003C/td\u003E\n\u003Ctd\u003EHosts application resources\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EManages authentication sessions\u003C/td\u003E\n\u003Ctd\u003EValidates remote authentication context\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUses authentication persistence\u003C/td\u003E\n\u003Ctd\u003EDoes not require local authentication stores\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EProvides login and related endpoints\u003C/td\u003E\n\u003Ctd\u003EProvides application endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EServes authentication clients\u003C/td\u003E\n\u003Ctd\u003EServes authorized API consumers\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EUse a Resource API when you want independent deployment of business endpoints without duplicating the authentication server.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-with-an-ef-core-backed-uauthhub\u0022\u003E8. Resource API with an EF Core-Backed UAuthHub\u003C/h2\u003E\n\u003Cp\u003EThe Resource API does not need to use EF Core just because UAuthHub does.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EInteractive WASM\n \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25BA Resource API\n \u2502\n \u25BC\n UAuthHub\n \u2502\n \u25BC\n EF Core Database\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Hub stores users, credentials, sessions, and related security state in its database.\u003C/p\u003E\n\u003Cp\u003EThe Resource API communicates with the Hub through the configured remote validation integration.\u003C/p\u003E\n\u003Cp\u003EIts registration remains:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.UAuthHubBaseUrl = \u0026quot;https://localhost:6112\u0026quot;;\n options.AllowedClientOrigins.Add(\u0026quot;https://localhost:6132\u0026quot;);\n options.CorsPolicyName = \u0026quot;resourceApi\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis separation allows the API and authentication infrastructure to be deployed, scaled, and maintained independently.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022calling-a-resource-api-from-blazor\u0022\u003E9. Calling a Resource API from Blazor\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides a unified Resource Client for accessing protected application APIs.\u003C/p\u003E\n\u003Cp\u003EInstead of configuring a separate HTTP client and implementing browser credential handling for ordinary resource requests, applications can use \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThis keeps authentication, identity operations, and application resource requests accessible through the same client SDK.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-the-resource-api\u0022\u003EConfigure the Resource API\u003C/h3\u003E\n\u003Cp\u003EFor a separate Resource API, configure its origin through the Blazor client registration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n\n options.Resource.BaseAddress = \u0026quot;https://localhost:6122\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E identifies the authentication server.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EResource.BaseAddress\u003C/code\u003E identifies the application Resource API.\u003C/p\u003E\n\u003Cp\u003EThese addresses can point to different applications.\u003C/p\u003E\n\u003Cp\u003EIf the Resource API shares the application\u0027s origin, \u003Ccode\u003EResource.BaseAddress\u003C/code\u003E can remain \u003Ccode\u003Enull\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022call-protected-resources\u0022\u003ECall Protected Resources\u003C/h3\u003E\n\u003Cp\u003EInject \u003Ccode\u003EIUAuthClient\u003C/code\u003E into a Blazor component:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen retrieve application data:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is not null)\n{\n products = result.Value;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client also supports POST, PUT, PATCH, and DELETE operations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-specific-api-services\u0022\u003EApplication-Specific API Services\u003C/h3\u003E\n\u003Cp\u003EApplications can organize resource operations into small domain-specific services.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\nusing CodeBeam.UltimateAuth.Core.Contracts;\n\npublic sealed class ProductApiService(IUAuthClient client)\n{\n public Task\u0026lt;UAuthResult\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;\u0026gt; GetAllAsync()\n =\u0026gt; client.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; CreateAsync(Product product)\n =\u0026gt; client.Resource.PostAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products\u0026quot;,product);\n\n public Task\u0026lt;UAuthResult\u0026gt; DeleteAsync(int id)\n =\u0026gt; client.Resource.DeleteAsync($\u0026quot;/api/products/{id}\u0026quot;);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister the application service:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ProductApiService\u0026gt;();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe service uses UltimateAuth\u0027s transport and result contracts rather than implementing another HTTP abstraction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022interactive-webassembly\u0022\u003EInteractive WebAssembly\u003C/h3\u003E\n\u003Cp\u003EIn an Interactive WebAssembly application, configure the UltimateAuth Blazor client in each project where the Resource Client will be used.\u003C/p\u003E\n\u003Cp\u003EThe host and \u003Ccode\u003E.Client\u003C/code\u003E project have separate dependency injection containers.\u003C/p\u003E\n\u003Cp\u003EA shared application API service may be registered in both projects when components execute in both environments.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client uses browser-based transport, including when invoked from an interactive Blazor Server component.\u003C/p\u003E\n\u003Cp\u003EBrowser interop must be available before making resource requests. Do not initiate browser-dependent resource requests during static prerendering.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022standalone-webassembly\u0022\u003EStandalone WebAssembly\u003C/h3\u003E\n\u003Cp\u003EStandalone Blazor WebAssembly applications use the same Resource Client API.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n options.Resource.BaseAddress = \u0026quot;https://localhost:6122\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EOnce configured, application components can call protected resources through \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EA separate application-specific \u003Ccode\u003EHttpClient\u003C/code\u003E is not required for these requests.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-credentials-and-cors\u0022\u003EBrowser Credentials and CORS\u003C/h3\u003E\n\u003Cp\u003EFor cross-origin requests, the browser and receiving API must agree on credential handling.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client supports \u003Ccode\u003EAuto\u003C/code\u003E, \u003Ccode\u003ESameOrigin\u003C/code\u003E, \u003Ccode\u003EInclude\u003C/code\u003E, and \u003Ccode\u003EOmit\u003C/code\u003E credential policies.\u003C/p\u003E\n\u003Cp\u003EFor cross-origin cookie-based authentication, configure the appropriate credential policy and ensure that the Resource API supports the required CORS and cookie settings.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client does not automatically make an API authenticated merely because the user has signed in through UAuthHub.\u003C/p\u003E\n\u003Cp\u003EThe receiving API must validate the authentication material associated with the configured authentication mode and enforce its authorization policies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-and-direct-service-calls\u0022\u003EBlazor Server and Direct Service Calls\u003C/h3\u003E\n\u003Cp\u003EBlazor Server applications can often access application services directly when those services are hosted in the same process.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar products = await productService.GetAllAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThere is no need to introduce an HTTP request solely to use the Resource Client.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E when the application actually needs to communicate with a protected Resource API through the browser.\u003C/p\u003E\n\u003Cp\u003EFor server-to-server requests, use an appropriate server-side HTTP client and authentication mechanism.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022learn-more\u0022\u003ELearn More\u003C/h3\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/client-sdk/resource-api-requests\u0022\u003EResource API Requests\u003C/a\u003E for supported operations, result handling, credential configuration, security considerations, and request cancellation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-modes-and-application-profiles\u0022\u003E10. Authentication Modes and Application Profiles\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates \u003Cstrong\u003Eapplication profile detection\u003C/strong\u003E from \u003Cstrong\u003Eauthentication mode enforcement\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThe default resolver maps application profiles to authentication modes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication profile\u003C/th\u003E\n\u003Cth\u003EDefault resolved mode\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WASM\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EWeb Server\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMAUI\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAPI\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThis mapping describes the resolver\u0027s behavior, not a guarantee that every mode is currently fully supported by the server.\u003C/p\u003E\n\u003Cp\u003EIn particular, \u003Ccode\u003EPureJwt\u003C/code\u003E and \u003Ccode\u003ESemiHybrid\u003C/code\u003E have implementation limitations in the current release.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022restrict-allowed-modes\u0022\u003ERestrict allowed modes\u003C/h3\u003E\n\u003Cp\u003EOn the authentication server:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E is a guardrail.\u003C/p\u003E\n\u003Cp\u003EIt does not select a mode for every request.\u003C/p\u003E\n\u003Cp\u003EThe effective mode is resolved from the application profile and then checked against the server\u0027s allowed-mode policy.\u003C/p\u003E\n\u003Cp\u003EFor most applications, use the default mode resolution unless you have a specific integration requirement.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-options-for-real-applications\u0022\u003E11. Server Options for Real Applications\u003C/h2\u003E\n\u003Cp\u003EProduction configuration should reflect your application\u0027s security requirements.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Identifiers.Behavior.AllowMultipleUsernames = true;\n options.UserProfile.EnableMultiProfile = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EServer options also compose the Core-defined login, session, token, PKCE, and multi-tenant options.\u003C/p\u003E\n\u003Cp\u003EConfigure those through \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EDo not independently configure Core options and assume the server will automatically use them.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-files\u0022\u003EConfiguration files\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth also supports configuration through \u003Ccode\u003Eappsettings.json\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Server\u0026quot;: {\n \u0026quot;Login\u0026quot;: {\n \u0026quot;MaxFailedAttempts\u0026quot;: 5,\n \u0026quot;LockoutDuration\u0026quot;: \u0026quot;00:15:00\u0026quot;\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server options registration binds the \u003Ccode\u003EUltimateAuth:Server\u003C/code\u003E configuration section.\u003C/p\u003E\n\u003Cp\u003ERemember that effective mode defaults and mode-specific overrides are applied after the base options have been configured.\u003C/p\u003E\n\u003Cp\u003EFor detailed configuration behavior, see Server Options and Advanced Configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-ip-address-reverse-proxy\u0022\u003E12. Client IP Address \u0026amp; Reverse Proxy\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses ASP.NET Core\u0027s resolved client IP address for device information and IP-based rate limiting. It does not directly trust \u003Ccode\u003EX-Forwarded-For\u003C/code\u003E or \u003Ccode\u003ECF-Connecting-IP\u003C/code\u003E headers.\u003C/p\u003E\n\u003Cp\u003EIf your application runs behind Caddy, Nginx, or another reverse proxy, configure ASP.NET Core to trust that proxy.\u003C/p\u003E\n\u003Cp\u003EIn \u003Ccode\u003EProgram.cs\u003C/code\u003E, before \u003Ccode\u003Ebuilder.Build()\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing System.Net;\nusing Microsoft.AspNetCore.HttpOverrides;\n\nbuilder.Services.Configure\u0026lt;ForwardedHeadersOptions\u0026gt;(options =\u0026gt;\n{\n options.ForwardedHeaders =\n ForwardedHeaders.XForwardedFor |\n ForwardedHeaders.XForwardedProto;\n\n // Replace with your actual Caddy or Nginx proxy IP.\n options.KnownProxies.Add(IPAddress.Parse(\u0026quot;172.20.0.5\u0026quot;));\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen enable the middleware \u003Cstrong\u003Ebefore\u003C/strong\u003E UltimateAuth and HTTPS redirection:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseForwardedHeaders();\n\napp.UseHttpsRedirection();\napp.UseUltimateAuthWithAspNetCore();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe example IP \u003Ccode\u003E172.20.0.5\u003C/code\u003E represents a trusted reverse proxy, not the visitor\u0027s IP address. Replace it with your actual proxy IP. For Docker deployments, ensure the proxy address is stable or configure a narrowly scoped trusted network.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E Never trust arbitrary forwarded headers or clear the trusted proxy lists to accept all sources. If your application connects directly to Kestrel without a reverse proxy, no forwarded headers configuration is required.\u003C/p\u003E\n\u003Cp\u003EFor multi-proxy deployments, configure the complete trusted proxy chain and forwarding behavior according to your infrastructure.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022development-and-production-differences\u0022\u003E13. Development and Production Differences\u003C/h2\u003E\n\u003Cp\u003EThe samples intentionally prioritize visibility and repeatability.\u003C/p\u003E\n\u003Cp\u003EA production application needs additional safeguards.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EArea\u003C/th\u003E\n\u003Cth\u003ESample or development\u003C/th\u003E\n\u003Cth\u003EProduction\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPersistence\u003C/td\u003E\n\u003Ctd\u003EInMemory or local SQLite\u003C/td\u003E\n\u003Ctd\u003EDurable database\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESeed accounts\u003C/td\u003E\n\u003Ctd\u003EExample users and passwords\u003C/td\u003E\n\u003Ctd\u003EReal provisioning\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDatabase initialization\u003C/td\u003E\n\u003Ctd\u003EMay reset sample data\u003C/td\u003E\n\u003Ctd\u003EReviewed migrations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHTTPS\u003C/td\u003E\n\u003Ctd\u003ELocal development certificate\u003C/td\u003E\n\u003Ctd\u003EProper TLS termination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECORS\u003C/td\u003E\n\u003Ctd\u003ELocalhost origins\u003C/td\u003E\n\u003Ctd\u003EExact trusted origins\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESigning keys\u003C/td\u003E\n\u003Ctd\u003EDevelopment defaults\u003C/td\u003E\n\u003Ctd\u003EManaged, persistent keys\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDiagnostics\u003C/td\u003E\n\u003Ctd\u003EDetailed debugging\u003C/td\u003E\n\u003Ctd\u003ERestrict sensitive diagnostics\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECredential recovery\u003C/td\u003E\n\u003Ctd\u003EDevelopment notifier\u003C/td\u003E\n\u003Ctd\u003EReal secure notification channel\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EIdentifier verification\u003C/td\u003E\n\u003Ctd\u003EDevelopment bypass\u003C/td\u003E\n\u003Ctd\u003EProof-based verification\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESecrets\u003C/td\u003E\n\u003Ctd\u003ELocal settings\u003C/td\u003E\n\u003Ctd\u003ESecure configuration provider\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe sample projects include development-only implementations for credential reset notifications and identifier verification.\u003C/p\u003E\n\u003Cp\u003EThose implementations demonstrate extension points and should not be treated as production verification systems.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-recovery\u0022\u003ECredential recovery\u003C/h3\u003E\n\u003Cp\u003EIf your application exposes credential recovery, configure a real implementation of the credential reset notifier.\u003C/p\u003E\n\u003Cp\u003ERecovery secrets must be delivered through an appropriate channel and must not be exposed directly through anonymous API responses.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-verification\u0022\u003EIdentifier verification\u003C/h3\u003E\n\u003Cp\u003EIf your application supports verified email addresses, phone numbers, or other identifiers, use an implementation that verifies ownership through suitable proof.\u003C/p\u003E\n\u003Cp\u003EDo not use a development bypass verifier in production.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022signing-keys\u0022\u003ESigning keys\u003C/h3\u003E\n\u003Cp\u003EConfigure persistent signing keys for authentication modes that issue JWTs.\u003C/p\u003E\n\u003Cp\u003EDevelopment signing key providers are not a substitute for production key management.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022deployment-checklist\u0022\u003E14. Deployment Checklist\u003C/h2\u003E\n\u003Cp\u003EBefore deploying, verify the following:\u003C/p\u003E\n\u003Cul class=\u0022contains-task-list\u0022\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E The selected architecture matches the actual client hosting model.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E The authentication server uses appropriate persistent storage.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Database migrations have been reviewed and applied.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Sample users and development-only verification services are disabled.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Production signing keys and secrets are configured.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E HTTPS is enforced at the appropriate boundary.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E UAuthHub and Resource API origins are explicitly configured.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Authentication endpoints and application endpoints are protected appropriately.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Client and server endpoint URLs match the deployment.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Session expiration, refresh, logout, and revocation have been tested.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Protected resources enforce server-side authorization.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Reverse proxy headers are configured correctly if applicable.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Authentication state and persistence survive the expected application lifecycle.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-your-architecture\u0022\u003E15. Choosing Your Architecture\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EStart with one server and one client. Connect more clients whenever you need them.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth is built around two fundamental responsibilities:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EUltimateAuth Server\u003C/strong\u003E \u2014 Manages authentication, users, credentials, sessions, authorization, and the security lifecycle.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUltimateAuth Client\u003C/strong\u003E \u2014 Integrates an application with the authentication system using the appropriate application profile and authentication flows.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EEvery application needs access to an authentication server, but that server does not have to be a separate application. It can be hosted within your existing ASP.NET Core application or deployed independently as UAuthHub.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022single-application-the-simplest-setup\u0022\u003ESingle Application \u2014 The Simplest Setup\u003C/h3\u003E\n\u003Cp\u003EFor a traditional ASP.NET Core or Blazor Server application, UltimateAuth Server and Client can run together.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Your Application \u2502\n\u2502 \u2502\n\u2502 UltimateAuth Client \u2502\n\u2502 \u2502 \u2502\n\u2502 UltimateAuth Server \u2502\n\u2502 \u2502 \u2502\n\u2502 Database \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis approach is ideal when you want authentication without introducing another service or deployment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022multiple-applications-one-authentication-server\u0022\u003EMultiple Applications \u2014 One Authentication Server\u003C/h3\u003E\n\u003Cp\u003EAs your system grows, you can connect multiple client applications to the same UltimateAuth Server.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Blazor Server Blazor WASM\n \u2502 \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 \u2502 \u2502\n Razor Pages MAUI Other .NET Clients\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u25BC\n UltimateAuth Server\n UAuthHub\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC \u25BC\n Users Sessions Authorization\n \u2502\n \u25BC\n Persistence\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEach client can have its own application structure, hosting model, and authentication requirements while sharing the same authentication authority.\u003C/p\u003E\n\u003Cp\u003EFor example, a business platform might use Blazor Server for administration, Blazor WASM for its customer portal, MAUI for mobile access, and Razor Pages for an internal application.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAdding another client does not require replacing the existing clients or creating another UltimateAuth Server.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe same users, credentials, security policies, and session infrastructure can serve multiple applications, subject to the authentication modes and client integrations supported by the installed version.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022distributed-applications-separate-resource-apis\u0022\u003EDistributed Applications \u2014 Separate Resource APIs\u003C/h3\u003E\n\u003Cp\u003EWhen your architecture includes independently deployed backend services, Resource APIs can integrate with the same authentication authority.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Multiple Client Applications\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC\n UAuthHub Resource APIs\n \u25B2 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n Authentication\n Validation\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResource APIs protect application resources without becoming additional authentication servers.\u003C/p\u003E\n\u003Cp\u003EThis lets you separate business services from authentication infrastructure while maintaining a shared security model.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022one-foundation-different-scales\u0022\u003EOne Foundation, Different Scales\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EYour scenario\u003C/th\u003E\n\u003Cth\u003ERecommended approach\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA simple Blazor Server application\u003C/td\u003E\n\u003Ctd\u003EIntegrated Server \u002B Client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA traditional ASP.NET Core application\u003C/td\u003E\n\u003Ctd\u003EServer hosted within the application\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA standalone Blazor WASM application\u003C/td\u003E\n\u003Ctd\u003EClient \u002B remote UAuthHub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAn Interactive WASM application\u003C/td\u003E\n\u003Ctd\u003EHost \u002B WASM Client \u002B remote UAuthHub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMultiple web, desktop, or mobile applications\u003C/td\u003E\n\u003Ctd\u003EMultiple Clients \u002B shared UAuthHub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMultiple backend services\u003C/td\u003E\n\u003Ctd\u003EShared UAuthHub \u002B Resource APIs\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth does not require a complex architecture to get started, and it does not restrict you to a single client as your application grows.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EStart with the simplest deployment that meets your needs. Add new client applications, persistent storage, or separate Resource APIs as your requirements evolve.\u003C/p\u003E\n\u003Cp\u003EThe authentication foundation remains consistent.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EQuickStart\u003C/a\u003E \u2014 Build the minimal in-memory application.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/getting-started/ecosystem\u0022\u003EEcosystem\u003C/a\u003E \u2014 Explore packages and supported integrations.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/server-options\u0022\u003EServer Options\u003C/a\u003E \u2014 Configure server authentication and security behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure application profiles, endpoints, refresh, and reauthentication.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E \u2014 Explore effective options, dependency injection, and extension points.\u003C/li\u003E\n\u003C/ul\u003E\n", + "Html": "\n\u003Cp\u003E\u003Cstrong\u003EOne authentication framework. Different deployment models.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe \u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EQuickStart\u003C/a\u003E demonstrates UltimateAuth with Blazor Server and in-memory storage.\u003C/p\u003E\n\u003Cp\u003EReal applications may require persistent data, a separate authentication server, browser-based clients, or independently deployed APIs.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports these scenarios through different service registrations and hosting integrations. You can choose the architecture that fits your application without configuring every available component.\u003C/p\u003E\n\u003Cp\u003EThis guide covers the setup patterns demonstrated by the UltimateAuth samples.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choose-your-architecture\u0022\u003E1. Choose Your Architecture\u003C/h2\u003E\n\u003Cp\u003EStart by identifying where authentication is hosted and how your application communicates with it.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication architecture\u003C/th\u003E\n\u003Cth\u003EAuthentication host\u003C/th\u003E\n\u003Cth\u003EApplication registration\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server, single project\u003C/td\u003E\n\u003Ctd\u003ESame application\u003C/td\u003E\n\u003Ctd\u003EServer \u002B persistence \u002B Blazor client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server with EF Core\u003C/td\u003E\n\u003Ctd\u003ESame application\u003C/td\u003E\n\u003Ctd\u003EServer \u002B EF Core \u002B Blazor client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDedicated UAuthHub\u003C/td\u003E\n\u003Ctd\u003ESeparate authentication application\u003C/td\u003E\n\u003Ctd\u003EServer \u002B persistence \u002B Hub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EStandalone Blazor WASM\u003C/td\u003E\n\u003Ctd\u003ERemote UAuthHub\u003C/td\u003E\n\u003Ctd\u003EBlazor client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Web App, Interactive WASM\u003C/td\u003E\n\u003Ctd\u003ERemote UAuthHub\u003C/td\u003E\n\u003Ctd\u003EHost integration \u002B WASM client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESeparate Resource API\u003C/td\u003E\n\u003Ctd\u003ERemote UAuthHub\u003C/td\u003E\n\u003Ctd\u003EResource API integration\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese models can be combined.\u003C/p\u003E\n\u003Cp\u003EFor example, an application might use an EF Core-backed UAuthHub, a standalone Blazor WASM frontend, and a separate Resource API.\u003C/p\u003E\n\u003Cp\u003EThe frontend handles user interaction, UAuthHub manages authentication, and the Resource API enforces access to protected resources.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022cryptographic-key-configuration\u0022\u003ECryptographic Key Configuration\u003C/h2\u003E\n\u003Cp\u003EEvery application hosting UltimateAuth Server must configure its cryptographic secrets securely.\u003C/p\u003E\n\u003Cp\u003EThis applies to integrated Blazor Server applications, standalone UAuthHub deployments, and applications using either in-memory or Entity Framework Core persistence.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022required-key-configuration\u0022\u003ERequired key configuration\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ESetting\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.TokenHashingKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHMAC-SHA256 hashing for server-managed token material\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.JwtSigningKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHS256 signing of JWT access tokens\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EBoth settings accept Base64-encoded keys containing at least 32 bytes of cryptographically secure random key material.\u003C/p\u003E\n\u003Cp\u003EPureOpaque does not issue JWT access tokens, but it should still configure the token-hashing key.\u003C/p\u003E\n\u003Cp\u003EHybrid and PureJwt require JWT signing capability.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022recommended-configuration\u0022\u003ERecommended configuration\u003C/h3\u003E\n\u003Cp\u003EStore secrets outside application source code.\u003C/p\u003E\n\u003Cp\u003EFor local development, use .NET User Secrets. For deployed applications, use environment variables or a trusted secret-management service.\u003C/p\u003E\n\u003Cp\u003EEnvironment variable names:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Cryptography__TokenHashingKey\nUltimateAuth__Cryptography__JwtSigningKey\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe double underscore (\u003Ccode\u003E__\u003C/code\u003E) represents a configuration hierarchy separator in .NET environment-variable configuration.\u003C/p\u003E\n\u003Cp\u003EConfigure the server:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;UltimateAuth token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;UltimateAuth JWT signing key is missing.\u0026quot;);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not generate new keys automatically on every application startup. Keys must remain consistent across application instances that share authentication state.\u003C/p\u003E\n\u003Cp\u003ENever use the same key for token hashing and JWT signing.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-verification-keys\u0022\u003EResource API verification keys\u003C/h3\u003E\n\u003Cp\u003EA Resource API using PureJwt validates JWT signatures with trusted verification keys.\u003C/p\u003E\n\u003Cp\u003EThe built-in HS256 configuration uses symmetric cryptography, so the Resource API must be configured with the same JWT key material used by the issuing UAuthHub.\u003C/p\u003E\n\u003Cp\u003EThe Resource API does not require the Hub\u0027s token-hashing key.\u003C/p\u003E\n\u003Cp\u003EProtect JWT verification keys as secrets when using symmetric signing algorithms.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022persistent-storage-with-entity-framework-core\u0022\u003E2. Persistent Storage with Entity Framework Core\u003C/h2\u003E\n\u003Cp\u003EFor applications that need authentication state to survive restarts, use a persistent storage provider.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth provides an Entity Framework Core bundle that registers its reference domain implementations and EF Core-backed stores.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022install-packages\u0022\u003EInstall packages\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle\ndotnet add package Microsoft.EntityFrameworkCore.Sqlite\ndotnet add package Microsoft.EntityFrameworkCore.Design\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe SQLite provider is used here for simplicity. You can use another compatible EF Core database provider.\u003C/p\u003E\n\u003Cp\u003EWhen using the EF Core bundle, you do not need the in-memory bundle.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022register-the-services\u0022\u003ERegister the services\u003C/h3\u003E\n\u003Cp\u003EIn \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing CodeBeam.UltimateAuth.Server.Extensions;\nusing Microsoft.EntityFrameworkCore;\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(\u0026quot;Data Source=uauth.db\u0026quot;, sqlite =\u0026gt; sqlite.MigrationsAssembly(typeof(Program).Assembly.GetName().Name!));\n });\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAddUltimateAuthEntityFrameworkCore()\u003C/code\u003E registers the EF Core stores and reference domain implementations.\u003C/p\u003E\n\u003Cp\u003EThe bundle provides a unified \u003Ccode\u003EUAuthDbContext\u003C/code\u003E for the supported authentication domains.\u003C/p\u003E\n\u003Cp\u003EYou do not need to register each user, session, credential, token, or authorization store individually.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-the-database-connection\u0022\u003EConfigure the database connection\u003C/h3\u003E\n\u003Cp\u003EFor a deployed application, prefer configuration over hardcoded connection strings.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003Eappsettings.json\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;ConnectionStrings\u0026quot;: {\n \u0026quot;UltimateAuth\u0026quot;: \u0026quot;Data Source=uauth.db\u0026quot;\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar connectionString = builder.Configuration.GetConnectionString(\u0026quot;UltimateAuth\u0026quot;)\n ?? throw new InvalidOperationException(\u0026quot;UltimateAuth connection string is missing.\u0026quot;);\n\nbuilder.Services.AddUltimateAuthServer()\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(connectionString);\n });\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor production databases, use your deployment environment\u0027s secret management facilities rather than storing credentials in source control.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022database-migrations\u0022\u003EDatabase migrations\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth does not automatically create or apply migrations when the EF Core bundle is registered.\u003C/p\u003E\n\u003Cp\u003EYour application owns the database migration lifecycle.\u003C/p\u003E\n\u003Cp\u003EInstall the EF Core CLI if necessary:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet tool install --global dotnet-ef\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ECreate the initial migration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet ef migrations add InitUAuth --context UAuthDbContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EApply it:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet ef database update --context UAuthDbContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor Visual Studio Package Manager Console:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EPOWERSHELL\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-powershell\u0022\u003EAdd-Migration InitUAuth -Context UAuthDbContext\nUpdate-Database -Context UAuthDbContext\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EInstall \u003Ccode\u003EMicrosoft.EntityFrameworkCore.Tools\u003C/code\u003E if required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022applying-migrations-programmatically\u0022\u003EApplying migrations programmatically\u003C/h3\u003E\n\u003Cp\u003EThe EF Core samples demonstrate initialization through a scoped \u003Ccode\u003EUAuthDbContext\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor a controlled development environment:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore;\n\nusing (var scope = app.Services.CreateScope())\n{\n var db = scope.ServiceProvider.GetRequiredService\u0026lt;UAuthDbContext\u0026gt;();\n await db.Database.MigrateAsync();\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis applies pending migrations. It does not generate migration files.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EProduction guidance:\u003C/strong\u003E Prefer applying reviewed migrations as a separate deployment step, particularly when multiple application instances share a database.\u003C/p\u003E\n\u003Cp\u003EDo not copy the sample initializer\u0027s \u003Ccode\u003Ereset: true\u003C/code\u003E behavior into production. The samples use database reset functionality for repeatable demonstrations, not as a safe deployment strategy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022optional-sample-accounts-with-ef-core\u0022\u003EOptional: sample accounts with EF Core\u003C/h3\u003E\n\u003Cp\u003EThe sample seed package can also work with EF Core persistence.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Sample.Seed\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister the scoped seed services:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScopedUltimateAuthSampleSeed();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAfter preparing the database:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eif (app.Environment.IsDevelopment())\n{\n await app.SeedUltimateAuthAsync();\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe difference matters:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EAddUltimateAuthSampleSeed()\u003C/code\u003E is used by the in-memory samples.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EAddScopedUltimateAuthSampleSeed()\u003C/code\u003E is used by the EF Core samples.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EDo not deploy the demonstration accounts and passwords to production.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-integrated-authentication\u0022\u003E3. Blazor Server \u2014 Integrated Authentication\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E A Blazor Server application that wants to host its own authentication system.\u003C/p\u003E\n\u003Cp\u003EThis is the simplest deployment model for a server-side Blazor application.\u003C/p\u003E\n\u003Cp\u003EThe application hosts UltimateAuth Server and uses the Blazor client adapter in the same project.\u003C/p\u003E\n\u003Cp\u003EA separate UAuthHub is not required.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022packages\u0022\u003EPackages\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\ndotnet add package CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle\ndotnet add package Microsoft.EntityFrameworkCore.Sqlite\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022services\u0022\u003EServices\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing CodeBeam.UltimateAuth.Server.Extensions;\nusing Microsoft.EntityFrameworkCore;\n\nbuilder.Services\n .AddRazorComponents()\n .AddInteractiveServerComponents();\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(\u0026quot;Data Source=uauth.db\u0026quot;);\n });\n\nbuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pipeline\u0022\u003EPipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseHttpsRedirection();\napp.UseStaticFiles();\n\napp.UseUltimateAuthWithAspNetCore();\napp.UseAntiforgery();\n\napp.MapUltimateAuthEndpoints();\n\napp.MapRazorComponents\u0026lt;App\u0026gt;()\n .AddInteractiveServerRenderMode()\n .AddUltimateAuthRoutes(UAuthAssemblies.BlazorClient());\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAlso configure the \u003Ccode\u003EUAuthApp\u003C/code\u003E root component, login page, and UltimateAuth JavaScript file as demonstrated in QuickStart.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-behavior\u0022\u003EAuthentication behavior\u003C/h3\u003E\n\u003Cp\u003EThe default application profile resolution selects \u003Ccode\u003EPureOpaque\u003C/code\u003E for Blazor Server.\u003C/p\u003E\n\u003Cp\u003EThis uses session-oriented authentication rather than requiring the application to manage access and refresh tokens manually.\u003C/p\u003E\n\u003Cp\u003EYou can configure session lifetimes, login policies, credential policies, and other behavior through \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Session.Lifetime = TimeSpan.FromDays(7);\n options.Identifiers.Behavior.AllowMultipleUsernames = true;\n options.Password.Level = PasswordPolicyLevel.Strict;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe effective authentication mode is resolved at runtime. The application does not need to select a single mode globally.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022password-security-configuration\u0022\u003EPassword Security Configuration\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth uses the Standard password policy by default. Applications can select Basic or Strict, or override individual requirements through \u003Ccode\u003Eoptions.Password\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor the preset comparison, configuration examples, and password-history settings, see \u003Ca href=\u0022/docs/security/password-policy\u0022\u003EPassword Policy \u0026amp; History\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022uauthhub-dedicated-authentication-server\u0022\u003E4. UAuthHub \u2014 Dedicated Authentication Server\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E Applications where multiple clients share one authentication authority.\u003C/p\u003E\n\u003Cp\u003EUAuthHub hosts UltimateAuth\u0027s authentication services separately from your frontend applications.\u003C/p\u003E\n\u003Cp\u003EIt is particularly relevant for standalone WASM applications, Interactive WASM applications, and systems with separate Resource APIs.\u003C/p\u003E\n\u003Cp\u003EA typical architecture looks like this:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Standalone WASM Interactive WASM\n \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u25BC\n UAuthHub\n Authentication\n Sessions \u0026amp; Users\n \u2502\n \u25BC\n Persistence\n\n Resource API \u2500\u2500\u2500\u25BA UAuthHub\n (validation)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022create-the-hub-application\u0022\u003ECreate the Hub application\u003C/h3\u003E\n\u003Cp\u003EA UAuthHub can be hosted in an ASP.NET Core Blazor Server application.\u003C/p\u003E\n\u003Cp\u003EThe current samples use Blazor Server to provide the Hub\u0027s login UI.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022in-memory-uauthhub\u0022\u003EIn-memory UAuthHub\u003C/h3\u003E\n\u003Cp\u003EFor development:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\ndotnet add package CodeBeam.UltimateAuth.InMemory.Bundle\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.InMemory;\nusing CodeBeam.UltimateAuth.Server.Extensions;\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthInMemory()\n .AddUAuthHub(options =\u0026gt;\n {\n options.AllowedClientOrigins.Add(\u0026quot;https://localhost:6130\u0026quot;);\n });\n\nbuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Hub\u0027s Blazor client registration is needed when the Hub itself hosts UltimateAuth-powered Blazor pages and login UI.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ef-core-uauthhub\u0022\u003EEF Core UAuthHub\u003C/h3\u003E\n\u003Cp\u003EFor persistent storage:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore;\n\nbuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey =\n builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n})\n .AddUltimateAuthEntityFrameworkCore(db =\u0026gt;\n {\n db.UseSqlite(\u0026quot;Data Source=uauthhub.db\u0026quot;);\n })\n .AddUAuthHub(options =\u0026gt;\n {\n options.AllowedClientOrigins.Add(\u0026quot;https://localhost:6132\u0026quot;);\n });\n\nbuilder.Services.AddUltimateAuthClientBlazor();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe \u003Ccode\u003EAllowedClientOrigins\u003C/code\u003E collection identifies browser origins permitted to interact with the Hub.\u003C/p\u003E\n\u003Cp\u003EUse exact origins, including scheme and port. Do not include paths such as \u003Ccode\u003E/home\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hub-pipeline\u0022\u003EHub pipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseHttpsRedirection();\n\napp.UseUltimateAuthWithAspNetCore();\napp.UseAntiforgery();\n\napp.MapUltimateAuthEndpoints();\napp.MapUAuthHub();\n\napp.MapStaticAssets();\n\napp.MapRazorComponents\u0026lt;App\u0026gt;()\n .AddInteractiveServerRenderMode()\n .AddUltimateAuthRoutes(UAuthAssemblies.BlazorClient());\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EMapUltimateAuthEndpoints()\u003C/code\u003E maps the authentication endpoints.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EMapUAuthHub()\u003C/code\u003E maps the Hub-specific entry endpoint.\u003C/p\u003E\n\u003Cp\u003EBoth registrations are used by the current UAuthHub samples.\u003C/p\u003E\n\u003Cp\u003EThe Hub also needs its login page and Blazor application lifecycle components.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-origins\u0022\u003EChoosing origins\u003C/h3\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication\u003C/th\u003E\n\u003Cth\u003EURL\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUAuthHub\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ehttps://localhost:6112\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EStandalone WASM\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ehttps://localhost:6130\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EInteractive WASM\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Ehttps://localhost:6132\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EConfigure the Hub\u0027s allowed origins for the actual frontend applications it serves.\u003C/p\u003E\n\u003Cp\u003EThese localhost addresses are illustrative and must match your deployment.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-standalone-webassembly\u0022\u003E5. Blazor Standalone WebAssembly\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E A browser-hosted application with a separate UAuthHub.\u003C/p\u003E\n\u003Cp\u003EStandalone Blazor WASM runs in the browser. It does not host UltimateAuth Server or database persistence.\u003C/p\u003E\n\u003Cp\u003EAuthentication is handled by the remote UAuthHub.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-packages\u0022\u003EClient packages\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-services\u0022\u003EConfigure services\u003C/h3\u003E\n\u003Cp\u003EIn the standalone WASM application\u0027s \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.Core.Domain;\n\nvar builder = WebAssemblyHostBuilder.CreateDefault(args);\n\nbuilder.RootComponents.Add\u0026lt;App\u0026gt;(\u0026quot;#app\u0026quot;);\nbuilder.RootComponents.Add\u0026lt;HeadOutlet\u0026gt;(\u0026quot;head::after\u0026quot;);\n\nbuilder.Services.AddScoped(sp =\u0026gt; new HttpClient\n{\n BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)\n});\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6110/auth\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;https://localhost:6130/home\u0026quot;;\n options.Login.AllowCredentialPost = true;\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\nawait builder.Build().RunAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe current standalone WASM sample explicitly configures \u003Ccode\u003ELogin.AllowCredentialPost\u003C/code\u003E and the PKCE return URL.\u003C/p\u003E\n\u003Cp\u003EThese are client-side settings. The UAuthHub must be configured independently.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022what-the-urls-mean\u0022\u003EWhat the URLs mean\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E points to the remote authentication endpoints.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EPkce.ReturnUrl\u003C/code\u003E identifies the frontend destination used by the relevant PKCE flow.\u003C/p\u003E\n\u003Cp\u003EThe Hub must recognize the frontend\u0027s origin, and any return URL used in an authentication flow must be validated against the application\u0027s security policy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022root-component\u0022\u003ERoot component\u003C/h3\u003E\n\u003Cp\u003EA standalone WASM application should initialize UltimateAuth through \u003Ccode\u003EUAuthApp\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor example, its root application or routing component can contain:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client.Blazor\n\n\u0026lt;UAuthApp UseBuiltInRouter=\u0026quot;true\u0026quot; AppAssembly=\u0026quot;typeof(Program).Assembly\u0026quot; DefaultLayout=\u0026quot;typeof(Layout.MainLayout)\u0026quot; /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EInclude the UltimateAuth JavaScript asset in the application\u0027s HTML host page.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-modes-and-signing-keys\u0022\u003EAuthentication modes and signing keys\u003C/h3\u003E\n\u003Cp\u003EA single UAuthHub can issue different authentication credentials according to the resolved application profile and server configuration.\u003C/p\u003E\n\u003Cp\u003EBlazor Server defaults to PureOpaque. All other application profiles default to Hybrid under the built-in authentication mode resolver.\u003C/p\u003E\n\u003Cp\u003EPureJwt must be explicitly selected when independent JWT-based authentication is required.\u003C/p\u003E\n\u003Cp\u003EUAuthHub and Resource APIs must be configured with compatible authentication modes and credential transports.\u003C/p\u003E\n\u003Cp\u003EJWT-enabled modes require a signing key. The UAuthHub remains responsible for protecting that key and issuing trusted access tokens.\u003C/p\u003E\n\u003Cp\u003EFor PureJwt, refresh-token persistence is still required even though authentication sessions are not created.\u003C/p\u003E\n\u003Cp\u003EA separate Resource API does not automatically inherit the authentication mode or cryptographic configuration of UAuthHub.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-web-app-interactive-webassembly\u0022\u003E6. Blazor Web App \u2014 Interactive WebAssembly\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E A Blazor Web App with an ASP.NET Core host and a separate \u003Ccode\u003E.Client\u003C/code\u003E project.\u003C/p\u003E\n\u003Cp\u003EThis scenario differs from standalone WASM because components may participate in both server-side rendering and browser-side interactivity.\u003C/p\u003E\n\u003Cp\u003EThe current UltimateAuth sample registers the Blazor client integration in \u003Cstrong\u003Eboth projects\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EIt also adds a separate ASP.NET Core compatibility registration in the host.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022project-structure\u0022\u003EProject structure\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EMyApplication/\n\u251C\u2500\u2500 MyApplication/\n\u2502 \u251C\u2500\u2500 Program.cs\n\u2502 \u2514\u2500\u2500 Components/\n\u2502 \u2514\u2500\u2500 App.razor\n\u2502\n\u2514\u2500\u2500 MyApplication.Client/\n \u251C\u2500\u2500 Program.cs\n \u2514\u2500\u2500 Pages/\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe host serves the application.\u003C/p\u003E\n\u003Cp\u003EThe \u003Ccode\u003E.Client\u003C/code\u003E project contains browser-executed components and services.\u003C/p\u003E\n\u003Cp\u003EA remote UAuthHub manages authentication.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022host-project-packages\u0022\u003E6.1 Host project packages\u003C/h3\u003E\n\u003Cp\u003EInstall the Blazor client integration and ASP.NET Core compatibility package in the host:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\ndotnet add package CodeBeam.UltimateAuth.Client.AspNetCore\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022host-project-services\u0022\u003E6.2 Host project services\u003C/h3\u003E\n\u003Cp\u003EIn the host \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.AspNetCore;\nusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.Core.Domain;\n\nbuilder.Services\n .AddRazorComponents()\n .AddInteractiveWebAssemblyComponents();\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;https://localhost:6132/home\u0026quot;;\n options.Login.AllowCredentialPost = true;\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\nbuilder.Services.AddUltimateAuthAspNetCoreCompatibility();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAddUltimateAuthAspNetCoreCompatibility()\u003C/code\u003E registers the compatibility authentication scheme and ASP.NET Core authorization services used by this hosting pattern.\u003C/p\u003E\n\u003Cp\u003EIt does \u003Cstrong\u003Enot\u003C/strong\u003E turn the host into an UltimateAuth authentication server.\u003C/p\u003E\n\u003Cp\u003EIt is also not equivalent to \u003Ccode\u003EAddUltimateAuthResourceApi()\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022host-project-pipeline\u0022\u003E6.3 Host project pipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseHttpsRedirection();\n\napp.UseAntiforgery();\n\napp.MapStaticAssets();\n\napp.MapRazorComponents\u0026lt;App\u0026gt;()\n .AddInteractiveWebAssemblyRenderMode()\n .AddAdditionalAssemblies(typeof(MyApplication.Client._Imports).Assembly, UAuthAssemblies.BlazorClient().First());\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EReplace \u003Ccode\u003EMyApplication.Client._Imports\u003C/code\u003E with the corresponding type from your client project.\u003C/p\u003E\n\u003Cp\u003EThe additional assemblies allow the host to discover routable components from the WASM client project and UltimateAuth\u0027s Blazor client assembly.\u003C/p\u003E\n\u003Cp\u003EThe sample does not register \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E in this host because authentication is delegated to a separate UAuthHub.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-project-packages\u0022\u003E6.4 Client project packages\u003C/h3\u003E\n\u003Cp\u003EInstall the Blazor client adapter in the \u003Ccode\u003E.Client\u003C/code\u003E project:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Client.Blazor\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-project-services\u0022\u003E6.5 Client project services\u003C/h3\u003E\n\u003Cp\u003EIn \u003Ccode\u003EMyApplication.Client/Program.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client.Blazor.Extensions;\nusing CodeBeam.UltimateAuth.Core.Domain;\n\nvar builder = WebAssemblyHostBuilder.CreateDefault(args);\n\nbuilder.Services.AddScoped(sp =\u0026gt; new HttpClient\n{\n BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)\n});\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n options.Pkce.ReturnUrl = \u0026quot;https://localhost:6132/home\u0026quot;;\n options.Login.AllowCredentialPost = true;\n options.Reauth.Behavior = ReauthBehavior.RaiseEvent;\n});\n\nawait builder.Build().RunAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe host and client configurations should agree on the remote UAuthHub URL and authentication flow settings.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022why-both-registrations-are-necessary\u0022\u003EWhy both registrations are necessary\u003C/h3\u003E\n\u003Cp\u003EThe host and browser client have separate dependency injection containers.\u003C/p\u003E\n\u003Cp\u003ERegistering \u003Ccode\u003EAddUltimateAuthClientBlazor()\u003C/code\u003E in the host does not automatically register those services inside the WebAssembly runtime.\u003C/p\u003E\n\u003Cp\u003ELikewise, registering the client adapter only in the \u003Ccode\u003E.Client\u003C/code\u003E project does not supply the services required during server-side integration.\u003C/p\u003E\n\u003Cp\u003EThe additional ASP.NET Core compatibility registration addresses the host\u0027s ASP.NET Core authentication and authorization integration requirements.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E This compatibility layer is not a replacement for server-side authorization of your protected business APIs.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-separate-protected-backend\u0022\u003E7. Resource API \u2014 Separate Protected Backend\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBest for:\u003C/strong\u003E An API that needs UltimateAuth authentication validation but does not host the authentication system itself.\u003C/p\u003E\n\u003Cp\u003EA Resource API can be an ASP.NET Core Web API, MVC application, or another supported server-side application.\u003C/p\u003E\n\u003Cp\u003EIt does not need to be a Blazor application.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022architecture\u0022\u003EArchitecture\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Blazor Client\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC\n UAuthHub Resource API\n \u25B2 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n Authentication\n validation\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource API uses the configured UAuthHub for remote authentication and session validation behavior.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022install-the-server-integration-package\u0022\u003EInstall the server integration package\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EBash\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-bash\u0022\u003Edotnet add package CodeBeam.UltimateAuth.Server\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-services-1\u0022\u003EConfigure services\u003C/h3\u003E\n\u003Ch4 id=\u0022hybrid-resource-api\u0022\u003EHybrid Resource API\u003C/h4\u003E\n\u003Cp\u003EHybrid is the default authentication mode for Resource APIs.\u003C/p\u003E\n\u003Cp\u003EThe current Hybrid Resource API implementation authenticates requests using opaque session credentials and validates those sessions through UAuthHub.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar builder = WebApplication.CreateBuilder(args);\n\nbuilder.Services.AddControllers();\n\nbuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.Hub.BaseUrl = \u0026quot;https://auth.example.com\u0026quot;;\n options.Cors.AllowedOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n});\n\nvar app = builder.Build();\n\napp.UseHttpsRedirection();\napp.UseUltimateAuthResourceApiWithAspNetCore();\n\napp.MapControllers();\napp.Run();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EHub.BaseUrl\u003C/code\u003E is the base address of the authentication server.\u003C/p\u003E\n\u003Cp\u003EThe default incoming session credential transport is cookie-based.\u003C/p\u003E\n\u003Cp\u003EThe browser must be able to send the session cookie to the Resource API. Compatible cookie scope, deployment topology, and CORS configuration are required.\u003C/p\u003E\n\u003Cp\u003EThe Resource API forwards the selected session credential and device context to UAuthHub for validation.\u003C/p\u003E\n\u003Cp\u003EHybrid-aware JWT access-token validation is not yet supported by separate Resource APIs.\u003C/p\u003E\n\u003Ch4 id=\u0022purejwt-resource-api\u0022\u003EPureJwt Resource API\u003C/h4\u003E\n\u003Cp\u003ESelect PureJwt explicitly when the Resource API should validate JWT access tokens independently of UAuthHub.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E Resource API\u0027s \u003Ccode\u003EProgram.cs\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar builder = WebApplication.CreateBuilder(args);\n\nbuilder.Services.AddControllers();\n\nbuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.Auth.Jwt = new UAuthJwtValidationOptions\n {\n Issuer = \u0026quot;https://auth.example.com\u0026quot;,\n Audience = \u0026quot;products-api\u0026quot;,\n ValidAlgorithms = [SecurityAlgorithms.HmacSha256]\n };\n\n options.Cryptography.JwtVerificationKeys.Add(\n new UAuthJwtVerificationKeyOptions\n {\n KeyId = \u0026quot;uauth-hs256-v1\u0026quot;,\n Key = builder.Configuration[\u0026quot;UltimateAuth:JwtVerificationKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT verification key is missing.\u0026quot;)\n });\n\n options.Auth.Mode = UAuthMode.PureJwt;\n\n options.Cors.AllowedOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\n});\n\nvar app = builder.Build();\n\napp.UseHttpsRedirection();\napp.UseUltimateAuthResourceApiWithAspNetCore();\n\napp.MapControllers();\napp.Run();\n\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ENotice that this example uses the Hub origin without the \u003Ccode\u003E/auth\u003C/code\u003E suffix, matching the current Resource API samples.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedOrigins\u003C/code\u003E controls the browser origins permitted by the Resource API\u0027s CORS configuration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-the-pipeline\u0022\u003EConfigure the pipeline\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar app = builder.Build();\n\napp.UseHttpsRedirection();\n\napp.UseUltimateAuthResourceApiWithAspNetCore();\n\napp.MapControllers();\n\napp.Run();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EUseUltimateAuthResourceApiWithAspNetCore()\u003C/code\u003E installs the Resource API integration middleware together with ASP.NET Core authentication and authorization middleware.\u003C/p\u003E\n\u003Cp\u003EYou do not need to register a local UltimateAuth Server or its persistence bundle in the Resource API.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022protecting-endpoints\u0022\u003EProtecting endpoints\u003C/h3\u003E\n\u003Cp\u003EUse ASP.NET Core authorization attributes for endpoints that require authentication:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Mvc;\n\n[ApiController]\n[Route(\u0026quot;api/products\u0026quot;)]\npublic class ProductsController : ControllerBase\n{\n [HttpGet]\n [Authorize]\n public IActionResult GetProducts()\n {\n return Ok(new[]\n {\n new { Id = 1, Name = \u0026quot;Example product\u0026quot; }\n });\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe authorization attribute is enforced by ASP.NET Core on the server.\u003C/p\u003E\n\u003Cp\u003EFor permission-specific rules, configure and apply the corresponding authorization policies.\u003C/p\u003E\n\u003Cp\u003EDo not rely on Blazor UI authorization checks to protect Resource API endpoints.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022account-status-enforcement\u0022\u003EAccount Status Enforcement\u003C/h3\u003E\n\u003Cp\u003EProtected Resource API endpoints enforce active-user authorization by default, including endpoints using \u003Ccode\u003E[Authorize]\u003C/code\u003E and role-based authorization.\u003C/p\u003E\n\u003Cp\u003EThe Resource API obtains the current user status through trusted UAuthHub session validation. Suspended and SelfSuspended users remain authenticated but cannot access ordinary protected resources.\u003C/p\u003E\n\u003Cp\u003ETo allow specific operations for suspended users, explicitly apply \u003Ccode\u003E[UAuthAllowInactive]\u003C/code\u003E alongside \u003Ccode\u003E[Authorize]\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe exception does not bypass other authorization requirements.\u003C/p\u003E\n\u003Cp\u003EFor the complete behavior and examples, see \u003Ca href=\u0022/docs/plugin-domains/authorization\u0022\u003EAuthorization\u003C/a\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022cors-configuration\u0022\u003ECORS configuration\u003C/h3\u003E\n\u003Cp\u003EThe current Resource API integration registers CORS from the configured allowed origins.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AllowedClientOrigins.Add(\u0026quot;https://localhost:6132\u0026quot;);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EOnly add origins that should be allowed to call your API from a browser.\u003C/p\u003E\n\u003Cp\u003ECORS is a browser access control mechanism, not an authentication or authorization mechanism.\u003C/p\u003E\n\u003Cp\u003EA request must still pass the applicable authentication and authorization checks.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-vs-uauthhub\u0022\u003EResource API vs UAuthHub\u003C/h3\u003E\n\u003Cp\u003EThese are different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EUAuthHub\u003C/th\u003E\n\u003Cth\u003EResource API\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHosts authentication flows\u003C/td\u003E\n\u003Ctd\u003EHosts application resources\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EManages authentication sessions\u003C/td\u003E\n\u003Ctd\u003EValidates remote authentication context\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EUses authentication persistence\u003C/td\u003E\n\u003Ctd\u003EDoes not require local authentication stores\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EProvides login and related endpoints\u003C/td\u003E\n\u003Ctd\u003EProvides application endpoints\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EServes authentication clients\u003C/td\u003E\n\u003Ctd\u003EServes authorized API consumers\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EUse a Resource API when you want independent deployment of business endpoints without duplicating the authentication server.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-with-an-ef-core-backed-uauthhub\u0022\u003E8. Resource API with an EF Core-Backed UAuthHub\u003C/h2\u003E\n\u003Cp\u003EThe Resource API does not need to use EF Core just because UAuthHub does.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EInteractive WASM\n \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25BA Resource API\n \u2502\n \u25BC\n UAuthHub\n \u2502\n \u25BC\n EF Core Database\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Hub stores users, credentials, sessions, and related security state in its database.\u003C/p\u003E\n\u003Cp\u003EThe Resource API communicates with the Hub through the configured remote validation integration.\u003C/p\u003E\n\u003Cp\u003EIts registration remains:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.UAuthHubBaseUrl = \u0026quot;https://localhost:6112\u0026quot;;\n options.AllowedClientOrigins.Add(\u0026quot;https://localhost:6132\u0026quot;);\n options.CorsPolicyName = \u0026quot;resourceApi\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis separation allows the API and authentication infrastructure to be deployed, scaled, and maintained independently.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022calling-a-resource-api-from-blazor\u0022\u003E9. Calling a Resource API from Blazor\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth provides a unified Resource Client for accessing protected application APIs.\u003C/p\u003E\n\u003Cp\u003EInstead of configuring a separate HTTP client and implementing browser credential handling for ordinary resource requests, applications can use \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThis keeps authentication, identity operations, and application resource requests accessible through the same client SDK.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configure-the-resource-api\u0022\u003EConfigure the Resource API\u003C/h3\u003E\n\u003Cp\u003EFor a separate Resource API, configure its origin through the Blazor client registration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\n\nbuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n\n options.Resource.BaseAddress = \u0026quot;https://localhost:6122\u0026quot;;\n options.Resource.Credentials = UAuthResourceCredentialsMode.Auto;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EEndpoints.BasePath\u003C/code\u003E identifies the authentication server.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EResource.BaseAddress\u003C/code\u003E identifies the application Resource API.\u003C/p\u003E\n\u003Cp\u003EThese addresses can point to different applications.\u003C/p\u003E\n\u003Cp\u003EIf the Resource API shares the application\u0027s origin, \u003Ccode\u003EResource.BaseAddress\u003C/code\u003E can remain \u003Ccode\u003Enull\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022call-protected-resources\u0022\u003ECall Protected Resources\u003C/h3\u003E\n\u003Cp\u003EInject \u003Ccode\u003EIUAuthClient\u003C/code\u003E into a Blazor component:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E@using CodeBeam.UltimateAuth.Client\n@inject IUAuthClient UAuthClient\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen retrieve application data:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is not null)\n{\n products = result.Value;\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe Resource Client also supports POST, PUT, PATCH, and DELETE operations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-specific-api-services\u0022\u003EApplication-Specific API Services\u003C/h3\u003E\n\u003Cp\u003EApplications can organize resource operations into small domain-specific services.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing CodeBeam.UltimateAuth.Client;\nusing CodeBeam.UltimateAuth.Core.Contracts;\n\npublic sealed class ProductApiService(IUAuthClient client)\n{\n public Task\u0026lt;UAuthResult\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;\u0026gt; GetAllAsync()\n =\u0026gt; client.Resource.GetAsync\u0026lt;List\u0026lt;Product\u0026gt;\u0026gt;(\u0026quot;/api/products\u0026quot;);\n\n public Task\u0026lt;UAuthResult\u0026lt;Product\u0026gt;\u0026gt; CreateAsync(Product product)\n =\u0026gt; client.Resource.PostAsync\u0026lt;Product\u0026gt;(\u0026quot;/api/products\u0026quot;,product);\n\n public Task\u0026lt;UAuthResult\u0026gt; DeleteAsync(int id)\n =\u0026gt; client.Resource.DeleteAsync($\u0026quot;/api/products/{id}\u0026quot;);\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERegister the application service:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddScoped\u0026lt;ProductApiService\u0026gt;();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe service uses UltimateAuth\u0027s transport and result contracts rather than implementing another HTTP abstraction.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022interactive-webassembly\u0022\u003EInteractive WebAssembly\u003C/h3\u003E\n\u003Cp\u003EIn an Interactive WebAssembly application, configure the UltimateAuth Blazor client in each project where the Resource Client will be used.\u003C/p\u003E\n\u003Cp\u003EThe host and \u003Ccode\u003E.Client\u003C/code\u003E project have separate dependency injection containers.\u003C/p\u003E\n\u003Cp\u003EA shared application API service may be registered in both projects when components execute in both environments.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client uses browser-based transport, including when invoked from an interactive Blazor Server component.\u003C/p\u003E\n\u003Cp\u003EBrowser interop must be available before making resource requests. Do not initiate browser-dependent resource requests during static prerendering.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022standalone-webassembly\u0022\u003EStandalone WebAssembly\u003C/h3\u003E\n\u003Cp\u003EStandalone Blazor WebAssembly applications use the same Resource Client API.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthClientBlazor(options =\u0026gt;\n{\n options.Endpoints.BasePath = \u0026quot;https://localhost:6112/auth\u0026quot;;\n options.Resource.BaseAddress = \u0026quot;https://localhost:6122\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EOnce configured, application components can call protected resources through \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EA separate application-specific \u003Ccode\u003EHttpClient\u003C/code\u003E is not required for these requests.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022browser-credentials-and-cors\u0022\u003EBrowser Credentials and CORS\u003C/h3\u003E\n\u003Cp\u003EFor cross-origin requests, the browser and receiving API must agree on credential handling.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client supports \u003Ccode\u003EAuto\u003C/code\u003E, \u003Ccode\u003ESameOrigin\u003C/code\u003E, \u003Ccode\u003EInclude\u003C/code\u003E, and \u003Ccode\u003EOmit\u003C/code\u003E credential policies.\u003C/p\u003E\n\u003Cp\u003EFor cross-origin cookie-based authentication, configure the appropriate credential policy and ensure that the Resource API supports the required CORS and cookie settings.\u003C/p\u003E\n\u003Cp\u003EThe Resource Client does not automatically make an API authenticated merely because the user has signed in through UAuthHub.\u003C/p\u003E\n\u003Cp\u003EThe receiving API must validate the authentication material associated with the configured authentication mode and enforce its authorization policies.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022blazor-server-and-direct-service-calls\u0022\u003EBlazor Server and Direct Service Calls\u003C/h3\u003E\n\u003Cp\u003EBlazor Server applications can often access application services directly when those services are hosted in the same process.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar products = await productService.GetAllAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThere is no need to introduce an HTTP request solely to use the Resource Client.\u003C/p\u003E\n\u003Cp\u003EUse \u003Ccode\u003EIUAuthClient.Resource\u003C/code\u003E when the application actually needs to communicate with a protected Resource API through the browser.\u003C/p\u003E\n\u003Cp\u003EFor server-to-server requests, use an appropriate server-side HTTP client and authentication mechanism.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022learn-more\u0022\u003ELearn More\u003C/h3\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/client-sdk/resource-api-requests\u0022\u003EResource API Requests\u003C/a\u003E for supported operations, result handling, credential configuration, security considerations, and request cancellation.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-modes-and-application-profiles\u0022\u003E10. Authentication Modes and Application Profiles\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth separates \u003Cstrong\u003Eapplication profile detection\u003C/strong\u003E from \u003Cstrong\u003Eauthentication mode enforcement\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThe default resolver maps application profiles to authentication modes.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EApplication profile\u003C/th\u003E\n\u003Cth\u003EDefault resolved mode\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor Server\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EBlazor WASM\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EWeb Server\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMAUI\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EHybrid\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAPI\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThis mapping describes the resolver\u0027s behavior, not a guarantee that every mode is currently fully supported by the server.\u003C/p\u003E\n\u003Cp\u003EPureOpaque, Hybrid, and PureJwt are implemented authentication modes.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid remains reserved for future implementation.\u003C/p\u003E\n\u003Cp\u003EHybrid Resource APIs currently support session-based authentication. PureJwt Resource APIs support independent JWT validation.\u003C/p\u003E\n\u003Cp\u003EApplications must explicitly configure compatible authentication modes when the built-in defaults do not match their architecture.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022restrict-allowed-modes\u0022\u003ERestrict allowed modes\u003C/h3\u003E\n\u003Cp\u003EOn the authentication server:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AllowedModes =\n [\n UAuthMode.PureOpaque,\n UAuthMode.Hybrid\n ];\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E is a guardrail.\u003C/p\u003E\n\u003Cp\u003EIt does not select a mode for every request.\u003C/p\u003E\n\u003Cp\u003EThe effective mode is resolved from the application profile and then checked against the server\u0027s allowed-mode policy.\u003C/p\u003E\n\u003Cp\u003EFor most applications, use the default mode resolution unless you have a specific integration requirement.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-options-for-real-applications\u0022\u003E11. Server Options for Real Applications\u003C/h2\u003E\n\u003Cp\u003EProduction configuration should reflect your application\u0027s security requirements.\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.MaxFailedAttempts = 5;\n options.Login.LockoutDuration = TimeSpan.FromMinutes(15);\n options.Identifiers.Behavior.AllowMultipleUsernames = true;\n options.UserProfile.EnableMultiProfile = false;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EServer options also compose the Core-defined login, session, token, PKCE, and multi-tenant options.\u003C/p\u003E\n\u003Cp\u003EConfigure those through \u003Ccode\u003EAddUltimateAuthServer()\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EDo not independently configure Core options and assume the server will automatically use them.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022configuration-files\u0022\u003EConfiguration files\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth also supports configuration through \u003Ccode\u003Eappsettings.json\u003C/code\u003E.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EJSON\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-json\u0022\u003E{\n \u0026quot;UltimateAuth\u0026quot;: {\n \u0026quot;Server\u0026quot;: {\n \u0026quot;Login\u0026quot;: {\n \u0026quot;MaxFailedAttempts\u0026quot;: 5,\n \u0026quot;LockoutDuration\u0026quot;: \u0026quot;00:15:00\u0026quot;\n }\n }\n }\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe server options registration binds the \u003Ccode\u003EUltimateAuth:Server\u003C/code\u003E configuration section.\u003C/p\u003E\n\u003Cp\u003ERemember that effective mode defaults and mode-specific overrides are applied after the base options have been configured.\u003C/p\u003E\n\u003Cp\u003EFor detailed configuration behavior, see Server Options and Advanced Configuration.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-ip-address-reverse-proxy\u0022\u003E12. Client IP Address \u0026amp; Reverse Proxy\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses ASP.NET Core\u0027s resolved client IP address for device information and IP-based rate limiting. It does not directly trust \u003Ccode\u003EX-Forwarded-For\u003C/code\u003E or \u003Ccode\u003ECF-Connecting-IP\u003C/code\u003E headers.\u003C/p\u003E\n\u003Cp\u003EIf your application runs behind Caddy, Nginx, or another reverse proxy, configure ASP.NET Core to trust that proxy.\u003C/p\u003E\n\u003Cp\u003EIn \u003Ccode\u003EProgram.cs\u003C/code\u003E, before \u003Ccode\u003Ebuilder.Build()\u003C/code\u003E:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eusing System.Net;\nusing Microsoft.AspNetCore.HttpOverrides;\n\nbuilder.Services.Configure\u0026lt;ForwardedHeadersOptions\u0026gt;(options =\u0026gt;\n{\n options.ForwardedHeaders =\n ForwardedHeaders.XForwardedFor |\n ForwardedHeaders.XForwardedProto;\n\n // Replace with your actual Caddy or Nginx proxy IP.\n options.KnownProxies.Add(IPAddress.Parse(\u0026quot;172.20.0.5\u0026quot;));\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen enable the middleware \u003Cstrong\u003Ebefore\u003C/strong\u003E UltimateAuth and HTTPS redirection:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseForwardedHeaders();\n\napp.UseHttpsRedirection();\napp.UseUltimateAuthWithAspNetCore();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe example IP \u003Ccode\u003E172.20.0.5\u003C/code\u003E represents a trusted reverse proxy, not the visitor\u0027s IP address. Replace it with your actual proxy IP. For Docker deployments, ensure the proxy address is stable or configure a narrowly scoped trusted network.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E Never trust arbitrary forwarded headers or clear the trusted proxy lists to accept all sources. If your application connects directly to Kestrel without a reverse proxy, no forwarded headers configuration is required.\u003C/p\u003E\n\u003Cp\u003EFor multi-proxy deployments, configure the complete trusted proxy chain and forwarding behavior according to your infrastructure.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022development-and-production-differences\u0022\u003E13. Development and Production Differences\u003C/h2\u003E\n\u003Cp\u003EThe samples intentionally prioritize visibility and repeatability.\u003C/p\u003E\n\u003Cp\u003EA production application needs additional safeguards.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EArea\u003C/th\u003E\n\u003Cth\u003ESample or development\u003C/th\u003E\n\u003Cth\u003EProduction\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EPersistence\u003C/td\u003E\n\u003Ctd\u003EInMemory or local SQLite\u003C/td\u003E\n\u003Ctd\u003EDurable database\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESeed accounts\u003C/td\u003E\n\u003Ctd\u003EExample users and passwords\u003C/td\u003E\n\u003Ctd\u003EReal provisioning\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDatabase initialization\u003C/td\u003E\n\u003Ctd\u003EMay reset sample data\u003C/td\u003E\n\u003Ctd\u003EReviewed migrations\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHTTPS\u003C/td\u003E\n\u003Ctd\u003ELocal development certificate\u003C/td\u003E\n\u003Ctd\u003EProper TLS termination\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECORS\u003C/td\u003E\n\u003Ctd\u003ELocalhost origins\u003C/td\u003E\n\u003Ctd\u003EExact trusted origins\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESigning keys\u003C/td\u003E\n\u003Ctd\u003EDevelopment defaults\u003C/td\u003E\n\u003Ctd\u003EManaged, persistent keys\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDiagnostics\u003C/td\u003E\n\u003Ctd\u003EDetailed debugging\u003C/td\u003E\n\u003Ctd\u003ERestrict sensitive diagnostics\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECredential recovery\u003C/td\u003E\n\u003Ctd\u003EDevelopment notifier\u003C/td\u003E\n\u003Ctd\u003EReal secure notification channel\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EIdentifier verification\u003C/td\u003E\n\u003Ctd\u003EDevelopment bypass\u003C/td\u003E\n\u003Ctd\u003EProof-based verification\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ESecrets\u003C/td\u003E\n\u003Ctd\u003ELocal settings\u003C/td\u003E\n\u003Ctd\u003ESecure configuration provider\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe sample projects include development-only implementations for credential reset notifications and identifier verification.\u003C/p\u003E\n\u003Cp\u003EThose implementations demonstrate extension points and should not be treated as production verification systems.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-recovery\u0022\u003ECredential recovery\u003C/h3\u003E\n\u003Cp\u003EIf your application exposes credential recovery, configure a real implementation of the credential reset notifier.\u003C/p\u003E\n\u003Cp\u003ERecovery secrets must be delivered through an appropriate channel and must not be exposed directly through anonymous API responses.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-verification\u0022\u003EIdentifier verification\u003C/h3\u003E\n\u003Cp\u003EIf your application supports verified email addresses, phone numbers, or other identifiers, use an implementation that verifies ownership through suitable proof.\u003C/p\u003E\n\u003Cp\u003EDo not use a development bypass verifier in production.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022signing-keys\u0022\u003ESigning keys\u003C/h3\u003E\n\u003Cp\u003EConfigure persistent signing keys for authentication modes that issue JWTs.\u003C/p\u003E\n\u003Cp\u003EDevelopment signing key providers are not a substitute for production key management.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022deployment-checklist\u0022\u003E14. Deployment Checklist\u003C/h2\u003E\n\u003Cp\u003EBefore deploying, verify the following:\u003C/p\u003E\n\u003Cul class=\u0022contains-task-list\u0022\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E The selected architecture matches the actual client hosting model.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E The authentication server uses appropriate persistent storage.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Database migrations have been reviewed and applied.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Sample users and development-only verification services are disabled.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Production signing keys and secrets are configured.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E HTTPS is enforced at the appropriate boundary.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E UAuthHub and Resource API origins are explicitly configured.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Authentication endpoints and application endpoints are protected appropriately.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Client and server endpoint URLs match the deployment.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Session expiration, refresh, logout, and revocation have been tested.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Protected resources enforce server-side authorization.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Reverse proxy headers are configured correctly if applicable.\u003C/li\u003E\n\u003Cli class=\u0022task-list-item\u0022\u003E\u003Cinput disabled=\u0022disabled\u0022 type=\u0022checkbox\u0022\u003E Authentication state and persistence survive the expected application lifecycle.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022choosing-your-architecture\u0022\u003E15. Choosing Your Architecture\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EStart with one server and one client. Connect more clients whenever you need them.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth is built around two fundamental responsibilities:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cstrong\u003EUltimateAuth Server\u003C/strong\u003E \u2014 Manages authentication, users, credentials, sessions, authorization, and the security lifecycle.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUltimateAuth Client\u003C/strong\u003E \u2014 Integrates an application with the authentication system using the appropriate application profile and authentication flows.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EEvery application needs access to an authentication server, but that server does not have to be a separate application. It can be hosted within your existing ASP.NET Core application or deployed independently as UAuthHub.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022single-application-the-simplest-setup\u0022\u003ESingle Application \u2014 The Simplest Setup\u003C/h3\u003E\n\u003Cp\u003EFor a traditional ASP.NET Core or Blazor Server application, UltimateAuth Server and Client can run together.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Your Application \u2502\n\u2502 \u2502\n\u2502 UltimateAuth Client \u2502\n\u2502 \u2502 \u2502\n\u2502 UltimateAuth Server \u2502\n\u2502 \u2502 \u2502\n\u2502 Database \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis approach is ideal when you want authentication without introducing another service or deployment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022multiple-applications-one-authentication-server\u0022\u003EMultiple Applications \u2014 One Authentication Server\u003C/h3\u003E\n\u003Cp\u003EAs your system grows, you can connect multiple client applications to the same UltimateAuth Server.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Blazor Server Blazor WASM\n \u2502 \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 \u2502 \u2502\n Razor Pages MAUI Other .NET Clients\n \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u25BC\n UltimateAuth Server\n UAuthHub\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC \u25BC\n Users Sessions Authorization\n \u2502\n \u25BC\n Persistence\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EEach client can have its own application structure, hosting model, and authentication requirements while sharing the same authentication authority.\u003C/p\u003E\n\u003Cp\u003EFor example, a business platform might use Blazor Server for administration, Blazor WASM for its customer portal, MAUI for mobile access, and Razor Pages for an internal application.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAdding another client does not require replacing the existing clients or creating another UltimateAuth Server.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe same users, credentials, security policies, and session infrastructure can serve multiple applications, subject to the authentication modes and client integrations supported by the installed version.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022distributed-applications-separate-resource-apis\u0022\u003EDistributed Applications \u2014 Separate Resource APIs\u003C/h3\u003E\n\u003Cp\u003EWhen your architecture includes independently deployed backend services, Resource APIs can integrate with the same authentication authority.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E Multiple Client Applications\n \u2502\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u25BC \u25BC\n UAuthHub Resource APIs\n \u25B2 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n Authentication\n Validation\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResource APIs protect application resources without becoming additional authentication servers.\u003C/p\u003E\n\u003Cp\u003EThis lets you separate business services from authentication infrastructure while maintaining a shared security model.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022one-foundation-different-scales\u0022\u003EOne Foundation, Different Scales\u003C/h3\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EYour scenario\u003C/th\u003E\n\u003Cth\u003ERecommended approach\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA simple Blazor Server application\u003C/td\u003E\n\u003Ctd\u003EIntegrated Server \u002B Client\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA traditional ASP.NET Core application\u003C/td\u003E\n\u003Ctd\u003EServer hosted within the application\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EA standalone Blazor WASM application\u003C/td\u003E\n\u003Ctd\u003EClient \u002B remote UAuthHub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAn Interactive WASM application\u003C/td\u003E\n\u003Ctd\u003EHost \u002B WASM Client \u002B remote UAuthHub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMultiple web, desktop, or mobile applications\u003C/td\u003E\n\u003Ctd\u003EMultiple Clients \u002B shared UAuthHub\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMultiple backend services\u003C/td\u003E\n\u003Ctd\u003EShared UAuthHub \u002B Resource APIs\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EUltimateAuth does not require a complex architecture to get started, and it does not restrict you to a single client as your application grows.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EStart with the simplest deployment that meets your needs. Add new client applications, persistent storage, or separate Resource APIs as your requirements evolve.\u003C/p\u003E\n\u003Cp\u003EThe authentication foundation remains consistent.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/getting-started/quickstart\u0022\u003EQuickStart\u003C/a\u003E \u2014 Build the minimal in-memory application.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/getting-started/ecosystem\u0022\u003EEcosystem\u003C/a\u003E \u2014 Explore packages and supported integrations.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/server-options\u0022\u003EServer Options\u003C/a\u003E \u2014 Configure server authentication and security behavior.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/client-options\u0022\u003EClient Options\u003C/a\u003E \u2014 Configure application profiles, endpoints, refresh, and reauthentication.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/configuration/advanced-configuration\u0022\u003EAdvanced Configuration\u003C/a\u003E \u2014 Explore effective options, dependency injection, and extension points.\u003C/li\u003E\n\u003C/ul\u003E\n", "Headings": [ { "Id": "choose-your-architecture", @@ -369,6 +369,6 @@ "Level": 0 } ], - "SourceHash": "595FD3244C7FD23DCCE37992DF5E1A3EA33D32D5EEC514808B780D5D288E2E9C", + "SourceHash": "E719659B91C3A4A1967F0FFEE6ED8B853B6A652585D29F6FC9BC46775682BC5E", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/index.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/index.json index b26364e8..db555aa8 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/index.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/index.json @@ -1,7 +1,7 @@ { "Slug": "migration/index", "Title": "Migration Guides", - "Html": "\n\u003Cp\u003EKeep your UltimateAuth applications up to date with clear, version-specific upgrade guidance.\u003C/p\u003E\n\u003Cp\u003EThis page provides an overview of stable UltimateAuth releases, their migration impact, and any actions required when upgrading.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EMost updates require little or no application code changes.\u003C/strong\u003E When an update requires attention, a dedicated migration guide explains what changed and how to adapt your application.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022version-migration-overview\u0022\u003EVersion Migration Overview\u003C/h2\u003E\n\u003Cp\u003EThe table below lists stable releases in descending order, with the newest version first.\u003C/p\u003E\n\u003Cp\u003EPreview and release candidate versions are excluded.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EVersion\u003C/th\u003E\n\u003Cth\u003EMigration Impact\u003C/th\u003E\n\u003Cth\u003EWhat\u0027s Changed\u003C/th\u003E\n\u003Cth\u003EMigration Guide\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.2.0 (In Progress)\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003EMedium (Provisional)\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthorization changes, native login forms, authentication security defaults, concurrency controls, and persistence updates\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/migration/v0.2.0\u0022\u003EView Guide\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.4\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ELow\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECSRF protection, antiforgery integration, and interface changes\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/migration/v0.1.4\u0022\u003EView Guide\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.3\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ENone\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ESession deletion, revocation, and refresh consistency fixes\u003C/td\u003E\n\u003Ctd\u003ENot required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.2\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ENone\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EPassword change transaction and session revocation fixes\u003C/td\u003E\n\u003Ctd\u003ENot required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.1\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ELow\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor route authorization and component lifecycle changes\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/migration/v0.1.1\u0022\u003EView Guide\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.0\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003EN/A\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EInitial stable release\u003C/td\u003E\n\u003Ctd\u003ENot applicable\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EMigration impact describes the expected developer effort and affected integration surface, not the size of the code change or the significance of the release.\u003C/strong\u003E A small change to a widely used authentication API may have a higher migration impact than a large internal refactor.\u003C/p\u003E\n\u003Cblockquote\u003E\n\u003Cp\u003EIndividual preview and release candidate versions are not listed separately. Migration guidance for an in-progress release may change before its stable release.\u003C/p\u003E\n\u003C/blockquote\u003E\n\u003Cp\u003ESecurity and reliability fixes may have an impact of \u003Cstrong\u003ENone\u003C/strong\u003E while still being strongly recommended.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022understanding-migration-impact\u0022\u003EUnderstanding Migration Impact\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EImpact\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003Cth\u003EExpected Action\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ENone\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ENo application code or configuration changes are required for standard integrations.\u003C/td\u003E\n\u003Ctd\u003EUpdate packages and run existing tests.\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ELow\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ESmall, localized changes may be required, typically for specific integrations or customizations.\u003C/td\u003E\n\u003Ctd\u003EReview the migration guide and update affected code.\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EMedium\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EChanges affect commonly used APIs, core integration points, or multiple application areas. Even a small code change is classified as Medium when developers must update functionality they use directly and extensively.\u003C/td\u003E\n\u003Ctd\u003EReview the migration guide, update affected integrations, and perform targeted regression testing.\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EHigh\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ESignificant architectural, API, persistence, or behavioral changes require a planned migration.\u003C/td\u003E\n\u003Ctd\u003EReview all migration steps, test thoroughly, and plan deployment carefully.\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EMigration impact is evaluated using both \u003Cstrong\u003Ethe effort required and how directly the changes affect application developers\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EA change does not qualify as Low simply because it requires only a few lines of code. Breaking changes to frequently used authentication, authorization, session management, or client integration APIs may be classified as Medium even when the implementation changes are relatively small.\u003C/p\u003E\n\u003Cp\u003EApplications using only unaffected functionality may require fewer changes than the stated impact level suggests.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022how-to-upgrade\u0022\u003EHow to Upgrade\u003C/h2\u003E\n\u003Col\u003E\n\u003Cli\u003E\u003Cstrong\u003EIdentify your current version.\u003C/strong\u003E Check the installed \u003Ccode\u003ECodeBeam.UltimateAuth.*\u003C/code\u003E NuGet packages.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReview every version between your current and target versions.\u003C/strong\u003E Migration requirements are cumulative when skipping releases.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EFollow the linked migration guides.\u003C/strong\u003E Apply any required API, configuration, or behavioral changes in version order.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUpdate your UltimateAuth packages together.\u003C/strong\u003E Keep related packages on compatible versions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EBuild and test your application.\u003C/strong\u003E Verify login, logout, refresh, authorization, and session management flows relevant to your integration.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor releases marked \u003Cstrong\u003ENone\u003C/strong\u003E, no dedicated migration guide is necessary. You should still review the release notes and run your application tests.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-migration-guides\u0022\u003EAvailable Migration Guides\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022migrating-to-v0.1.4\u0022\u003E\u003Ca href=\u0022/docs/migration/v0.1.4\u0022\u003EMigrating to v0.1.4\u003C/a\u003E\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EImpact: Low\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIntroduces antiforgery protection for cookie-based authentication flows, updates browser client integration, and changes selected session resolution and browser bridge interfaces.\u003C/p\u003E\n\u003Cp\u003EApplications using the standard UltimateAuth browser client generally receive antiforgery handling automatically.\u003C/p\u003E\n\u003Cp\u003ECustom HTTP clients, manually implemented browser bridges, and custom session resolvers should review the guide.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022migrating-to-v0.1.1\u0022\u003E\u003Ca href=\u0022/docs/migration/v0.1.1\u0022\u003EMigrating to v0.1.1\u003C/a\u003E\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EImpact: Low\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIntroduces routing-level enforcement for \u003Ccode\u003E[UAuthAuthorize]\u003C/code\u003E and updates the \u003Ccode\u003EUAuthComponentBase\u003C/code\u003E lifecycle.\u003C/p\u003E\n\u003Cp\u003EMost applications using the built-in \u003Ccode\u003EUAuthApp\u003C/code\u003E router require no changes. Applications with custom routers, component lifecycle overrides, or specialized session requirements should review the guide.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022release-history\u0022\u003ERelease History\u003C/h2\u003E\n\u003Cp\u003EFor complete release notes, bug fixes, and security updates, visit the \u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth/releases\u0022\u003EUltimateAuth GitHub Releases\u003C/a\u003E page.\u003C/p\u003E\n\u003Cp\u003EMigration guides focus on changes developers must make to their applications. Release notes provide the complete history of changes in each version.\u003C/p\u003E\n\u003Chr\u003E\n\u003Cp\u003E\u003Cstrong\u003EUpgrading across multiple versions?\u003C/strong\u003E Start with the earliest version after your currently installed release and review each migration entry through your target version.\u003C/p\u003E\n", + "Html": "\n\u003Cp\u003EKeep your UltimateAuth applications up to date with clear, version-specific upgrade guidance.\u003C/p\u003E\n\u003Cp\u003EThis page provides an overview of stable UltimateAuth releases, their migration impact, and any actions required when upgrading.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EMost updates require little or no application code changes.\u003C/strong\u003E When an update requires attention, a dedicated migration guide explains what changed and how to adapt your application.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022version-migration-overview\u0022\u003EVersion Migration Overview\u003C/h2\u003E\n\u003Cp\u003EThe table below lists stable releases in descending order, with the newest version first.\u003C/p\u003E\n\u003Cp\u003EPreview and release candidate versions are excluded.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EVersion\u003C/th\u003E\n\u003Cth\u003EMigration Impact\u003C/th\u003E\n\u003Cth\u003EWhat\u0027s Changed\u003C/th\u003E\n\u003Cth\u003EMigration Guide\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.2.0 (In Progress)\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003EHigh (Provisional)\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthorization changes, native login forms, authentication security defaults, concurrency controls, and persistence updates\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/migration/v0.2.0\u0022\u003EView Guide\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.4\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ELow\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ECSRF protection, antiforgery integration, and interface changes\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/migration/v0.1.4\u0022\u003EView Guide\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.3\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ENone\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ESession deletion, revocation, and refresh consistency fixes\u003C/td\u003E\n\u003Ctd\u003ENot required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.2\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ENone\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EPassword change transaction and session revocation fixes\u003C/td\u003E\n\u003Ctd\u003ENot required\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.1\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003ELow\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EBlazor route authorization and component lifecycle changes\u003C/td\u003E\n\u003Ctd\u003E\u003Ca href=\u0022/docs/migration/v0.1.1\u0022\u003EView Guide\u003C/a\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003Ev0.1.0\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Cstrong\u003EN/A\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EInitial stable release\u003C/td\u003E\n\u003Ctd\u003ENot applicable\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EMigration impact describes the expected developer effort and affected integration surface, not the size of the code change or the significance of the release.\u003C/strong\u003E A small change to a widely used authentication API may have a higher migration impact than a large internal refactor.\u003C/p\u003E\n\u003Cblockquote\u003E\n\u003Cp\u003EIndividual preview and release candidate versions are not listed separately. Migration guidance for an in-progress release may change before its stable release.\u003C/p\u003E\n\u003C/blockquote\u003E\n\u003Cp\u003ESecurity and reliability fixes may have an impact of \u003Cstrong\u003ENone\u003C/strong\u003E while still being strongly recommended.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022understanding-migration-impact\u0022\u003EUnderstanding Migration Impact\u003C/h2\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EImpact\u003C/th\u003E\n\u003Cth\u003EMeaning\u003C/th\u003E\n\u003Cth\u003EExpected Action\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ENone\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ENo application code or configuration changes are required for standard integrations.\u003C/td\u003E\n\u003Ctd\u003EUpdate packages and run existing tests.\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ELow\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ESmall, localized changes may be required, typically for specific integrations or customizations.\u003C/td\u003E\n\u003Ctd\u003EReview the migration guide and update affected code.\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EMedium\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EChanges affect commonly used APIs, core integration points, or multiple application areas. Even a small code change is classified as Medium when developers must update functionality they use directly and extensively.\u003C/td\u003E\n\u003Ctd\u003EReview the migration guide, update affected integrations, and perform targeted regression testing.\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EHigh\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003ESignificant architectural, API, persistence, or behavioral changes require a planned migration.\u003C/td\u003E\n\u003Ctd\u003EReview all migration steps, test thoroughly, and plan deployment carefully.\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EMigration impact is evaluated using both \u003Cstrong\u003Ethe effort required and how directly the changes affect application developers\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EA change does not qualify as Low simply because it requires only a few lines of code. Breaking changes to frequently used authentication, authorization, session management, or client integration APIs may be classified as Medium even when the implementation changes are relatively small.\u003C/p\u003E\n\u003Cp\u003EApplications using only unaffected functionality may require fewer changes than the stated impact level suggests.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022how-to-upgrade\u0022\u003EHow to Upgrade\u003C/h2\u003E\n\u003Col\u003E\n\u003Cli\u003E\u003Cstrong\u003EIdentify your current version.\u003C/strong\u003E Check the installed \u003Ccode\u003ECodeBeam.UltimateAuth.*\u003C/code\u003E NuGet packages.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EReview every version between your current and target versions.\u003C/strong\u003E Migration requirements are cumulative when skipping releases.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EFollow the linked migration guides.\u003C/strong\u003E Apply any required API, configuration, or behavioral changes in version order.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EUpdate your UltimateAuth packages together.\u003C/strong\u003E Keep related packages on compatible versions.\u003C/li\u003E\n\u003Cli\u003E\u003Cstrong\u003EBuild and test your application.\u003C/strong\u003E Verify login, logout, refresh, authorization, and session management flows relevant to your integration.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EFor releases marked \u003Cstrong\u003ENone\u003C/strong\u003E, no dedicated migration guide is necessary. You should still review the release notes and run your application tests.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022available-migration-guides\u0022\u003EAvailable Migration Guides\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022migrating-to-v0.1.4\u0022\u003E\u003Ca href=\u0022/docs/migration/v0.1.4\u0022\u003EMigrating to v0.1.4\u003C/a\u003E\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EImpact: Low\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIntroduces antiforgery protection for cookie-based authentication flows, updates browser client integration, and changes selected session resolution and browser bridge interfaces.\u003C/p\u003E\n\u003Cp\u003EApplications using the standard UltimateAuth browser client generally receive antiforgery handling automatically.\u003C/p\u003E\n\u003Cp\u003ECustom HTTP clients, manually implemented browser bridges, and custom session resolvers should review the guide.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022migrating-to-v0.1.1\u0022\u003E\u003Ca href=\u0022/docs/migration/v0.1.1\u0022\u003EMigrating to v0.1.1\u003C/a\u003E\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EImpact: Low\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EIntroduces routing-level enforcement for \u003Ccode\u003E[UAuthAuthorize]\u003C/code\u003E and updates the \u003Ccode\u003EUAuthComponentBase\u003C/code\u003E lifecycle.\u003C/p\u003E\n\u003Cp\u003EMost applications using the built-in \u003Ccode\u003EUAuthApp\u003C/code\u003E router require no changes. Applications with custom routers, component lifecycle overrides, or specialized session requirements should review the guide.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022release-history\u0022\u003ERelease History\u003C/h2\u003E\n\u003Cp\u003EFor complete release notes, bug fixes, and security updates, visit the \u003Ca href=\u0022https://github.com/CodeBeamOrg/UltimateAuth/releases\u0022\u003EUltimateAuth GitHub Releases\u003C/a\u003E page.\u003C/p\u003E\n\u003Cp\u003EMigration guides focus on changes developers must make to their applications. Release notes provide the complete history of changes in each version.\u003C/p\u003E\n\u003Chr\u003E\n\u003Cp\u003E\u003Cstrong\u003EUpgrading across multiple versions?\u003C/strong\u003E Start with the earliest version after your currently installed release and review each migration entry through your target version.\u003C/p\u003E\n", "Headings": [ { "Id": "version-migration-overview", @@ -39,6 +39,6 @@ "Level": 0 } ], - "SourceHash": "C20504B5B35316B5BD3D976AB8BE3BB69C8CC9E83109166FF3EC3855DB26FC40", + "SourceHash": "809D656D40A34ABC314E752B04E419E877EAF57B5CBD9B258C015493F03390C3", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/v0.2.0.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/v0.2.0.json index 7269773c..a67340ca 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/v0.2.0.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/migration/v0.2.0.json @@ -1,7 +1,7 @@ { "Slug": "migration/v0.2.0", "Title": "Migrating to v0.2.0", - "Html": "\n\u003Cp\u003E\u003Cstrong\u003EMigration Impact: Medium \u2014 In Progress\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ELatest published prerelease reviewed: v0.2.0-preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThis guide covers migration requirements for the upcoming UltimateAuth v0.2.0 release.\u003C/p\u003E\n\u003Cp\u003EThe guide is provisional and will be updated as new preview and release candidate versions become available. The final migration requirements may change before the stable v0.2.0 release.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022migration-overview\u0022\u003EMigration Overview\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth v0.2.0 introduces new authentication capabilities, strengthens security defaults, and reorganizes several public configuration APIs.\u003C/p\u003E\n\u003Cp\u003EFor applications using the built-in integrations and default authentication behavior, migration primarily involves reviewing configuration changes, providing production cryptographic keys, and applying any required database migrations.\u003C/p\u003E\n\u003Cp\u003EApplications with custom authentication policies, persistence stores, credential delivery settings, or Resource API configurations should also review the detailed sections below.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ERecommended upgrade sequence:\u003C/strong\u003E\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EUpdate renamed public APIs and configuration properties.\u003C/li\u003E\n\u003Cli\u003EConfigure and validate cryptographic keys before production deployment.\u003C/li\u003E\n\u003Cli\u003EReview authentication mode and credential delivery behavior.\u003C/li\u003E\n\u003Cli\u003EApply required persistence migrations.\u003C/li\u003E\n\u003Cli\u003EVerify login, refresh, logout, authorization, and Resource API integration.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-public-api-changes\u0022\u003ECommon Public API Changes\u003C/h3\u003E\n\u003Cp\u003EThe following table focuses on commonly accessed public APIs and configuration properties. Internal implementation types and advanced extension-point changes are covered in the detailed migration sections.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EBefore (v0.1.x)\u003C/th\u003E\n\u003Cth\u003EAfter (v0.2.0)\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectClientProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EClientProfileModes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EApplicationProfileModes\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIClientProfileDetector\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIApplicationProfileDetector\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETokenResponseMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDeliveryMode\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.SessionIdDelivery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDelivery.Session\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.AccessTokenDelivery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDelivery.AccessToken\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.RefreshTokenDelivery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDelivery.RefreshToken\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.Login\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirect.Login\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.Logout\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirect.Logout\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.UAuthHubBaseUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.Hub.BaseUrl\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.AllowedClientOrigins\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.Cors.AllowedOrigins\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.CorsPolicyName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.Cors.PolicyName\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThese are API and configuration-path replacements, not guarantees of identical behavior.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E \u003Ccode\u003EAuthResponse\u003C/code\u003E is obsolete and no longer functional. Accessing it throws \u003Ccode\u003ENotSupportedException\u003C/code\u003E. Applications must migrate to \u003Ccode\u003EGrantDelivery\u003C/code\u003E and \u003Ccode\u003ERedirect\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EAuthentication modes and credential delivery now have separate responsibilities. The effective authentication mode determines which grants exist; delivery settings determine how those grants are transported.\u003C/p\u003E\n\u003Cp\u003EThe public \u003Ccode\u003EIUAuthClient\u003C/code\u003E entry point and standard UltimateAuth registration methods remain available. Applications relying on built-in defaults generally do not need to replace their authentication integration.\u003C/p\u003E\n\u003Cp\u003EThe following sections explain the behavioral changes, security implications, and additional migration requirements in detail.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022asynchronous-authorization-policies\u0022\u003E1. Asynchronous Authorization Policies\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.1\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ECustom implementations of \u003Ccode\u003EIAccessPolicy\u003C/code\u003E, \u003Ccode\u003EIAccessInvariant\u003C/code\u003E, and \u003Ccode\u003EIAccessAuthority\u003C/code\u003E should migrate to \u003Ccode\u003EDecideAsync\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic AccessDecision Decide(AccessContext context)\n{\n return AccessDecision.Allow();\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic ValueTask\u0026lt;AccessDecision\u0026gt; DecideAsync(AccessContext context, CancellationToken ct = default)\n{\n return ValueTask.FromResult(AccessDecision.Allow());\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor \u003Ccode\u003EIAccessAuthority\u003C/code\u003E, preserve the existing \u003Ccode\u003EruntimePolicies\u003C/code\u003E parameter and add the cancellation token.\u003C/p\u003E\n\u003Cp\u003ESynchronous \u003Ccode\u003EDecide\u003C/code\u003E methods are obsolete. Existing synchronous implementations retain compatibility through the interface defaults, but new implementations should use \u003Ccode\u003EDecideAsync\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIf your application invokes an authority directly, switch to \u003Ccode\u003EDecideAsync\u003C/code\u003E and await the result.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-check-results\u0022\u003E2. Authorization Check Results\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.1\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ECheckAsync\u003C/code\u003E now returns an explicit authorization decision in the response body.\u003C/p\u003E\n\u003Cp\u003EIf your application previously interpreted HTTP \u003Ccode\u003E403\u003C/code\u003E as the result of a successful authorization evaluation that denied access, update that handling.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Authorization.CheckAsync(request);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is { IsAllowed: true })\n{\n // Authorized\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn HTTP-successful authorization check does not necessarily mean that access was granted.\u003C/p\u003E\n\u003Cp\u003EInspect the returned authorization decision rather than relying solely on the HTTP status.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-user-lifecycle-integrations\u0022\u003E3. Custom User Lifecycle Integrations\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe \u003Ccode\u003EIUserLifecycleIntegration.OnUserCreatedAsync\u003C/code\u003E signature now includes \u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask OnUserCreatedAsync(\n TenantKey tenant,\n UserKey userKey,\n object request,\n CancellationToken ct = default);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask OnUserCreatedAsync(\n TenantKey tenant,\n UserKey userKey,\n object request,\n UAuthApplicationProfile applicationProfile,\n CancellationToken ct = default);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUpdate custom implementations to accept the additional client profile parameter.\u003C/p\u003E\n\u003Cp\u003EApplications using built-in lifecycle integrations do not need to make this change.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-and-profile-limits\u0022\u003E4. Identifier and Profile Limits\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe reference Users domain now enforces additional identifier and profile safety limits.\u003C/p\u003E\n\u003Cp\u003EThe default maximum is 10 active identifiers per user. Applications requiring a different capacity should configure \u003Ccode\u003EIdentifiers.Behavior.MaxIdentifiersPerUser\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EExisting profile creation and update operations must also respect the new field-length and metadata limits.\u003C/p\u003E\n\u003Cp\u003EIf you use EF Core persistence:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EReview existing profile data for values exceeding the new limits.\u003C/li\u003E\n\u003Cli\u003EAdd or apply the appropriate EF Core database migration for your application\u0027s DbContext.\u003C/li\u003E\n\u003Cli\u003EVerify that applications handling profile validation errors use the returned error codes.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/plugin-domains/profile-validation-limits\u0022\u003EProfile Validation \u0026amp; Limits\u003C/a\u003E for the supported limits.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022password-policies-and-history\u0022\u003E5. Password Policies and History\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe reference password credential implementation now applies configurable password policies, with Standard as the default level.\u003C/p\u003E\n\u003Cp\u003EReview custom registration, password-change, and password-reset flows to ensure that they handle server-side password validation errors.\u003C/p\u003E\n\u003Cp\u003EApplications using persistent password-history storage must apply the required database migration before enabling password history.\u003C/p\u003E\n\u003Cp\u003EPassword history is disabled by default (\u003Ccode\u003ERememberLast = 0\u003C/code\u003E).\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/password-policy\u0022\u003EPassword Policy \u0026amp; History\u003C/a\u003E for configuration and persistence requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022rate-limiting\u0022\u003E6. Rate Limiting\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EBuilt-in endpoint rate limiting is enabled by default when using:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseUltimateAuthWithAspNetCore();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIf your application already registers its own rate limiting middleware, avoid installing a duplicate limiter.\u003C/p\u003E\n\u003Cp\u003ETo retain application-owned rate limiting:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseUltimateAuthWithAspNetCore(useRateLimiting: false);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen configure your existing \u003Ccode\u003EUseRateLimiter()\u003C/code\u003E middleware in the appropriate pipeline position.\u003C/p\u003E\n\u003Cp\u003EApplications using \u003Ccode\u003EUseUltimateAuth()\u003C/code\u003E without the integrated ASP.NET Core helper do not enable UltimateAuth rate limiting by default.\u003C/p\u003E\n\u003Cp\u003EReview custom HTTP clients and authentication flows for HTTP \u003Ccode\u003E429 Too Many Requests\u003C/code\u003E handling.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/rate-limiting\u0022\u003ERate Limiting\u003C/a\u003E for middleware integration and defaults.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-login-form-and-credential-submission\u0022\u003E7. Native Login Form and Credential Submission\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E no longer accepts \u003Ccode\u003EIdentifier\u003C/code\u003E and \u003Ccode\u003ESecret\u003C/code\u003E component parameters.\u003C/p\u003E\n\u003Cp\u003ECredentials are now read directly from native browser form inputs. This reduces unnecessary exposure of passwords through Blazor component state and Blazor Server\u0027s interactive communication.\u003C/p\u003E\n\u003Cp\u003EApplications using the removed component parameters must update their login forms.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm Identifier=\u0026quot;@identifier\u0026quot; Secret=\u0026quot;@password\u0026quot; /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter \u2014 built-in form:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen no child content is provided, UltimateAuth renders the identifier field, password field, and submit button automatically.\u003C/p\u003E\n\u003Cp\u003EFor custom layouts, provide native-compatible credential inputs:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; autocomplete=\u0026quot;username\u0026quot; required /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot;\n autocomplete=\u0026quot;current-password\u0026quot; required /\u0026gt;\n \u0026lt;button type=\u0026quot;submit\u0026quot;\u0026gt;Sign in\u0026lt;/button\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ECustom inputs must use the exact HTML \u003Ccode\u003Ename\u003C/code\u003E - \u003Ccode\u003EIdentifier\u003C/code\u003E and \u003Ccode\u003ESecret\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EKeep credential inputs enabled during submission. Disabled inputs are excluded from native form submissions; disable the submit button instead.\u003C/p\u003E\n\u003Cp\u003EThe existing \u003Ccode\u003ETryOnly\u003C/code\u003E, \u003Ccode\u003ETryAndCommit\u003C/code\u003E, and \u003Ccode\u003EDirectCommit\u003C/code\u003E submission modes remain available.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/client-sdk/authentication\u0022\u003EAuthentication Client SDK\u003C/a\u003E for current login integration guidance.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-failure-details\u0022\u003E8. Authentication Failure Details\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EDefault changed in preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginOptions.IncludeFailureDetails\u003C/code\u003E now defaults to \u003Ccode\u003Efalse\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EPreviously, failed authentication responses could expose lockout reasons, remaining attempts, or lockout expiration details by default.\u003C/p\u003E\n\u003Cp\u003EWith the new default, public authentication failures return generic \u003Ccode\u003EInvalidCredentials\u003C/code\u003E information without exposing account-specific lockout state.\u003C/p\u003E\n\u003Cp\u003EThis applies to ordinary login, login previews, PKCE previews, and login failure redirects.\u003C/p\u003E\n\u003Cp\u003EApplications relying on detailed failure feedback should update their user interfaces to handle generic authentication failures.\u003C/p\u003E\n\u003Cp\u003EDetailed feedback remains available through explicit configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.IncludeFailureDetails = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003ESecurity consideration:\u003C/strong\u003E Enabling this option may reveal account existence or lockout state to unauthenticated clients. Keep it disabled unless detailed disclosure is an intentional application requirement.\u003C/p\u003E\n\u003Cp\u003EFor authorized administrative inspection, use the authentication lockout management APIs instead.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022asp.net-core-authorization-and-user-status\u0022\u003E9. ASP.NET Core Authorization and User Status\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBehavior changed in preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth now checks account status when authorizing protected ASP.NET Core HTTP endpoints.\u003C/p\u003E\n\u003Cp\u003EA valid session or matching role no longer automatically grants access when the associated user is inactive.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EUser status\u003C/th\u003E\n\u003Cth\u003EOrdinary protected HTTP endpoint\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EActive\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAllowed when other requirements pass\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESuspended\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESelfSuspended\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDisabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMissing or invalid status\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EExisting applications that intentionally allow suspended users to access selected protected HTTP endpoints should use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E[Authorize]\n[UAuthAllowInactive]\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis exception preserves the endpoint\u0027s existing authentication and authorization requirements. It does not grant access to disabled or otherwise ineligible accounts.\u003C/p\u003E\n\u003Cp\u003EFor independently hosted Resource APIs, the validated Hub response must contain a valid \u003Ccode\u003Esnapshot.identity.userStatus\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EOlder custom Hub validation responses that omit this information are no longer sufficient for successful protected HTTP authorization.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthorization policy precedence:\u003C/strong\u003E Explicitly registered ASP.NET Core named policies are now resolved before UltimateAuth action-policy fallback. Review applications that use the same policy name in both systems.\u003C/p\u003E\n\u003Cp\u003EThese changes apply to ASP.NET Core HTTP authorization middleware. They do not automatically replace authorization checks in Blazor component rendering, direct service calls, or direct \u003Ccode\u003EIAuthorizationService.AuthorizeAsync\u003C/code\u003E usage.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022password-verification-and-concurrency-limiting\u0022\u003E10. Password Verification and Concurrency Limiting\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth introduces dummy password verification to reduce observable timing differences between authentication paths.\u003C/p\u003E\n\u003Cp\u003EPassword verification now also uses built-in concurrency limiting to protect CPU and memory resources.\u003C/p\u003E\n\u003Cp\u003EConcurrency limiting is \u003Cstrong\u003Eenabled by default\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThe default configuration uses three coordinated policies:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EPolicy\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPasswordHashing\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EShared global hashing capacity\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReal and dummy login verification\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialManagement\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPassword creation, changes, resets, and history checks\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EDefault capacity is derived from \u003Ccode\u003EMath.Max(2, Environment.ProcessorCount)\u003C/code\u003E. Initial queue capacity is five times the permit limit, and the queue timeout is three seconds.\u003C/p\u003E\n\u003Cp\u003EWhen capacity is exhausted, the server may return HTTP \u003Ccode\u003E429 Too Many Requests\u003C/code\u003E with the error code \u003Ccode\u003Epassword_verification_busy\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EApplications should treat this as a temporary server-capacity condition, not invalid credentials or an expired session.\u003C/p\u003E\n\u003Cp\u003EConfigure capacity based on deployment resources:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConcurrencyLimiting.PasswordHashing.PermitLimit = 8;\n options.ConcurrencyLimiting.PasswordHashing.QueueLimit = 40;\n options.ConcurrencyLimiting.PasswordHashing.QueueTimeout = TimeSpan.FromSeconds(3);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe default Argon2 parallelism for newly generated hashes is now \u003Ccode\u003E1\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EExisting hashes remain verifiable using their stored parameters. Password resets or hash migrations are not required solely because of this default change.\u003C/p\u003E\n\u003Cp\u003EConcurrency limiting is independent of HTTP endpoint rate limiting and operates per application process.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/concurrency-limiting\u0022\u003EConcurrency Limiting\u003C/a\u003E for configuration and deployment considerations.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-artifact-store-capacity\u0022\u003E11. Authentication Artifact Store Capacity\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe built-in in-memory authentication artifact store now performs periodic expiration cleanup and enforces a configurable capacity limit.\u003C/p\u003E\n\u003Cp\u003EThis affects temporary authentication artifacts such as PKCE authorization codes and login preview receipts.\u003C/p\u003E\n\u003Cp\u003ENew defaults:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ESetting\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.MaxEntries\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E50,000\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.CleanupInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E1 minute\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe configured capacity is per application process.\u003C/p\u003E\n\u003Cp\u003EWhen all available entries are occupied by valid artifacts, new artifact creation can fail with HTTP \u003Ccode\u003E503 Service Unavailable\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EApplications with high authentication traffic should monitor artifact capacity and adjust the limits as necessary.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthArtifacts.MaxEntries = 100_000;\n options.AuthArtifacts.CleanupInterval = TimeSpan.FromMinutes(1);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe \u003Ccode\u003EIAuthStore\u003C/code\u003E interface remains unchanged.\u003C/p\u003E\n\u003Cp\u003ECustom artifact-store implementations retain responsibility for their own expiration cleanup and capacity management.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-security-state-persistence\u0022\u003E12. Authentication Security State Persistence\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EPersistence change in preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe EF Core authentication security state implementation introduces stronger uniqueness and concurrency enforcement.\u003C/p\u003E\n\u003Cp\u003EFor PostgreSQL, account-level authentication security state records now use uniqueness semantics that treat null credential-type values as non-distinct.\u003C/p\u003E\n\u003Cp\u003EApplications using PostgreSQL persistence must review their authentication security state data and apply the appropriate EF Core migration.\u003C/p\u003E\n\u003Cp\u003EBefore migration:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EBack up the database.\u003C/li\u003E\n\u003Cli\u003ECheck for duplicate authentication security state records, particularly account-level records with a null credential type.\u003C/li\u003E\n\u003Cli\u003EResolve duplicates before introducing the new unique constraint.\u003C/li\u003E\n\u003Cli\u003EApply the migration through the application\u0027s normal EF Core deployment process.\u003C/li\u003E\n\u003Cli\u003EVerify authentication, lockout, and password recovery operations.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe reference samples and Identity Lab include corresponding migration changes.\u003C/p\u003E\n\u003Cp\u003EApplications managing their own \u003Ccode\u003EDbContext\u003C/code\u003E must ensure that the updated model and database schema are synchronized.\u003C/p\u003E\n\u003Cp\u003EExisting login and session DTO contracts remain unchanged.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-lockout-and-recovery\u0022\u003E13. Authentication Lockout and Recovery\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth introduces administrative APIs for inspecting and clearing account-level and factor-level authentication lockouts.\u003C/p\u003E\n\u003Cp\u003EThrough \u003Ccode\u003EIUAuthClient.Users\u003C/code\u003E, applications can now use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar state = await UAuthClient.Users.GetAuthenticationLockoutAsync(userKey,\n new LockoutQueryRequest(AuthenticationSecurityScope.Factor, CredentialType.Password));\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAnd:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Users.UnlockAuthenticationAsync(userKey,\n new UnlockAuthenticationRequest(AuthenticationSecurityScope.Factor, CredentialType.Password));\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese operations are authorization-protected and do not require existing applications to change their login integrations.\u003C/p\u003E\n\u003Cp\u003EA successful verified password reset now clears the related password-factor lockout as part of credential recovery.\u003C/p\u003E\n\u003Cp\u003EAccount-level lockouts, unrelated security states, user lifecycle status, and existing session policies remain separate.\u003C/p\u003E\n\u003Cp\u003EThis is an additional recovery capability rather than a breaking API change.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/authentication-lockout\u0022\u003EAuthentication Lockout \u0026amp; Recovery\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022additional-authentication-security-hardening\u0022\u003E14. Additional Authentication Security Hardening\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESeveral authentication checks have been strengthened:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ERelative return URLs remain supported, while absolute return URLs require an explicitly allowed origin.\u003C/li\u003E\n\u003Cli\u003EAmbiguous or unsafe return URL paths are rejected.\u003C/li\u003E\n\u003Cli\u003ELogin preview receipts are bound to the original authentication context.\u003C/li\u003E\n\u003Cli\u003EPreview receipts must be consumed successfully and atomically before they can suppress duplicate failed-attempt accounting.\u003C/li\u003E\n\u003Cli\u003EPreviously consumed, mismatched, or stale preview receipts cannot bypass failure accounting.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EApplications using standard UltimateAuth login components should not need additional code changes.\u003C/p\u003E\n\u003Cp\u003ECustom login clients should avoid reusing preview receipts or modifying the authentication context between preview and commit.\u003C/p\u003E\n\u003Cp\u003EApplications relying on arbitrary external redirect targets must explicitly configure the corresponding allowed origins.\u003C/p\u003E\n\u003Cp\u003EThese changes intentionally strengthen validation and may reject requests that were previously accepted.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022device-limits-and-browser-device-type-classification\u0022\u003E15. Device Limits and Browser Device Type Classification\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since rc.1\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth introduces configurable active-device limits through \u003Ccode\u003EUAuthServerOptions.DeviceLimits\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EApplications can restrict the number of distinct active devices per user and tenant, either globally or by device type.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.DeviceLimits.MaxDevices = 3;\n options.DeviceLimits.TypeLimits[\u0026quot;web\u0026quot;] = 2;\n options.DeviceLimits.Behavior = DeviceLimitBehavior.RejectNewLogin;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDevice limits are \u003Cstrong\u003Edisabled by default\u003C/strong\u003E:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EMaxDevices = null\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ETypeLimits\u003C/code\u003E is empty.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EBehavior = RejectNewLogin\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EExisting applications do not acquire device quotas merely by upgrading.\u003C/p\u003E\n\u003Cp\u003EWhen enabled, \u003Ccode\u003ERejectNewLogin\u003C/code\u003E refuses additional device admission without revoking existing devices.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ERevokeOldest\u003C/code\u003E instead revokes eligible older active device chains when capacity must be freed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022breaking-change-browser-device-type-is-now-web\u0022\u003EBreaking Change: Browser Device Type Is Now \u003Ccode\u003Eweb\u003C/code\u003E\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EBrowser-based clients previously could be classified as \u003Ccode\u003Edesktop\u003C/code\u003E. The built-in Blazor web device provider now reports \u003Ccode\u003EDeviceType = \u0026quot;web\u0026quot;\u003C/code\u003E.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EServer device-type resolution also defaults to \u003Ccode\u003Eweb\u003C/code\u003E when no explicit type is supplied.\u003C/p\u003E\n\u003Cp\u003EThis applies to both desktop and mobile browsers.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EClient Environment\u003C/th\u003E\n\u003Cth\u003EDeviceType\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDesktop browser\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Eweb\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMobile browser\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Eweb\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ENative desktop application\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Edesktop\u003C/code\u003E when explicitly provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ENative mobile application\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Emobile\u003C/code\u003E when explicitly provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe change distinguishes browser-based client environments from native application platforms.\u003C/p\u003E\n\u003Cp\u003EIt does not remove the \u003Ccode\u003Edesktop\u003C/code\u003E or \u003Ccode\u003Emobile\u003C/code\u003E classifications.\u003C/p\u003E\n\u003Cp\u003EApplications can continue using these values for appropriate native clients.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022migration-impact\u0022\u003EMigration Impact\u003C/h3\u003E\n\u003Cp\u003EThis is a \u003Cstrong\u003Ebehavioral breaking change\u003C/strong\u003E for applications that rely on device-type classification.\u003C/p\u003E\n\u003Cp\u003EReview implementations that:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EFilter sessions by \u003Ccode\u003EDeviceType\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EDisplay device types in user interfaces.\u003C/li\u003E\n\u003Cli\u003EApply custom device-type policies.\u003C/li\u003E\n\u003Cli\u003EUse device classifications in analytics or diagnostics.\u003C/li\u003E\n\u003Cli\u003EAssume that \u003Ccode\u003Edesktop\u003C/code\u003E represents all desktop-browser sessions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar browserType = \u0026quot;desktop\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar browserType = \u0026quot;web\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not infer the operating system from \u003Ccode\u003EDeviceType\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EUse the separate \u003Ccode\u003EPlatform\u003C/code\u003E, \u003Ccode\u003EOperatingSystem\u003C/code\u003E, and \u003Ccode\u003EBrowser\u003C/code\u003E metadata where appropriate.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ENote:\u003C/strong\u003E Device Limits is a new feature introduced in v0.2.0. The example above illustrates migration of existing device-type assumptions, not an earlier \u003Ccode\u003EDeviceLimits.TypeLimits\u003C/code\u003E API.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022existing-persisted-device-records\u0022\u003EExisting Persisted Device Records\u003C/h3\u003E\n\u003Cp\u003EUpdating UltimateAuth does not automatically rewrite device-type values in persisted session chains.\u003C/p\u003E\n\u003Cp\u003EAn existing browser device may still be recorded as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EDeviceType: desktop\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen an incoming \u003Ccode\u003EDeviceId\u003C/code\u003E matches an already active device chain, UltimateAuth preserves that device\u0027s existing type classification.\u003C/p\u003E\n\u003Cp\u003ETherefore, a previously admitted browser device classified as \u003Ccode\u003Edesktop\u003C/code\u003E can retain that classification during subsequent authentication.\u003C/p\u003E\n\u003Cp\u003ENew browser device IDs are classified as \u003Ccode\u003Eweb\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EDuring the transition, both classifications may coexist:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EExisting active browser:\n DeviceType = desktop\n\nNew browser:\n DeviceType = web\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis distinction matters when per-type limits are enabled.\u003C/p\u003E\n\u003Cp\u003ELegacy \u003Ccode\u003Edesktop\u003C/code\u003E records and new \u003Ccode\u003Eweb\u003C/code\u003E records may be counted in different type categories until the existing active device state ends.\u003C/p\u003E\n\u003Cp\u003EApplications should review existing session data and plan an appropriate transition.\u003C/p\u003E\n\u003Cp\u003EIf immediate classification consistency is required, consider controlled reauthentication or device-session revocation.\u003C/p\u003E\n\u003Cp\u003EDo not assume that a database schema migration automatically changes stored device classifications.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022breaking-change-custom-session-stores\u0022\u003EBreaking Change: Custom Session Stores\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EISessionStore\u003C/code\u003E interface introduces a new operation:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask\u0026lt;TResult\u0026gt; ExecuteAdmissionAsync\u0026lt;TResult\u0026gt;(\n Func\u0026lt;CancellationToken, Task\u0026lt;TResult\u0026gt;\u0026gt; action,\n CancellationToken ct = default);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an \u003Cstrong\u003Einterface-level breaking change\u003C/strong\u003E for custom session-store implementations.\u003C/p\u003E\n\u003Cp\u003EImplementations must add support for the new method even when device limits are disabled.\u003C/p\u003E\n\u003Cp\u003EWhen limits are enabled, device admission must be atomic and concurrency-safe.\u003C/p\u003E\n\u003Cp\u003ECustom stores must ensure:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAdmission changes are committed atomically.\u003C/li\u003E\n\u003Cli\u003EFailed admissions are rolled back.\u003C/li\u003E\n\u003Cli\u003ESimultaneous login requests cannot exceed configured limits.\u003C/li\u003E\n\u003Cli\u003EConcurrency protection applies across application instances sharing the same persistence infrastructure.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe built-in in-memory and EF Core stores implement the new contract.\u003C/p\u003E\n\u003Cp\u003EThe EF Core implementation uses a serializable transaction for device admission.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022database-migration-requirements\u0022\u003EDatabase Migration Requirements\u003C/h3\u003E\n\u003Cp\u003EDevice Limits does not introduce a new database table or require a schema migration by itself.\u003C/p\u003E\n\u003Cp\u003EThe feature uses existing session root, chain, and session persistence.\u003C/p\u003E\n\u003Cp\u003EHowever, other v0.2.0 persistence changes may still require application database migrations.\u003C/p\u003E\n\u003Cp\u003ECustom \u003Ccode\u003EDbContext\u003C/code\u003E implementations should continue following the database migration requirements documented in the preceding sections.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022upgrade-checklist\u0022\u003EUpgrade Checklist\u003C/h3\u003E\n\u003Col\u003E\n\u003Cli\u003EReview custom device-type consumers and replace browser-specific \u003Ccode\u003Edesktop\u003C/code\u003E assumptions with \u003Ccode\u003Eweb\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EReview active persisted device chains for legacy \u003Ccode\u003Edesktop\u003C/code\u003E classifications.\u003C/li\u003E\n\u003Cli\u003EPlan session turnover or controlled revocation if immediate classification consistency is required.\u003C/li\u003E\n\u003Cli\u003EUpdate custom \u003Ccode\u003EISessionStore\u003C/code\u003E implementations to support \u003Ccode\u003EExecuteAdmissionAsync\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EVerify atomic admission and concurrent login handling before enabling device quotas.\u003C/li\u003E\n\u003Cli\u003EConfigure \u003Ccode\u003EDeviceLimits\u003C/code\u003E explicitly only when the application requires device restrictions.\u003C/li\u003E\n\u003Cli\u003ETest login failure handling and device management behavior with the selected \u003Ccode\u003ERejectNewLogin\u003C/code\u003E or \u003Ccode\u003ERevokeOldest\u003C/code\u003E policy.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/sessions-devices/device-limits\u0022\u003EDevice Limits\u003C/a\u003E for the complete configuration and enforcement reference.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profile-api-redesign\u0022\u003E16. Application Profile API Redesign\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EIntroduced in the PureJwt implementation for v0.2.0\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthClientProfile\u003C/code\u003E has been replaced by \u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe new name distinguishes the application environment from the authentication mode selected by the server.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.ClientProfile = UAuthClientProfile.BlazorServer;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EApplications using automatic profile detection normally do not need to configure this property.\u003C/p\u003E\n\u003Cp\u003ECustom implementations of \u003Ccode\u003EIClientProfileDetector\u003C/code\u003E must migrate to \u003Ccode\u003EIApplicationProfileDetector\u003C/code\u003E. Methods and contracts that previously accepted \u003Ccode\u003EUAuthClientProfile\u003C/code\u003E now use the replacement enum.\u003C/p\u003E\n\u003Cp\u003EThe new enum also distinguishes a Resource API from an ordinary API consumer through \u003Ccode\u003EUAuthApplicationProfile.ResourceApi\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-mode-selection\u0022\u003EAuthentication mode selection\u003C/h3\u003E\n\u003Cp\u003EThe server now supports explicit mode selection:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthMode = UAuthMode.PureOpaque;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor profile-specific customization:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ApplicationProfileModes[UAuthApplicationProfile.BlazorServer] = UAuthMode.PureOpaque;\n\n options.ApplicationProfileModes[UAuthApplicationProfile.BlazorWasm] = UAuthMode.PureJwt;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAuthMode\u003C/code\u003E and \u003Ccode\u003EApplicationProfileModes\u003C/code\u003E cannot be configured together.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E remains an allowlist, \u003Cstrong\u003Enot\u003C/strong\u003E an authentication mode selector.\u003C/p\u003E\n\u003Cp\u003EApplications relying on automatic resolution can keep their existing approach, but should verify the effective mode for each supported application profile.\u003C/p\u003E\n\u003Cp\u003EClient-supplied profile information must not be treated as proof of application identity or trust.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-response-and-grant-delivery-redesign\u0022\u003E17. Authentication Response and Grant Delivery Redesign\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBreaking configuration change in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe former \u003Ccode\u003EAuthResponse\u003C/code\u003E configuration has been replaced by two independent groups:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EGrantDelivery\u003C/code\u003E configures how authentication credentials are returned.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERedirect\u003C/code\u003E configures navigation after login and logout.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe legacy \u003Ccode\u003EUAuthServerOptions.AuthResponse\u003C/code\u003E property is obsolete and throws \u003Ccode\u003ENotSupportedException\u003C/code\u003E when accessed.\u003C/p\u003E\n\u003Cp\u003EApplications that explicitly configured authentication responses must update those settings.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery\u0022\u003ECredential delivery\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AuthResponse.AccessTokenDelivery.Mode = TokenResponseMode.Header;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.GrantDelivery.AccessToken.Mode = GrantDeliveryMode.Header;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA global preference is also available:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.GrantDelivery.Default = GrantDeliveryMode.Cookie;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIndividual grant settings take precedence over the global preference.\u003C/p\u003E\n\u003Cp\u003EWhen no explicit delivery preference is configured, UltimateAuth uses the effective authentication mode and application profile to select its defaults.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EGrantDeliveryMode\u003C/code\u003E replaces \u003Ccode\u003ETokenResponseMode\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe configuration is intentionally more restrictive:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EDelivery settings do not create credentials that are unavailable in the selected authentication mode.\u003C/li\u003E\n\u003Cli\u003EA required grant cannot be disabled using \u003Ccode\u003EGrantDeliveryMode.None\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EGrantDeliveryMode.Body\u003C/code\u003E is not supported by the current grant delivery resolver.\u003C/li\u003E\n\u003Cli\u003EHeader names and formats can be customized through the corresponding grant options.\u003C/li\u003E\n\u003Cli\u003ECookie attributes remain configurable through \u003Ccode\u003Eoptions.Cookie\u003C/code\u003E.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EApplications using built-in response defaults generally do not need to configure grant delivery explicitly.\u003C/p\u003E\n\u003Cp\u003EApplications using custom cookie or header handling should verify that their request-side credential resolution matches the configured response delivery.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-and-logout-redirects\u0022\u003ELogin and logout redirects\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AuthResponse.Login.SuccessRedirect = \u0026quot;/dashboard\u0026quot;;\noptions.AuthResponse.Logout.SuccessRedirect = \u0026quot;/\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Redirect.Login.SuccessRedirect = \u0026quot;/dashboard\u0026quot;;\noptions.Redirect.Logout.SuccessRedirect = \u0026quot;/\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERedirect configuration no longer controls credential delivery.\u003C/p\u003E\n\u003Cp\u003EThe legacy \u003Ccode\u003ELoginRedirectOptions\u003C/code\u003E properties \u003Ccode\u003EFailureQueryKey\u003C/code\u003E, \u003Ccode\u003ECodeQueryKey\u003C/code\u003E, \u003Ccode\u003EFailureCodes\u003C/code\u003E, \u003Ccode\u003EIncludeLockoutTiming\u003C/code\u003E, and \u003Ccode\u003EIncludeRemainingAttempts\u003C/code\u003E have been removed.\u003C/p\u003E\n\u003Cp\u003EApplications that used these options must remove the corresponding configuration and adapt to the supported redirect behavior.\u003C/p\u003E\n\u003Cp\u003EFor authentication failure disclosure, review the \u003Ccode\u003ELogin.IncludeFailureDetails\u003C/code\u003E setting and the security considerations described in Section 8.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-mode-resolution\u0022\u003EAutomatic mode resolution\u003C/h3\u003E\n\u003Cp\u003EThe selected authentication mode now determines which grants are available before delivery configuration is applied.\u003C/p\u003E\n\u003Cp\u003EDo not assume that selecting cookie or header delivery changes the authentication mode or the issued token format.\u003C/p\u003E\n\u003Cp\u003EReview applications that previously depended on response configuration to override mode-specific credential behavior.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022production-cryptographic-key-configuration\u0022\u003E18. Production Cryptographic Key Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003ESecurity-sensitive deployment change in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth now separates JWT signing from server-managed token hashing.\u003C/p\u003E\n\u003Cp\u003EThe built-in cryptography configuration provides two independent keys:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.TokenHashingKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHMAC-SHA256 hashing of server-managed token material\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.JwtSigningKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHS256 JWT access-token signing\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe built-in implementations require valid Base64-encoded key material containing at least 32 bytes per key.\u003C/p\u003E\n\u003Cp\u003EThe keys must be different.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022production-startup-validation\u0022\u003EProduction startup validation\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth includes deterministic cryptographic defaults for local development.\u003C/p\u003E\n\u003Cp\u003EThese defaults are accepted in the \u003Ccode\u003EDevelopment\u003C/code\u003E environment but are rejected outside Development when the corresponding built-in provider is used.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplications that previously started without explicit production cryptographic configuration must now provide securely generated keys.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey = builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey = builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ESupply the values through a secret manager or environment variables:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Cryptography__TokenHashingKey\nUltimateAuth__Cryptography__JwtSigningKey\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EGenerate independent random values using a cryptographically secure random-number generator.\u003C/p\u003E\n\u003Cp\u003EDo not commit production keys to source control or generate new keys on every application startup.\u003C/p\u003E\n\u003Cp\u003EApplications using custom registered signing or hashing providers should review the corresponding provider registrations and validation requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022existing-token-compatibility\u0022\u003EExisting token compatibility\u003C/h3\u003E\n\u003Cp\u003EEarlier built-in token hashing depended on the JWT signing key provider.\u003C/p\u003E\n\u003Cp\u003EThe new implementation uses a separate \u003Ccode\u003ETokenHashingKey\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EChanging the effective token-hashing key can invalidate existing server-managed token credentials whose stored hashes were produced using the previous key.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThis can affect existing sessions or refresh credentials, depending on the application\u0027s active authentication mode and persistence configuration.\u003C/p\u003E\n\u003Cp\u003EPlan an appropriate reauthentication strategy before deploying the new key configuration.\u003C/p\u003E\n\u003Cp\u003EKeep key material consistent across application instances that share authentication state.\u003C/p\u003E\n\u003Cp\u003EJWT signing-key changes can also invalidate previously issued JWTs unless the corresponding verification keys remain available through an explicitly configured validation strategy.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/token-security\u0022\u003EToken Security\u003C/a\u003E and \u003Ca href=\u0022/docs/getting-started/real-world-setup\u0022\u003EReal-World Setup\u003C/a\u003E for current cryptographic configuration guidance.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-authentication-and-resource-api-migration\u0022\u003E19. PureJwt Authentication and Resource API Migration\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003ENew authentication mode implementation in v0.2.0\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E now supports authentication without creating server-side sessions.\u003C/p\u003E\n\u003Cp\u003EIt issues JWT access tokens and uses persisted, device-associated refresh-token chains for renewal.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E and the existing session-backed authentication paths remain available.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ESemiHybrid\u003C/code\u003E is not yet supported by the current implementation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-authentication-behavior\u0022\u003EPureJwt authentication behavior\u003C/h3\u003E\n\u003Cp\u003EUnlike session-backed modes, PureJwt does not require a \u003Ccode\u003ESessionId\u003C/code\u003E or \u003Ccode\u003ESessionChainId\u003C/code\u003E to issue or refresh credentials.\u003C/p\u003E\n\u003Cp\u003EThe JWT access token represents the authenticated identity and can be validated using trusted verification keys.\u003C/p\u003E\n\u003Cp\u003EThe refresh credential remains stateful.\u003C/p\u003E\n\u003Cp\u003EPureJwt refresh:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates the refresh token, tenant, and device association.\u003C/li\u003E\n\u003Cli\u003EConfirms that the refresh credential is not session-bound.\u003C/li\u003E\n\u003Cli\u003ERotates the refresh token and persists its replacement.\u003C/li\u003E\n\u003Cli\u003EIssues a new JWT access token.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EAn invalid, expired, revoked, or incorrectly bound refresh credential cannot continue the authentication flow.\u003C/p\u003E\n\u003Cp\u003ERefresh-token replay detection can revoke the associated refresh chain.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-logout\u0022\u003EPureJwt logout\u003C/h3\u003E\n\u003Cp\u003EPureJwt logout differs from session-based logout.\u003C/p\u003E\n\u003Cp\u003EWhen the authenticated request supplies a refresh token, UltimateAuth validates its ownership and revokes the associated refresh chain.\u003C/p\u003E\n\u003Cp\u003EClients must ensure that the applicable refresh credential is supplied when they expect logout to terminate server-managed refresh capability.\u003C/p\u003E\n\u003Cp\u003EClearing a cookie or deleting a locally stored token is not equivalent to revoking refresh-token state.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EPreviously issued JWT access tokens remain independently valid until expiration\u003C/strong\u003E, unless an additional validation or revocation mechanism prevents their acceptance.\u003C/p\u003E\n\u003Cp\u003EConsequently, PureJwt logout must not be treated as immediate revocation of every already-issued access token.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-configuration\u0022\u003EResource API configuration\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthResourceApiOptions\u003C/code\u003E has been reorganized.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.UAuthHubBaseUrl = \u0026quot;https://auth.example.com\u0026quot;;\noptions.AllowedClientOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\noptions.CorsPolicyName = \u0026quot;UAuthResource\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Hub.BaseUrl = \u0026quot;https://auth.example.com\u0026quot;;\noptions.Cors.AllowedOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\noptions.Cors.PolicyName = \u0026quot;UAuthResource\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResource API authentication settings are now grouped under \u003Ccode\u003Eoptions.Auth\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor a PureJwt Resource API, configure the JWT validation parameters and trusted verification keys:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.Auth.Mode = UAuthMode.PureJwt;\n\n options.Auth.Jwt = new UAuthJwtValidationOptions\n {\n Issuer = \u0026quot;UAuth\u0026quot;,\n Audience = \u0026quot;UAuthClient\u0026quot;,\n ValidAlgorithms = [SecurityAlgorithms.HmacSha256]\n };\n\n options.Cryptography.JwtVerificationKeys.Add(\n new UAuthJwtVerificationKeyOptions\n {\n KeyId = \u0026quot;uauth-hs256-v1\u0026quot;,\n Key = builder.Configuration[\u0026quot;UltimateAuth:JwtVerificationKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT verification key is missing.\u0026quot;)\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe issuer, audience, algorithm, key ID, and key material must match the issuing authority\u0027s configuration.\u003C/p\u003E\n\u003Cp\u003EWhen using the built-in symmetric signing implementation, the trusted Resource API verification key contains the same cryptographic key material as the authority\u0027s JWT signing key.\u003C/p\u003E\n\u003Cp\u003EDo not configure the server\u0027s token-hashing key as a Resource API verification key.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022remote-versus-local-authentication\u0022\u003ERemote versus local authentication\u003C/h3\u003E\n\u003Cp\u003EThe built-in Resource API mode selection now defaults to \u003Ccode\u003EPureJwt\u003C/code\u003E, rather than assuming remote session validation.\u003C/p\u003E\n\u003Cp\u003EThis is a \u003Cstrong\u003Ebehavioral change for applications that previously relied on the Resource API\u0027s implicit session-validation configuration\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003ETo retain remote session validation, explicitly select the appropriate session-backed mode and configure \u003Ccode\u003EHub.BaseUrl\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EA PureJwt Resource API validates JWTs locally and does not require a Hub URL for each access-token validation request.\u003C/p\u003E\n\u003Cp\u003EReview existing Resource APIs before upgrading, especially when they expect opaque session IDs instead of JWT access tokens.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/client-sdk/resource-api-requests\u0022\u003EResource API Requests\u003C/a\u003E and \u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-persistence-and-database-migration\u0022\u003E20. Refresh Token Persistence and Database Migration\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EPersistence and custom-store breaking change in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ERefresh-token persistence now supports both session-backed credentials and session-independent PureJwt refresh chains.\u003C/p\u003E\n\u003Cp\u003EThe refresh-token model introduces \u003Ccode\u003ERefreshChainId\u003C/code\u003E and additional device and authentication metadata.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ESessionId\u003C/code\u003E is now nullable, and the previous \u003Ccode\u003EChainId\u003C/code\u003E association is explicitly named \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ef-core-schema-changes\u0022\u003EEF Core schema changes\u003C/h3\u003E\n\u003Cp\u003EApplications using UltimateAuth\u0027s EF Core token persistence must update their database schema before deploying the new runtime.\u003C/p\u003E\n\u003Cp\u003EThe reference migrations introduce:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EChange\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EChainId\u003C/code\u003E \u2192 \u003Ccode\u003ESessionChainId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERenamed session-chain association\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESessionId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENullable to support PureJwt\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshChainId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENew required refresh-chain identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENew nullable device association\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthenticatedAt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENew nullable authentication timestamp\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EIndexes\u003C/td\u003E\n\u003Ctd\u003EAdditional refresh-chain and device lookup indexes\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe reference migrations are provided for the sample applications and Identity Lab.\u003C/p\u003E\n\u003Cp\u003EApplications using their own \u003Ccode\u003EDbContext\u003C/code\u003E must generate and review the corresponding EF Core migration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022existing-refresh-token-records\u0022\u003EExisting refresh-token records\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E The generated reference migrations introduce \u003Ccode\u003ERefreshChainId\u003C/code\u003E as a required column with \u003Ccode\u003EGuid.Empty\u003C/code\u003E as the default for pre-existing rows.\u003C/p\u003E\n\u003Cp\u003EThis default supports schema migration but does not establish valid, distinct refresh-chain identities for existing tokens.\u003C/p\u003E\n\u003Cp\u003EDo not assume previously persisted refresh credentials remain compatible with the new token model.\u003C/p\u003E\n\u003Cp\u003EBefore production migration:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EBack up the authentication database.\u003C/li\u003E\n\u003Cli\u003EReview existing refresh-token rows and their session or chain associations.\u003C/li\u003E\n\u003Cli\u003EDecide whether existing refresh credentials should be invalidated or migrated using a reviewed, data-preserving procedure.\u003C/li\u003E\n\u003Cli\u003EAvoid treating \u003Ccode\u003EGuid.Empty\u003C/code\u003E as a valid refresh-chain identifier.\u003C/li\u003E\n\u003Cli\u003EApply the schema migration before deploying the runtime that expects the new model.\u003C/li\u003E\n\u003Cli\u003EVerify login, refresh, logout, and replay handling after deployment.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EIf existing refresh credentials are intentionally invalidated, applications must allow affected users to authenticate again.\u003C/p\u003E\n\u003Cp\u003EDo not use the example migrations as proof that all existing refresh-token records have been semantically migrated.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-refresh-token-stores\u0022\u003ECustom refresh-token stores\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EIRefreshTokenStore\u003C/code\u003E contract now distinguishes session-chain and refresh-chain revocation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ERevokeByChainAsync(...)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ERevokeBySessionChainAsync(...)\nRevokeByRefreshChainAsync(...)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ECustom implementations must support the revised contract.\u003C/p\u003E\n\u003Cp\u003EThe refresh-chain operation must revoke only the intended refresh-token lineage within the applicable tenant.\u003C/p\u003E\n\u003Cp\u003EApplications with custom token projections, mappers, validators, or issuance services must also account for the new nullable session association and refresh-chain identity.\u003C/p\u003E\n\u003Cp\u003EThe built-in EF Core and in-memory token stores implement the updated contracts.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-integrations-and-compatibility-review\u0022\u003E21. Custom Integrations and Compatibility Review\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAdditional API and contract changes in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe changes in this section primarily affect applications replacing or extending UltimateAuth\u0027s built-in implementations.\u003C/p\u003E\n\u003Cp\u003EApplications using the standard client and server registration methods generally do not need to implement these interfaces.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-context-and-refresh-results\u0022\u003EToken context and refresh results\u003C/h3\u003E\n\u003Cp\u003ESeveral public token-related contracts now distinguish session chains from refresh chains.\u003C/p\u003E\n\u003Cp\u003EFor custom integrations, review:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003ETokenIssuanceContext.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ETokenIssuanceContext.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERefreshTokenRotationExecution.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ERefreshTokenRotationExecution.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERefreshTokenValidationResult.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ERefreshTokenValidationResult.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERefreshToken.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ERefreshToken.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe new \u003Ccode\u003ERefreshChainId\u003C/code\u003E is a separate identity. It must not be treated as an interchangeable replacement for \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EPureJwt token issuance and validation can operate without a server-side session, whereas session-backed modes preserve their session associations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-authentication-and-response-components\u0022\u003ECustom authentication and response components\u003C/h3\u003E\n\u003Cp\u003ECustom implementations using the previous application profile, authentication mode resolver, credential resolver, or response-delivery contracts must be reviewed for signature and behavior changes.\u003C/p\u003E\n\u003Cp\u003EIn particular:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication mode resolution now uses an explicit \u003Ccode\u003EAuthModeResolutionContext\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EEffective grant delivery uses \u003Ccode\u003EEffectiveGrantDelivery\u003C/code\u003E rather than the legacy credential-response options.\u003C/li\u003E\n\u003Cli\u003EJWT-based authentication requires verification of trusted claims and device binding.\u003C/li\u003E\n\u003Cli\u003EPureJwt authorization must not assume that a session ID exists.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EApplications with direct dependencies on these extension points should compile and run their integration tests against v0.2.0 before deployment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022compatibility-testing\u0022\u003ECompatibility testing\u003C/h3\u003E\n\u003Cp\u003EFor customized deployments, verify the following scenarios against the selected authentication mode:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EInitial login and credential issuance.\u003C/li\u003E\n\u003Cli\u003EAuthenticated request validation.\u003C/li\u003E\n\u003Cli\u003ERefresh and token rotation.\u003C/li\u003E\n\u003Cli\u003ELogout and refresh-chain termination.\u003C/li\u003E\n\u003Cli\u003EAuthorization for protected HTTP endpoints.\u003C/li\u003E\n\u003Cli\u003EDevice mismatch handling.\u003C/li\u003E\n\u003Cli\u003ERestart and multi-instance persistence behavior.\u003C/li\u003E\n\u003Cli\u003EResource API authentication and CORS configuration.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThese checks are especially important when upgrading implementations that previously assumed all authentication contexts were backed by server-side sessions.\u003C/p\u003E\n\u003Chr\u003E\n\u003Cp\u003EThis page will continue to evolve through the v0.2.0 preview and RC series and will become the stable migration guide when v0.2.0 is released.\u003C/p\u003E\n", + "Html": "\n\u003Cp\u003E\u003Cstrong\u003EMigration Impact: High \u2014 In Progress\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ELatest published prerelease reviewed: v0.2.0-preview.4\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThis guide covers migration requirements for the upcoming UltimateAuth v0.2.0 release.\u003C/p\u003E\n\u003Cp\u003EThe guide is provisional and will be updated as new preview and release candidate versions become available. The final migration requirements may change before the stable v0.2.0 release.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022migration-overview\u0022\u003EMigration Overview\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth v0.2.0 introduces new authentication capabilities, strengthens security defaults, and reorganizes several public configuration APIs.\u003C/p\u003E\n\u003Cp\u003EFor applications using the built-in integrations and default authentication behavior, migration primarily involves reviewing configuration changes, providing production cryptographic keys, and applying any required database migrations.\u003C/p\u003E\n\u003Cp\u003EApplications with custom authentication policies, persistence stores, credential delivery settings, or Resource API configurations should also review the detailed sections below.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ERecommended upgrade sequence:\u003C/strong\u003E\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EUpdate renamed public APIs and configuration properties.\u003C/li\u003E\n\u003Cli\u003EConfigure and validate cryptographic keys before production deployment.\u003C/li\u003E\n\u003Cli\u003EReview authentication mode and credential delivery behavior.\u003C/li\u003E\n\u003Cli\u003EApply required persistence migrations.\u003C/li\u003E\n\u003Cli\u003EVerify login, refresh, logout, authorization, and Resource API integration.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-public-api-changes\u0022\u003ECommon Public API Changes\u003C/h3\u003E\n\u003Cp\u003EThe following table focuses on commonly accessed public APIs and configuration properties. Internal implementation types and advanced extension-point changes are covered in the detailed migration sections.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EBefore (v0.1.x)\u003C/th\u003E\n\u003Cth\u003EAfter (v0.2.0)\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthClientProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectClientProfile\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EAutoDetectApplicationProfile\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EClientProfileModes\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EApplicationProfileModes\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIClientProfileDetector\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIApplicationProfileDetector\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EIFlowClient.LoginAsync(...)\u003C/code\u003E returning \u003Ccode\u003ETask\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EIFlowClient.LoginAsync(...)\u003C/code\u003E returning \u003Ccode\u003ETask\u0026lt;UAuthResult\u0026gt;\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ETokenResponseMode\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDeliveryMode\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.SessionIdDelivery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDelivery.Session\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.AccessTokenDelivery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDelivery.AccessToken\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.RefreshTokenDelivery\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EGrantDelivery.RefreshToken\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.Login\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirect.Login\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthResponse.Logout\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003ERedirect.Logout\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.UAuthHubBaseUrl\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.Hub.BaseUrl\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.AllowedClientOrigins\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.Cors.AllowedOrigins\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.CorsPolicyName\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003EResourceApi.Cors.PolicyName\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-behavioral-changes\u0022\u003ECommon Behavioral Changes\u003C/h3\u003E\n\u003Cp\u003EThe following changes may affect existing applications even when no compilation errors occur.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EArea\u003C/th\u003E\n\u003Cth\u003EPrevious Behavior\u003C/th\u003E\n\u003Cth\u003Ev0.2.0 Behavior\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ELogin submission\u003C/td\u003E\n\u003Ctd\u003ENavigation-based\u003C/td\u003E\n\u003Ctd\u003EAutomatic navigation or fetch selection\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EHybrid access token\u003C/td\u003E\n\u003Ctd\u003EOpaque\u003C/td\u003E\n\u003Ctd\u003EJWT\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAPI authentication mode\u003C/td\u003E\n\u003Ctd\u003EPureJwt under the previous v0.2.0 resolver\u003C/td\u003E\n\u003Ctd\u003EHybrid\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EResource API authentication\u003C/td\u003E\n\u003Ctd\u003ERemote session validation\u003C/td\u003E\n\u003Ctd\u003EHybrid remote session validation by default\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EAccess-token handling\u003C/td\u003E\n\u003Ctd\u003EApplication-managed when required\u003C/td\u003E\n\u003Ctd\u003EBuilt-in in-memory token store\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ELogout completion\u003C/td\u003E\n\u003Ctd\u003ENavigation-oriented submission\u003C/td\u003E\n\u003Ctd\u003EResponse-aware completion and local credential cleanup\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EApplications using the standard UltimateAuth integrations generally do not need to rewrite their login or logout implementations.\u003C/p\u003E\n\u003Cp\u003EHowever, applications relying on specific navigation behavior, custom credential handling, or explicit authentication mode assumptions should review the corresponding migration sections.\u003C/p\u003E\n\u003Cp\u003EThese are API and configuration-path replacements, not guarantees of identical behavior.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E \u003Ccode\u003EAuthResponse\u003C/code\u003E is obsolete and no longer functional. Accessing it throws \u003Ccode\u003ENotSupportedException\u003C/code\u003E. Applications must migrate to \u003Ccode\u003EGrantDelivery\u003C/code\u003E and \u003Ccode\u003ERedirect\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EAuthentication modes and credential delivery now have separate responsibilities. The effective authentication mode determines which grants exist; delivery settings determine how those grants are transported.\u003C/p\u003E\n\u003Cp\u003EThe public \u003Ccode\u003EIUAuthClient\u003C/code\u003E entry point and standard UltimateAuth registration methods remain available. Applications relying on built-in defaults generally do not need to replace their authentication integration.\u003C/p\u003E\n\u003Cp\u003EThe following sections explain the behavioral changes, security implications, and additional migration requirements in detail.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022asynchronous-authorization-policies\u0022\u003E1. Asynchronous Authorization Policies\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.1\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ECustom implementations of \u003Ccode\u003EIAccessPolicy\u003C/code\u003E, \u003Ccode\u003EIAccessInvariant\u003C/code\u003E, and \u003Ccode\u003EIAccessAuthority\u003C/code\u003E should migrate to \u003Ccode\u003EDecideAsync\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic AccessDecision Decide(AccessContext context)\n{\n return AccessDecision.Allow();\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Epublic ValueTask\u0026lt;AccessDecision\u0026gt; DecideAsync(AccessContext context, CancellationToken ct = default)\n{\n return ValueTask.FromResult(AccessDecision.Allow());\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor \u003Ccode\u003EIAccessAuthority\u003C/code\u003E, preserve the existing \u003Ccode\u003EruntimePolicies\u003C/code\u003E parameter and add the cancellation token.\u003C/p\u003E\n\u003Cp\u003ESynchronous \u003Ccode\u003EDecide\u003C/code\u003E methods are obsolete. Existing synchronous implementations retain compatibility through the interface defaults, but new implementations should use \u003Ccode\u003EDecideAsync\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EIf your application invokes an authority directly, switch to \u003Ccode\u003EDecideAsync\u003C/code\u003E and await the result.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-check-results\u0022\u003E2. Authorization Check Results\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.1\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ECheckAsync\u003C/code\u003E now returns an explicit authorization decision in the response body.\u003C/p\u003E\n\u003Cp\u003EIf your application previously interpreted HTTP \u003Ccode\u003E403\u003C/code\u003E as the result of a successful authorization evaluation that denied access, update that handling.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Authorization.CheckAsync(request);\n\nif (result.IsSuccess \u0026amp;\u0026amp; result.Value is { IsAllowed: true })\n{\n // Authorized\n}\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAn HTTP-successful authorization check does not necessarily mean that access was granted.\u003C/p\u003E\n\u003Cp\u003EInspect the returned authorization decision rather than relying solely on the HTTP status.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-user-lifecycle-integrations\u0022\u003E3. Custom User Lifecycle Integrations\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe \u003Ccode\u003EIUserLifecycleIntegration.OnUserCreatedAsync\u003C/code\u003E signature now includes \u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask OnUserCreatedAsync(\n TenantKey tenant,\n UserKey userKey,\n object request,\n CancellationToken ct = default);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask OnUserCreatedAsync(\n TenantKey tenant,\n UserKey userKey,\n object request,\n UAuthApplicationProfile applicationProfile,\n CancellationToken ct = default);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EUpdate custom implementations to accept the additional client profile parameter.\u003C/p\u003E\n\u003Cp\u003EApplications using built-in lifecycle integrations do not need to make this change.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022identifier-and-profile-limits\u0022\u003E4. Identifier and Profile Limits\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe reference Users domain now enforces additional identifier and profile safety limits.\u003C/p\u003E\n\u003Cp\u003EThe default maximum is 10 active identifiers per user. Applications requiring a different capacity should configure \u003Ccode\u003EIdentifiers.Behavior.MaxIdentifiersPerUser\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EExisting profile creation and update operations must also respect the new field-length and metadata limits.\u003C/p\u003E\n\u003Cp\u003EIf you use EF Core persistence:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EReview existing profile data for values exceeding the new limits.\u003C/li\u003E\n\u003Cli\u003EAdd or apply the appropriate EF Core database migration for your application\u0027s DbContext.\u003C/li\u003E\n\u003Cli\u003EVerify that applications handling profile validation errors use the returned error codes.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/plugin-domains/profile-validation-limits\u0022\u003EProfile Validation \u0026amp; Limits\u003C/a\u003E for the supported limits.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022password-policies-and-history\u0022\u003E5. Password Policies and History\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe reference password credential implementation now applies configurable password policies, with Standard as the default level.\u003C/p\u003E\n\u003Cp\u003EReview custom registration, password-change, and password-reset flows to ensure that they handle server-side password validation errors.\u003C/p\u003E\n\u003Cp\u003EApplications using persistent password-history storage must apply the required database migration before enabling password history.\u003C/p\u003E\n\u003Cp\u003EPassword history is disabled by default (\u003Ccode\u003ERememberLast = 0\u003C/code\u003E).\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/password-policy\u0022\u003EPassword Policy \u0026amp; History\u003C/a\u003E for configuration and persistence requirements.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022rate-limiting\u0022\u003E6. Rate Limiting\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.2\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EBuilt-in endpoint rate limiting is enabled by default when using:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseUltimateAuthWithAspNetCore();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIf your application already registers its own rate limiting middleware, avoid installing a duplicate limiter.\u003C/p\u003E\n\u003Cp\u003ETo retain application-owned rate limiting:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eapp.UseUltimateAuthWithAspNetCore(useRateLimiting: false);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThen configure your existing \u003Ccode\u003EUseRateLimiter()\u003C/code\u003E middleware in the appropriate pipeline position.\u003C/p\u003E\n\u003Cp\u003EApplications using \u003Ccode\u003EUseUltimateAuth()\u003C/code\u003E without the integrated ASP.NET Core helper do not enable UltimateAuth rate limiting by default.\u003C/p\u003E\n\u003Cp\u003EReview custom HTTP clients and authentication flows for HTTP \u003Ccode\u003E429 Too Many Requests\u003C/code\u003E handling.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/rate-limiting\u0022\u003ERate Limiting\u003C/a\u003E for middleware integration and defaults.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022native-login-form-and-credential-submission\u0022\u003E7. Native Login Form and Credential Submission\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginForm\u003C/code\u003E no longer accepts \u003Ccode\u003EIdentifier\u003C/code\u003E and \u003Ccode\u003ESecret\u003C/code\u003E component parameters.\u003C/p\u003E\n\u003Cp\u003ECredentials are now read directly from native browser form inputs. This reduces unnecessary exposure of passwords through Blazor component state and Blazor Server\u0027s interactive communication.\u003C/p\u003E\n\u003Cp\u003EApplications using the removed component parameters must update their login forms.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm Identifier=\u0026quot;@identifier\u0026quot; Secret=\u0026quot;@password\u0026quot; /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter \u2014 built-in form:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm /\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen no child content is provided, UltimateAuth renders the identifier field, password field, and submit button automatically.\u003C/p\u003E\n\u003Cp\u003EFor custom layouts, provide native-compatible credential inputs:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003ERazor\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-razor\u0022\u003E\u0026lt;UAuthLoginForm\u0026gt;\n \u0026lt;input name=\u0026quot;Identifier\u0026quot; autocomplete=\u0026quot;username\u0026quot; required /\u0026gt;\n \u0026lt;input name=\u0026quot;Secret\u0026quot; type=\u0026quot;password\u0026quot;\n autocomplete=\u0026quot;current-password\u0026quot; required /\u0026gt;\n \u0026lt;button type=\u0026quot;submit\u0026quot;\u0026gt;Sign in\u0026lt;/button\u0026gt;\n\u0026lt;/UAuthLoginForm\u0026gt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ECustom inputs must use the exact HTML \u003Ccode\u003Ename\u003C/code\u003E - \u003Ccode\u003EIdentifier\u003C/code\u003E and \u003Ccode\u003ESecret\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EKeep credential inputs enabled during submission. Disabled inputs are excluded from native form submissions; disable the submit button instead.\u003C/p\u003E\n\u003Cp\u003EThe existing \u003Ccode\u003ETryOnly\u003C/code\u003E, \u003Ccode\u003ETryAndCommit\u003C/code\u003E, and \u003Ccode\u003EDirectCommit\u003C/code\u003E submission modes remain available.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/client-sdk/authentication\u0022\u003EAuthentication Client SDK\u003C/a\u003E for current login integration guidance.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-failure-details\u0022\u003E8. Authentication Failure Details\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EDefault changed in preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthLoginOptions.IncludeFailureDetails\u003C/code\u003E now defaults to \u003Ccode\u003Efalse\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EPreviously, failed authentication responses could expose lockout reasons, remaining attempts, or lockout expiration details by default.\u003C/p\u003E\n\u003Cp\u003EWith the new default, public authentication failures return generic \u003Ccode\u003EInvalidCredentials\u003C/code\u003E information without exposing account-specific lockout state.\u003C/p\u003E\n\u003Cp\u003EThis applies to ordinary login, login previews, PKCE previews, and login failure redirects.\u003C/p\u003E\n\u003Cp\u003EApplications relying on detailed failure feedback should update their user interfaces to handle generic authentication failures.\u003C/p\u003E\n\u003Cp\u003EDetailed feedback remains available through explicit configuration:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Login.IncludeFailureDetails = true;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003ESecurity consideration:\u003C/strong\u003E Enabling this option may reveal account existence or lockout state to unauthenticated clients. Keep it disabled unless detailed disclosure is an intentional application requirement.\u003C/p\u003E\n\u003Cp\u003EFor authorized administrative inspection, use the authentication lockout management APIs instead.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022asp.net-core-authorization-and-user-status\u0022\u003E9. ASP.NET Core Authorization and User Status\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBehavior changed in preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth now checks account status when authorizing protected ASP.NET Core HTTP endpoints.\u003C/p\u003E\n\u003Cp\u003EA valid session or matching role no longer automatically grants access when the associated user is inactive.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EUser status\u003C/th\u003E\n\u003Cth\u003EOrdinary protected HTTP endpoint\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EActive\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EAllowed when other requirements pass\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESuspended\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESelfSuspended\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDisabled\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMissing or invalid status\u003C/td\u003E\n\u003Ctd\u003EDenied\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EExisting applications that intentionally allow suspended users to access selected protected HTTP endpoints should use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003E[Authorize]\n[UAuthAllowInactive]\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis exception preserves the endpoint\u0027s existing authentication and authorization requirements. It does not grant access to disabled or otherwise ineligible accounts.\u003C/p\u003E\n\u003Cp\u003EFor independently hosted Resource APIs, the validated Hub response must contain a valid \u003Ccode\u003Esnapshot.identity.userStatus\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EOlder custom Hub validation responses that omit this information are no longer sufficient for successful protected HTTP authorization.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthorization policy precedence:\u003C/strong\u003E Explicitly registered ASP.NET Core named policies are now resolved before UltimateAuth action-policy fallback. Review applications that use the same policy name in both systems.\u003C/p\u003E\n\u003Cp\u003EThese changes apply to ASP.NET Core HTTP authorization middleware. They do not automatically replace authorization checks in Blazor component rendering, direct service calls, or direct \u003Ccode\u003EIAuthorizationService.AuthorizeAsync\u003C/code\u003E usage.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022password-verification-and-concurrency-limiting\u0022\u003E10. Password Verification and Concurrency Limiting\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth introduces dummy password verification to reduce observable timing differences between authentication paths.\u003C/p\u003E\n\u003Cp\u003EPassword verification now also uses built-in concurrency limiting to protect CPU and memory resources.\u003C/p\u003E\n\u003Cp\u003EConcurrency limiting is \u003Cstrong\u003Eenabled by default\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThe default configuration uses three coordinated policies:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EPolicy\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EPasswordHashing\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EShared global hashing capacity\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ELogin\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EReal and dummy login verification\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECredentialManagement\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EPassword creation, changes, resets, and history checks\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EDefault capacity is derived from \u003Ccode\u003EMath.Max(2, Environment.ProcessorCount)\u003C/code\u003E. Initial queue capacity is five times the permit limit, and the queue timeout is three seconds.\u003C/p\u003E\n\u003Cp\u003EWhen capacity is exhausted, the server may return HTTP \u003Ccode\u003E429 Too Many Requests\u003C/code\u003E with the error code \u003Ccode\u003Epassword_verification_busy\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EApplications should treat this as a temporary server-capacity condition, not invalid credentials or an expired session.\u003C/p\u003E\n\u003Cp\u003EConfigure capacity based on deployment resources:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ConcurrencyLimiting.PasswordHashing.PermitLimit = 8;\n options.ConcurrencyLimiting.PasswordHashing.QueueLimit = 40;\n options.ConcurrencyLimiting.PasswordHashing.QueueTimeout = TimeSpan.FromSeconds(3);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe default Argon2 parallelism for newly generated hashes is now \u003Ccode\u003E1\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EExisting hashes remain verifiable using their stored parameters. Password resets or hash migrations are not required solely because of this default change.\u003C/p\u003E\n\u003Cp\u003EConcurrency limiting is independent of HTTP endpoint rate limiting and operates per application process.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/concurrency-limiting\u0022\u003EConcurrency Limiting\u003C/a\u003E for configuration and deployment considerations.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-artifact-store-capacity\u0022\u003E11. Authentication Artifact Store Capacity\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe built-in in-memory authentication artifact store now performs periodic expiration cleanup and enforces a configurable capacity limit.\u003C/p\u003E\n\u003Cp\u003EThis affects temporary authentication artifacts such as PKCE authorization codes and login preview receipts.\u003C/p\u003E\n\u003Cp\u003ENew defaults:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ESetting\u003C/th\u003E\n\u003Cth\u003EDefault\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.MaxEntries\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E50,000\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthArtifacts.CleanupInterval\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003E1 minute\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe configured capacity is per application process.\u003C/p\u003E\n\u003Cp\u003EWhen all available entries are occupied by valid artifacts, new artifact creation can fail with HTTP \u003Ccode\u003E503 Service Unavailable\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EApplications with high authentication traffic should monitor artifact capacity and adjust the limits as necessary.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthArtifacts.MaxEntries = 100_000;\n options.AuthArtifacts.CleanupInterval = TimeSpan.FromMinutes(1);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe \u003Ccode\u003EIAuthStore\u003C/code\u003E interface remains unchanged.\u003C/p\u003E\n\u003Cp\u003ECustom artifact-store implementations retain responsibility for their own expiration cleanup and capacity management.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-security-state-persistence\u0022\u003E12. Authentication Security State Persistence\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EPersistence change in preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe EF Core authentication security state implementation introduces stronger uniqueness and concurrency enforcement.\u003C/p\u003E\n\u003Cp\u003EFor PostgreSQL, account-level authentication security state records now use uniqueness semantics that treat null credential-type values as non-distinct.\u003C/p\u003E\n\u003Cp\u003EApplications using PostgreSQL persistence must review their authentication security state data and apply the appropriate EF Core migration.\u003C/p\u003E\n\u003Cp\u003EBefore migration:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EBack up the database.\u003C/li\u003E\n\u003Cli\u003ECheck for duplicate authentication security state records, particularly account-level records with a null credential type.\u003C/li\u003E\n\u003Cli\u003EResolve duplicates before introducing the new unique constraint.\u003C/li\u003E\n\u003Cli\u003EApply the migration through the application\u0027s normal EF Core deployment process.\u003C/li\u003E\n\u003Cli\u003EVerify authentication, lockout, and password recovery operations.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThe reference samples and Identity Lab include corresponding migration changes.\u003C/p\u003E\n\u003Cp\u003EApplications managing their own \u003Ccode\u003EDbContext\u003C/code\u003E must ensure that the updated model and database schema are synchronized.\u003C/p\u003E\n\u003Cp\u003EExisting login and session DTO contracts remain unchanged.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-lockout-and-recovery\u0022\u003E13. Authentication Lockout and Recovery\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth introduces administrative APIs for inspecting and clearing account-level and factor-level authentication lockouts.\u003C/p\u003E\n\u003Cp\u003EThrough \u003Ccode\u003EIUAuthClient.Users\u003C/code\u003E, applications can now use:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar state = await UAuthClient.Users.GetAuthenticationLockoutAsync(userKey,\n new LockoutQueryRequest(AuthenticationSecurityScope.Factor, CredentialType.Password));\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EAnd:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Users.UnlockAuthenticationAsync(userKey,\n new UnlockAuthenticationRequest(AuthenticationSecurityScope.Factor, CredentialType.Password));\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThese operations are authorization-protected and do not require existing applications to change their login integrations.\u003C/p\u003E\n\u003Cp\u003EA successful verified password reset now clears the related password-factor lockout as part of credential recovery.\u003C/p\u003E\n\u003Cp\u003EAccount-level lockouts, unrelated security states, user lifecycle status, and existing session policies remain separate.\u003C/p\u003E\n\u003Cp\u003EThis is an additional recovery capability rather than a breaking API change.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/authentication-lockout\u0022\u003EAuthentication Lockout \u0026amp; Recovery\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022additional-authentication-security-hardening\u0022\u003E14. Additional Authentication Security Hardening\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since preview.3\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ESeveral authentication checks have been strengthened:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ERelative return URLs remain supported, while absolute return URLs require an explicitly allowed origin.\u003C/li\u003E\n\u003Cli\u003EAmbiguous or unsafe return URL paths are rejected.\u003C/li\u003E\n\u003Cli\u003ELogin preview receipts are bound to the original authentication context.\u003C/li\u003E\n\u003Cli\u003EPreview receipts must be consumed successfully and atomically before they can suppress duplicate failed-attempt accounting.\u003C/li\u003E\n\u003Cli\u003EPreviously consumed, mismatched, or stale preview receipts cannot bypass failure accounting.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EApplications using standard UltimateAuth login components should not need additional code changes.\u003C/p\u003E\n\u003Cp\u003ECustom login clients should avoid reusing preview receipts or modifying the authentication context between preview and commit.\u003C/p\u003E\n\u003Cp\u003EApplications relying on arbitrary external redirect targets must explicitly configure the corresponding allowed origins.\u003C/p\u003E\n\u003Cp\u003EThese changes intentionally strengthen validation and may reject requests that were previously accepted.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022device-limits-and-browser-device-type-classification\u0022\u003E15. Device Limits and Browser Device Type Classification\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAvailable since rc.1\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth introduces configurable active-device limits through \u003Ccode\u003EUAuthServerOptions.DeviceLimits\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EApplications can restrict the number of distinct active devices per user and tenant, either globally or by device type.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.DeviceLimits.MaxDevices = 3;\n options.DeviceLimits.TypeLimits[\u0026quot;web\u0026quot;] = 2;\n options.DeviceLimits.Behavior = DeviceLimitBehavior.RejectNewLogin;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDevice limits are \u003Cstrong\u003Edisabled by default\u003C/strong\u003E:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EMaxDevices = null\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ETypeLimits\u003C/code\u003E is empty.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EBehavior = RejectNewLogin\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EExisting applications do not acquire device quotas merely by upgrading.\u003C/p\u003E\n\u003Cp\u003EWhen enabled, \u003Ccode\u003ERejectNewLogin\u003C/code\u003E refuses additional device admission without revoking existing devices.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ERevokeOldest\u003C/code\u003E instead revokes eligible older active device chains when capacity must be freed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022breaking-change-browser-device-type-is-now-web\u0022\u003EBreaking Change: Browser Device Type Is Now \u003Ccode\u003Eweb\u003C/code\u003E\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EBrowser-based clients previously could be classified as \u003Ccode\u003Edesktop\u003C/code\u003E. The built-in Blazor web device provider now reports \u003Ccode\u003EDeviceType = \u0026quot;web\u0026quot;\u003C/code\u003E.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EServer device-type resolution also defaults to \u003Ccode\u003Eweb\u003C/code\u003E when no explicit type is supplied.\u003C/p\u003E\n\u003Cp\u003EThis applies to both desktop and mobile browsers.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EClient Environment\u003C/th\u003E\n\u003Cth\u003EDeviceType\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDesktop browser\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Eweb\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EMobile browser\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Eweb\u003C/code\u003E\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ENative desktop application\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Edesktop\u003C/code\u003E when explicitly provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ENative mobile application\u003C/td\u003E\n\u003Ctd\u003E\u003Ccode\u003Emobile\u003C/code\u003E when explicitly provided\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe change distinguishes browser-based client environments from native application platforms.\u003C/p\u003E\n\u003Cp\u003EIt does not remove the \u003Ccode\u003Edesktop\u003C/code\u003E or \u003Ccode\u003Emobile\u003C/code\u003E classifications.\u003C/p\u003E\n\u003Cp\u003EApplications can continue using these values for appropriate native clients.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022migration-impact\u0022\u003EMigration Impact\u003C/h3\u003E\n\u003Cp\u003EThis is a \u003Cstrong\u003Ebehavioral breaking change\u003C/strong\u003E for applications that rely on device-type classification.\u003C/p\u003E\n\u003Cp\u003EReview implementations that:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EFilter sessions by \u003Ccode\u003EDeviceType\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EDisplay device types in user interfaces.\u003C/li\u003E\n\u003Cli\u003EApply custom device-type policies.\u003C/li\u003E\n\u003Cli\u003EUse device classifications in analytics or diagnostics.\u003C/li\u003E\n\u003Cli\u003EAssume that \u003Ccode\u003Edesktop\u003C/code\u003E represents all desktop-browser sessions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar browserType = \u0026quot;desktop\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar browserType = \u0026quot;web\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDo not infer the operating system from \u003Ccode\u003EDeviceType\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EUse the separate \u003Ccode\u003EPlatform\u003C/code\u003E, \u003Ccode\u003EOperatingSystem\u003C/code\u003E, and \u003Ccode\u003EBrowser\u003C/code\u003E metadata where appropriate.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ENote:\u003C/strong\u003E Device Limits is a new feature introduced in v0.2.0. The example above illustrates migration of existing device-type assumptions, not an earlier \u003Ccode\u003EDeviceLimits.TypeLimits\u003C/code\u003E API.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022existing-persisted-device-records\u0022\u003EExisting Persisted Device Records\u003C/h3\u003E\n\u003Cp\u003EUpdating UltimateAuth does not automatically rewrite device-type values in persisted session chains.\u003C/p\u003E\n\u003Cp\u003EAn existing browser device may still be recorded as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EDeviceType: desktop\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EWhen an incoming \u003Ccode\u003EDeviceId\u003C/code\u003E matches an already active device chain, UltimateAuth preserves that device\u0027s existing type classification.\u003C/p\u003E\n\u003Cp\u003ETherefore, a previously admitted browser device classified as \u003Ccode\u003Edesktop\u003C/code\u003E can retain that classification during subsequent authentication.\u003C/p\u003E\n\u003Cp\u003ENew browser device IDs are classified as \u003Ccode\u003Eweb\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EDuring the transition, both classifications may coexist:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EExisting active browser:\n DeviceType = desktop\n\nNew browser:\n DeviceType = web\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis distinction matters when per-type limits are enabled.\u003C/p\u003E\n\u003Cp\u003ELegacy \u003Ccode\u003Edesktop\u003C/code\u003E records and new \u003Ccode\u003Eweb\u003C/code\u003E records may be counted in different type categories until the existing active device state ends.\u003C/p\u003E\n\u003Cp\u003EApplications should review existing session data and plan an appropriate transition.\u003C/p\u003E\n\u003Cp\u003EIf immediate classification consistency is required, consider controlled reauthentication or device-session revocation.\u003C/p\u003E\n\u003Cp\u003EDo not assume that a database schema migration automatically changes stored device classifications.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022breaking-change-custom-session-stores\u0022\u003EBreaking Change: Custom Session Stores\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EISessionStore\u003C/code\u003E interface introduces a new operation:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask\u0026lt;TResult\u0026gt; ExecuteAdmissionAsync\u0026lt;TResult\u0026gt;(\n Func\u0026lt;CancellationToken, Task\u0026lt;TResult\u0026gt;\u0026gt; action,\n CancellationToken ct = default);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis is an \u003Cstrong\u003Einterface-level breaking change\u003C/strong\u003E for custom session-store implementations.\u003C/p\u003E\n\u003Cp\u003EImplementations must add support for the new method even when device limits are disabled.\u003C/p\u003E\n\u003Cp\u003EWhen limits are enabled, device admission must be atomic and concurrency-safe.\u003C/p\u003E\n\u003Cp\u003ECustom stores must ensure:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAdmission changes are committed atomically.\u003C/li\u003E\n\u003Cli\u003EFailed admissions are rolled back.\u003C/li\u003E\n\u003Cli\u003ESimultaneous login requests cannot exceed configured limits.\u003C/li\u003E\n\u003Cli\u003EConcurrency protection applies across application instances sharing the same persistence infrastructure.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe built-in in-memory and EF Core stores implement the new contract.\u003C/p\u003E\n\u003Cp\u003EThe EF Core implementation uses a serializable transaction for device admission.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022database-migration-requirements\u0022\u003EDatabase Migration Requirements\u003C/h3\u003E\n\u003Cp\u003EDevice Limits does not introduce a new database table or require a schema migration by itself.\u003C/p\u003E\n\u003Cp\u003EThe feature uses existing session root, chain, and session persistence.\u003C/p\u003E\n\u003Cp\u003EHowever, other v0.2.0 persistence changes may still require application database migrations.\u003C/p\u003E\n\u003Cp\u003ECustom \u003Ccode\u003EDbContext\u003C/code\u003E implementations should continue following the database migration requirements documented in the preceding sections.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022upgrade-checklist\u0022\u003EUpgrade Checklist\u003C/h3\u003E\n\u003Col\u003E\n\u003Cli\u003EReview custom device-type consumers and replace browser-specific \u003Ccode\u003Edesktop\u003C/code\u003E assumptions with \u003Ccode\u003Eweb\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EReview active persisted device chains for legacy \u003Ccode\u003Edesktop\u003C/code\u003E classifications.\u003C/li\u003E\n\u003Cli\u003EPlan session turnover or controlled revocation if immediate classification consistency is required.\u003C/li\u003E\n\u003Cli\u003EUpdate custom \u003Ccode\u003EISessionStore\u003C/code\u003E implementations to support \u003Ccode\u003EExecuteAdmissionAsync\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EVerify atomic admission and concurrent login handling before enabling device quotas.\u003C/li\u003E\n\u003Cli\u003EConfigure \u003Ccode\u003EDeviceLimits\u003C/code\u003E explicitly only when the application requires device restrictions.\u003C/li\u003E\n\u003Cli\u003ETest login failure handling and device management behavior with the selected \u003Ccode\u003ERejectNewLogin\u003C/code\u003E or \u003Ccode\u003ERevokeOldest\u003C/code\u003E policy.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/sessions-devices/device-limits\u0022\u003EDevice Limits\u003C/a\u003E for the complete configuration and enforcement reference.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022application-profile-api-redesign\u0022\u003E16. Application Profile API Redesign\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EIntroduced in the PureJwt implementation for v0.2.0\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthClientProfile\u003C/code\u003E has been replaced by \u003Ccode\u003EUAuthApplicationProfile\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe new name distinguishes the application environment from the authentication mode selected by the server.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.ClientProfile = UAuthClientProfile.BlazorServer;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.ApplicationProfile = UAuthApplicationProfile.BlazorServer;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EApplications using automatic profile detection normally do not need to configure this property.\u003C/p\u003E\n\u003Cp\u003ECustom implementations of \u003Ccode\u003EIClientProfileDetector\u003C/code\u003E must migrate to \u003Ccode\u003EIApplicationProfileDetector\u003C/code\u003E. Methods and contracts that previously accepted \u003Ccode\u003EUAuthClientProfile\u003C/code\u003E now use the replacement enum.\u003C/p\u003E\n\u003Cp\u003EThe new enum also distinguishes a Resource API from an ordinary API consumer through \u003Ccode\u003EUAuthApplicationProfile.ResourceApi\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-mode-selection\u0022\u003EAuthentication mode selection\u003C/h3\u003E\n\u003Cp\u003EThe server now supports explicit mode selection:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.AuthMode = UAuthMode.PureOpaque;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor profile-specific customization:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.ApplicationProfileModes[UAuthApplicationProfile.BlazorServer] = UAuthMode.PureOpaque;\n\n options.ApplicationProfileModes[UAuthApplicationProfile.BlazorWasm] = UAuthMode.PureJwt;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Ccode\u003EAuthMode\u003C/code\u003E and \u003Ccode\u003EApplicationProfileModes\u003C/code\u003E cannot be configured together.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowedModes\u003C/code\u003E remains an allowlist, \u003Cstrong\u003Enot\u003C/strong\u003E an authentication mode selector.\u003C/p\u003E\n\u003Cp\u003EApplications relying on automatic resolution can keep their existing approach, but should verify the effective mode for each supported application profile.\u003C/p\u003E\n\u003Cp\u003EClient-supplied profile information must not be treated as proof of application identity or trust.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-response-and-grant-delivery-redesign\u0022\u003E17. Authentication Response and Grant Delivery Redesign\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EBreaking configuration change in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe former \u003Ccode\u003EAuthResponse\u003C/code\u003E configuration has been replaced by two independent groups:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EGrantDelivery\u003C/code\u003E configures how authentication credentials are returned.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERedirect\u003C/code\u003E configures navigation after login and logout.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe legacy \u003Ccode\u003EUAuthServerOptions.AuthResponse\u003C/code\u003E property is obsolete and throws \u003Ccode\u003ENotSupportedException\u003C/code\u003E when accessed.\u003C/p\u003E\n\u003Cp\u003EApplications that explicitly configured authentication responses must update those settings.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022credential-delivery\u0022\u003ECredential delivery\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AuthResponse.AccessTokenDelivery.Mode = TokenResponseMode.Header;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.GrantDelivery.AccessToken.Mode = GrantDeliveryMode.Header;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA global preference is also available:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.GrantDelivery.Default = GrantDeliveryMode.Cookie;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIndividual grant settings take precedence over the global preference.\u003C/p\u003E\n\u003Cp\u003EWhen no explicit delivery preference is configured, UltimateAuth uses the effective authentication mode and application profile to select its defaults.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EGrantDeliveryMode\u003C/code\u003E replaces \u003Ccode\u003ETokenResponseMode\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EThe configuration is intentionally more restrictive:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EDelivery settings do not create credentials that are unavailable in the selected authentication mode.\u003C/li\u003E\n\u003Cli\u003EA required grant cannot be disabled using \u003Ccode\u003EGrantDeliveryMode.None\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EGrantDeliveryMode.Body\u003C/code\u003E is not supported by the current grant delivery resolver.\u003C/li\u003E\n\u003Cli\u003EHeader names and formats can be customized through the corresponding grant options.\u003C/li\u003E\n\u003Cli\u003ECookie attributes remain configurable through \u003Ccode\u003Eoptions.Cookie\u003C/code\u003E.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EApplications using built-in response defaults generally do not need to configure grant delivery explicitly.\u003C/p\u003E\n\u003Cp\u003EApplications using custom cookie or header handling should verify that their request-side credential resolution matches the configured response delivery.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-and-logout-redirects\u0022\u003ELogin and logout redirects\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.AuthResponse.Login.SuccessRedirect = \u0026quot;/dashboard\u0026quot;;\noptions.AuthResponse.Logout.SuccessRedirect = \u0026quot;/\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Redirect.Login.SuccessRedirect = \u0026quot;/dashboard\u0026quot;;\noptions.Redirect.Logout.SuccessRedirect = \u0026quot;/\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ERedirect configuration no longer controls credential delivery.\u003C/p\u003E\n\u003Cp\u003EThe legacy \u003Ccode\u003ELoginRedirectOptions\u003C/code\u003E properties \u003Ccode\u003EFailureQueryKey\u003C/code\u003E, \u003Ccode\u003ECodeQueryKey\u003C/code\u003E, \u003Ccode\u003EFailureCodes\u003C/code\u003E, \u003Ccode\u003EIncludeLockoutTiming\u003C/code\u003E, and \u003Ccode\u003EIncludeRemainingAttempts\u003C/code\u003E have been removed.\u003C/p\u003E\n\u003Cp\u003EApplications that used these options must remove the corresponding configuration and adapt to the supported redirect behavior.\u003C/p\u003E\n\u003Cp\u003EFor authentication failure disclosure, review the \u003Ccode\u003ELogin.IncludeFailureDetails\u003C/code\u003E setting and the security considerations described in Section 8.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022automatic-mode-resolution\u0022\u003EAutomatic mode resolution\u003C/h3\u003E\n\u003Cp\u003EThe selected authentication mode now determines which grants are available before delivery configuration is applied.\u003C/p\u003E\n\u003Cp\u003EDo not assume that selecting cookie or header delivery changes the authentication mode or the issued token format.\u003C/p\u003E\n\u003Cp\u003EReview applications that previously depended on response configuration to override mode-specific credential behavior.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022production-cryptographic-key-configuration\u0022\u003E18. Production Cryptographic Key Configuration\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003ESecurity-sensitive deployment change in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth now separates JWT signing from server-managed token hashing.\u003C/p\u003E\n\u003Cp\u003EThe built-in cryptography configuration provides two independent keys:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EOption\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.TokenHashingKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHMAC-SHA256 hashing of server-managed token material\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ECryptography.JwtSigningKey\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003EHS256 JWT access-token signing\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe built-in implementations require valid Base64-encoded key material containing at least 32 bytes per key.\u003C/p\u003E\n\u003Cp\u003EThe keys must be different.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022production-startup-validation\u0022\u003EProduction startup validation\u003C/h3\u003E\n\u003Cp\u003EUltimateAuth includes deterministic cryptographic defaults for local development.\u003C/p\u003E\n\u003Cp\u003EThese defaults are accepted in the \u003Ccode\u003EDevelopment\u003C/code\u003E environment but are rejected outside Development when the corresponding built-in provider is used.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EApplications that previously started without explicit production cryptographic configuration must now provide securely generated keys.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EFor example:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthServer(options =\u0026gt;\n{\n options.Cryptography.TokenHashingKey = builder.Configuration[\u0026quot;UltimateAuth:Cryptography:TokenHashingKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;Token hashing key is missing.\u0026quot;);\n\n options.Cryptography.JwtSigningKey = builder.Configuration[\u0026quot;UltimateAuth:Cryptography:JwtSigningKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT signing key is missing.\u0026quot;);\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ESupply the values through a secret manager or environment variables:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EUltimateAuth__Cryptography__TokenHashingKey\nUltimateAuth__Cryptography__JwtSigningKey\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EGenerate independent random values using a cryptographically secure random-number generator.\u003C/p\u003E\n\u003Cp\u003EDo not commit production keys to source control or generate new keys on every application startup.\u003C/p\u003E\n\u003Cp\u003EApplications using custom registered signing or hashing providers should review the corresponding provider registrations and validation requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022existing-token-compatibility\u0022\u003EExisting token compatibility\u003C/h3\u003E\n\u003Cp\u003EEarlier built-in token hashing depended on the JWT signing key provider.\u003C/p\u003E\n\u003Cp\u003EThe new implementation uses a separate \u003Ccode\u003ETokenHashingKey\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EChanging the effective token-hashing key can invalidate existing server-managed token credentials whose stored hashes were produced using the previous key.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThis can affect existing sessions or refresh credentials, depending on the application\u0027s active authentication mode and persistence configuration.\u003C/p\u003E\n\u003Cp\u003EPlan an appropriate reauthentication strategy before deploying the new key configuration.\u003C/p\u003E\n\u003Cp\u003EKeep key material consistent across application instances that share authentication state.\u003C/p\u003E\n\u003Cp\u003EJWT signing-key changes can also invalidate previously issued JWTs unless the corresponding verification keys remain available through an explicitly configured validation strategy.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/token-security\u0022\u003EToken Security\u003C/a\u003E and \u003Ca href=\u0022/docs/getting-started/real-world-setup\u0022\u003EReal-World Setup\u003C/a\u003E for current cryptographic configuration guidance.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-authentication-and-resource-api-migration\u0022\u003E19. PureJwt Authentication and Resource API Migration\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003ENew authentication mode implementation in v0.2.0\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EPureJwt\u003C/code\u003E now supports authentication without creating server-side sessions.\u003C/p\u003E\n\u003Cp\u003EIt issues JWT access tokens and uses persisted, device-associated refresh-token chains for renewal.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EPureOpaque\u003C/code\u003E and the existing session-backed authentication paths remain available.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ESemiHybrid\u003C/code\u003E is not yet supported by the current implementation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-authentication-behavior\u0022\u003EPureJwt authentication behavior\u003C/h3\u003E\n\u003Cp\u003EUnlike session-backed modes, PureJwt does not require a \u003Ccode\u003ESessionId\u003C/code\u003E or \u003Ccode\u003ESessionChainId\u003C/code\u003E to issue or refresh credentials.\u003C/p\u003E\n\u003Cp\u003EThe JWT access token represents the authenticated identity and can be validated using trusted verification keys.\u003C/p\u003E\n\u003Cp\u003EThe refresh credential remains stateful.\u003C/p\u003E\n\u003Cp\u003EPureJwt refresh:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EValidates the refresh token, tenant, and device association.\u003C/li\u003E\n\u003Cli\u003EConfirms that the refresh credential is not session-bound.\u003C/li\u003E\n\u003Cli\u003ERotates the refresh token and persists its replacement.\u003C/li\u003E\n\u003Cli\u003EIssues a new JWT access token.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EAn invalid, expired, revoked, or incorrectly bound refresh credential cannot continue the authentication flow.\u003C/p\u003E\n\u003Cp\u003ERefresh-token replay detection can revoke the associated refresh chain.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-logout\u0022\u003EPureJwt logout\u003C/h3\u003E\n\u003Cp\u003EPureJwt logout differs from session-based logout.\u003C/p\u003E\n\u003Cp\u003EWhen the authenticated request supplies a refresh token, UltimateAuth validates its ownership and revokes the associated refresh chain.\u003C/p\u003E\n\u003Cp\u003EClients must ensure that the applicable refresh credential is supplied when they expect logout to terminate server-managed refresh capability.\u003C/p\u003E\n\u003Cp\u003EClearing a cookie or deleting a locally stored token is not equivalent to revoking refresh-token state.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EPreviously issued JWT access tokens remain independently valid until expiration\u003C/strong\u003E, unless an additional validation or revocation mechanism prevents their acceptance.\u003C/p\u003E\n\u003Cp\u003EConsequently, PureJwt logout must not be treated as immediate revocation of every already-issued access token.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022resource-api-configuration\u0022\u003EResource API configuration\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003EUAuthResourceApiOptions\u003C/code\u003E has been reorganized.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.UAuthHubBaseUrl = \u0026quot;https://auth.example.com\u0026quot;;\noptions.AllowedClientOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\noptions.CorsPolicyName = \u0026quot;UAuthResource\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Hub.BaseUrl = \u0026quot;https://auth.example.com\u0026quot;;\noptions.Cors.AllowedOrigins.Add(\u0026quot;https://app.example.com\u0026quot;);\noptions.Cors.PolicyName = \u0026quot;UAuthResource\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EResource API authentication settings are now grouped under \u003Ccode\u003Eoptions.Auth\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EFor a PureJwt Resource API, configure the JWT validation parameters and trusted verification keys:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.Auth.Mode = UAuthMode.PureJwt;\n\n options.Auth.Jwt = new UAuthJwtValidationOptions\n {\n Issuer = \u0026quot;UAuth\u0026quot;,\n Audience = \u0026quot;UAuthClient\u0026quot;,\n ValidAlgorithms = [SecurityAlgorithms.HmacSha256]\n };\n\n options.Cryptography.JwtVerificationKeys.Add(\n new UAuthJwtVerificationKeyOptions\n {\n KeyId = \u0026quot;uauth-hs256-v1\u0026quot;,\n Key = builder.Configuration[\u0026quot;UltimateAuth:JwtVerificationKey\u0026quot;]\n ?? throw new InvalidOperationException(\u0026quot;JWT verification key is missing.\u0026quot;)\n });\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe issuer, audience, algorithm, key ID, and key material must match the issuing authority\u0027s configuration.\u003C/p\u003E\n\u003Cp\u003EWhen using the built-in symmetric signing implementation, the trusted Resource API verification key contains the same cryptographic key material as the authority\u0027s JWT signing key.\u003C/p\u003E\n\u003Cp\u003EDo not configure the server\u0027s token-hashing key as a Resource API verification key.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022remote-versus-local-authentication\u0022\u003ERemote versus local authentication\u003C/h3\u003E\n\u003Cp\u003EThe built-in authentication mode resolver now selects PureOpaque for BlazorServer and Hybrid for all other application profiles.\u003C/p\u003E\n\u003Cp\u003EResource APIs default to Hybrid.\u003C/p\u003E\n\u003Cp\u003EExisting applications using remote session validation can continue using session-backed authentication by configuring the Hub address.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Ebuilder.Services.AddUltimateAuthResourceApi(options =\u0026gt;\n{\n options.Hub.BaseUrl = \u0026quot;https://auth.example.com\u0026quot;;\n});\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe default incoming session credential transport is cookie-based.\u003C/p\u003E\n\u003Cp\u003EPureJwt must be explicitly selected when independent JWT validation is required:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Auth.Mode = UAuthMode.PureJwt;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe issuing authentication server must also be configured to issue compatible PureJwt credentials.\u003C/p\u003E\n\u003Cp\u003EAlthough Hybrid now issues JWT access tokens, the current Hybrid Resource API implementation continues to use remote session validation.\u003C/p\u003E\n\u003Cp\u003EHybrid-aware JWT validation in separate Resource APIs is not yet supported.\u003C/p\u003E\n\u003Cp\u003EUAuthHub and Resource APIs resolve their authentication modes independently. Automatic authentication configuration discovery and mode negotiation are not currently supported.\u003C/p\u003E\n\u003Cp\u003EApplications should verify authentication mode compatibility, cookie scope, credential transport, and CORS configuration before deployment.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-persistence-and-database-migration\u0022\u003E20. Refresh Token Persistence and Database Migration\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EPersistence and custom-store breaking change in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003ERefresh-token persistence now supports both session-backed credentials and session-independent PureJwt refresh chains.\u003C/p\u003E\n\u003Cp\u003EThe refresh-token model introduces \u003Ccode\u003ERefreshChainId\u003C/code\u003E and additional device and authentication metadata.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003ESessionId\u003C/code\u003E is now nullable, and the previous \u003Ccode\u003EChainId\u003C/code\u003E association is explicitly named \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022ef-core-schema-changes\u0022\u003EEF Core schema changes\u003C/h3\u003E\n\u003Cp\u003EApplications using UltimateAuth\u0027s EF Core token persistence must update their database schema before deploying the new runtime.\u003C/p\u003E\n\u003Cp\u003EThe reference migrations introduce:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EChange\u003C/th\u003E\n\u003Cth\u003EDescription\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EChainId\u003C/code\u003E \u2192 \u003Ccode\u003ESessionChainId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ERenamed session-chain association\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ESessionId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENullable to support PureJwt\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003ERefreshChainId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENew required refresh-chain identifier\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EDeviceId\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENew nullable device association\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Ccode\u003EAuthenticatedAt\u003C/code\u003E\u003C/td\u003E\n\u003Ctd\u003ENew nullable authentication timestamp\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EIndexes\u003C/td\u003E\n\u003Ctd\u003EAdditional refresh-chain and device lookup indexes\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe reference migrations are provided for the sample applications and Identity Lab.\u003C/p\u003E\n\u003Cp\u003EApplications using their own \u003Ccode\u003EDbContext\u003C/code\u003E must generate and review the corresponding EF Core migration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022existing-refresh-token-records\u0022\u003EExisting refresh-token records\u003C/h3\u003E\n\u003Cp\u003E\u003Cstrong\u003EImportant:\u003C/strong\u003E The generated reference migrations introduce \u003Ccode\u003ERefreshChainId\u003C/code\u003E as a required column with \u003Ccode\u003EGuid.Empty\u003C/code\u003E as the default for pre-existing rows.\u003C/p\u003E\n\u003Cp\u003EThis default supports schema migration but does not establish valid, distinct refresh-chain identities for existing tokens.\u003C/p\u003E\n\u003Cp\u003EDo not assume previously persisted refresh credentials remain compatible with the new token model.\u003C/p\u003E\n\u003Cp\u003EBefore production migration:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EBack up the authentication database.\u003C/li\u003E\n\u003Cli\u003EReview existing refresh-token rows and their session or chain associations.\u003C/li\u003E\n\u003Cli\u003EDecide whether existing refresh credentials should be invalidated or migrated using a reviewed, data-preserving procedure.\u003C/li\u003E\n\u003Cli\u003EAvoid treating \u003Ccode\u003EGuid.Empty\u003C/code\u003E as a valid refresh-chain identifier.\u003C/li\u003E\n\u003Cli\u003EApply the schema migration before deploying the runtime that expects the new model.\u003C/li\u003E\n\u003Cli\u003EVerify login, refresh, logout, and replay handling after deployment.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EIf existing refresh credentials are intentionally invalidated, applications must allow affected users to authenticate again.\u003C/p\u003E\n\u003Cp\u003EDo not use the example migrations as proof that all existing refresh-token records have been semantically migrated.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-refresh-token-stores\u0022\u003ECustom refresh-token stores\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EIRefreshTokenStore\u003C/code\u003E contract now distinguishes session-chain and refresh-chain revocation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ERevokeByChainAsync(...)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ERevokeBySessionChainAsync(...)\nRevokeByRefreshChainAsync(...)\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003ECustom implementations must support the revised contract.\u003C/p\u003E\n\u003Cp\u003EThe refresh-chain operation must revoke only the intended refresh-token lineage within the applicable tenant.\u003C/p\u003E\n\u003Cp\u003EApplications with custom token projections, mappers, validators, or issuance services must also account for the new nullable session association and refresh-chain identity.\u003C/p\u003E\n\u003Cp\u003EThe built-in EF Core and in-memory token stores implement the updated contracts.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-integrations-and-compatibility-review\u0022\u003E21. Custom Integrations and Compatibility Review\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAdditional API and contract changes in the PureJwt implementation\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThe changes in this section primarily affect applications replacing or extending UltimateAuth\u0027s built-in implementations.\u003C/p\u003E\n\u003Cp\u003EApplications using the standard client and server registration methods generally do not need to implement these interfaces.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-context-and-refresh-results\u0022\u003EToken context and refresh results\u003C/h3\u003E\n\u003Cp\u003ESeveral public token-related contracts now distinguish session chains from refresh chains.\u003C/p\u003E\n\u003Cp\u003EFor custom integrations, review:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003ETokenIssuanceContext.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ETokenIssuanceContext.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERefreshTokenRotationExecution.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ERefreshTokenRotationExecution.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERefreshTokenValidationResult.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ERefreshTokenValidationResult.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ERefreshToken.ChainId\u003C/code\u003E \u2192 \u003Ccode\u003ERefreshToken.SessionChainId\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe new \u003Ccode\u003ERefreshChainId\u003C/code\u003E is a separate identity. It must not be treated as an interchangeable replacement for \u003Ccode\u003ESessionChainId\u003C/code\u003E.\u003C/p\u003E\n\u003Cp\u003EPureJwt token issuance and validation can operate without a server-side session, whereas session-backed modes preserve their session associations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-authentication-and-response-components\u0022\u003ECustom authentication and response components\u003C/h3\u003E\n\u003Cp\u003ECustom implementations using the previous application profile, authentication mode resolver, credential resolver, or response-delivery contracts must be reviewed for signature and behavior changes.\u003C/p\u003E\n\u003Cp\u003EIn particular:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EAuthentication mode resolution now uses an explicit \u003Ccode\u003EAuthModeResolutionContext\u003C/code\u003E.\u003C/li\u003E\n\u003Cli\u003EEffective grant delivery uses \u003Ccode\u003EEffectiveGrantDelivery\u003C/code\u003E rather than the legacy credential-response options.\u003C/li\u003E\n\u003Cli\u003EJWT-based authentication requires verification of trusted claims and device binding.\u003C/li\u003E\n\u003Cli\u003EPureJwt authorization must not assume that a session ID exists.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EApplications with direct dependencies on these extension points should compile and run their integration tests against v0.2.0 before deployment.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022compatibility-testing\u0022\u003ECompatibility testing\u003C/h3\u003E\n\u003Cp\u003EFor customized deployments, verify the following scenarios against the selected authentication mode:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EInitial login and credential issuance.\u003C/li\u003E\n\u003Cli\u003EAuthenticated request validation.\u003C/li\u003E\n\u003Cli\u003ERefresh and token rotation.\u003C/li\u003E\n\u003Cli\u003ELogout and refresh-chain termination.\u003C/li\u003E\n\u003Cli\u003EAuthorization for protected HTTP endpoints.\u003C/li\u003E\n\u003Cli\u003EDevice mismatch handling.\u003C/li\u003E\n\u003Cli\u003ERestart and multi-instance persistence behavior.\u003C/li\u003E\n\u003Cli\u003EResource API authentication and CORS configuration.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EThese checks are especially important when upgrading implementations that previously assumed all authentication contexts were backed by server-side sessions.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-transport-and-client-api-changes\u0022\u003E22. Login Transport and Client API Changes\u003C/h2\u003E\n\u003Cp\u003E\u003Cstrong\u003EAuthentication client changes in v0.2.0\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EUltimateAuth now supports both navigation-based and fetch-based login submission.\u003C/p\u003E\n\u003Cp\u003EThe client discovers the effective server capabilities and selects a compatible login transport automatically.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022loginasync-return-type\u0022\u003ELoginAsync return type\u003C/h3\u003E\n\u003Cp\u003EThe return type of \u003Ccode\u003EIFlowClient.LoginAsync\u003C/code\u003E has changed.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EBefore:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask LoginAsync(LoginRequest request, string? returnUrl = null);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003E\u003Cstrong\u003EAfter:\u003C/strong\u003E\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask\u0026lt;UAuthResult\u0026gt; LoginAsync(\n LoginRequest request,\n string? returnUrl = null,\n UAuthLoginTransport transport = UAuthLoginTransport.Auto);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EExisting awaited calls remain source-compatible:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.LoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EApplications can now inspect the returned result:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Evar result = await UAuthClient.Flows.LoginAsync(request);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EFor navigation-based submissions, successful submission does not itself confirm that the server has accepted the authentication credentials.\u003C/p\u003E\n\u003Cp\u003EFetch-based submissions allow the client to observe the authentication response and process the delivered credentials.\u003C/p\u003E\n\u003Cp\u003ECustom \u003Ccode\u003EIFlowClient\u003C/code\u003E implementations, test doubles, and mocks must be updated to match the new method signature.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022tryloginasync-signature\u0022\u003ETryLoginAsync signature\u003C/h3\u003E\n\u003Cp\u003E\u003Ccode\u003ETryLoginAsync\u003C/code\u003E now accepts an optional login transport parameter:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask\u0026lt;TryLoginResult\u0026gt; TryLoginAsync(\n LoginRequest request,\n UAuthSubmitMode mode,\n string? returnUrl = null,\n UAuthLoginTransport transport = UAuthLoginTransport.Auto);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe existing \u003Ccode\u003ETryOnly\u003C/code\u003E, \u003Ccode\u003ETryAndCommit\u003C/code\u003E, and \u003Ccode\u003EDirectCommit\u003C/code\u003E submission modes remain available.\u003C/p\u003E\n\u003Cp\u003EExisting application calls do not need to specify the new parameter.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022explicit-login-transport\u0022\u003EExplicit login transport\u003C/h3\u003E\n\u003Cp\u003EApplications can explicitly select a transport when necessary:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eawait UAuthClient.Flows.LoginAsync(\n request,\n transport: UAuthLoginTransport.Fetch);\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe available transport strategies are:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ccode\u003EAuto\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003EFetch\u003C/code\u003E\u003C/li\u003E\n\u003Cli\u003E\u003Ccode\u003ENavigation\u003C/code\u003E\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003E\u003Ccode\u003EAuto\u003C/code\u003E is the default and recommended strategy.\u003C/p\u003E\n\u003Cp\u003EApplications must not assume that every login operation performs a full browser navigation.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022login-transport-discovery-endpoint\u0022\u003ELogin transport discovery endpoint\u003C/h3\u003E\n\u003Cp\u003EA new endpoint exposes the effective login transport capabilities:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003E/auth/login/transport\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EApplications using custom endpoint paths can configure:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003Eoptions.Endpoints.LoginTransport = \u0026quot;/login/transport\u0026quot;;\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EReview reverse proxies, endpoint allowlists, and custom authentication endpoint configurations to ensure that this endpoint is accessible to the client.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022custom-client-implementations\u0022\u003ECustom client implementations\u003C/h3\u003E\n\u003Cp\u003EThe \u003Ccode\u003EIFlowClient\u003C/code\u003E contract also introduces:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EC#\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-csharp\u0022\u003ETask\u0026lt;RefreshResult\u0026gt; RecoverAsync();\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis operation supports authentication recovery when a usable access token is unavailable but a compatible refresh credential remains available.\u003C/p\u003E\n\u003Cp\u003ECustom client implementations must implement the updated contract.\u003C/p\u003E\n\u003Cp\u003EApplications using the built-in UltimateAuth client do not need to implement recovery manually.\u003C/p\u003E\n\u003Chr\u003E\n\u003Cp\u003EThis page will continue to evolve through the v0.2.0 preview and RC series and will become the stable migration guide when v0.2.0 is released.\u003C/p\u003E\n", "Headings": [ { "Id": "migration-overview", @@ -13,6 +13,11 @@ "Text": "Common Public API Changes", "Level": 1 }, + { + "Id": "common-behavioral-changes", + "Text": "Common Behavioral Changes", + "Level": 1 + }, { "Id": "asynchronous-authorization-policies", "Text": "1. Asynchronous Authorization Policies", @@ -227,8 +232,38 @@ "Id": "compatibility-testing", "Text": "Compatibility testing", "Level": 1 + }, + { + "Id": "login-transport-and-client-api-changes", + "Text": "22. Login Transport and Client API Changes", + "Level": 0 + }, + { + "Id": "loginasync-return-type", + "Text": "LoginAsync return type", + "Level": 1 + }, + { + "Id": "tryloginasync-signature", + "Text": "TryLoginAsync signature", + "Level": 1 + }, + { + "Id": "explicit-login-transport", + "Text": "Explicit login transport", + "Level": 1 + }, + { + "Id": "login-transport-discovery-endpoint", + "Text": "Login transport discovery endpoint", + "Level": 1 + }, + { + "Id": "custom-client-implementations", + "Text": "Custom client implementations", + "Level": 1 } ], - "SourceHash": "21A685FAC9203B3FC78FE2AD0B3C172E079D4133151E531A97F5648D32DDBE6D", + "SourceHash": "4C6603C0E7EAB0BC2D7843841820053C760DE0AF0D27AC620C7382AF762E8038", "BuilderVersion": "1" } \ No newline at end of file diff --git a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/security/token-security.json b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/security/token-security.json index 18635dc1..bda0a30a 100644 --- a/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/security/token-security.json +++ b/docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.Client/wwwroot/docs/security/token-security.json @@ -1,7 +1,7 @@ { "Slug": "security/token-security", "Title": "Token Security", - "Html": "\n\u003Cp\u003EAuthentication tokens allow clients to present authentication state to protected applications and services.\u003C/p\u003E\n\u003Cp\u003EHowever, not all tokens provide the same security guarantees.\u003C/p\u003E\n\u003Cp\u003EAn opaque credential requires authoritative server-side validation. A JSON Web Token (JWT) can be verified locally using its signature and claims. A refresh credential enables authentication to continue without repeating the original login process.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports these different mechanisms through its authentication modes.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EToken security depends on the credential\u0027s purpose, how it is validated, how long it remains valid, and which security state is consulted during validation.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThis page explains the security characteristics of access and refresh credentials, including issuance, expiration, rotation, replay risks, and revocation boundaries.\u003C/p\u003E\n\u003Cp\u003EFor the overall authentication architecture, see \u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-state-and-credentials\u0022\u003EAuthentication State and Credentials\u003C/h2\u003E\n\u003Cp\u003EA token is authentication material presented by a client.\u003C/p\u003E\n\u003Cp\u003EIt is not the user identity itself.\u003C/p\u003E\n\u003Cp\u003EDepending on the authentication mode, the token may reference server-managed authentication state or contain signed claims that can be validated without retrieving a session.\u003C/p\u003E\n\u003Cp\u003EThese approaches establish different trust boundaries.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-authoritative-authentication\u0022\u003EServer-Authoritative Authentication\u003C/h3\u003E\n\u003Cp\u003EIn server-authoritative modes, a presented opaque credential is validated against server-managed authentication state.\u003C/p\u003E\n\u003Cp\u003EThe server can evaluate the current validity of the corresponding session and applicable security conditions.\u003C/p\u003E\n\u003Cp\u003EThis allows revocation and other authoritative state changes to affect subsequent protected requests.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022locally-validated-authentication\u0022\u003ELocally Validated Authentication\u003C/h3\u003E\n\u003Cp\u003EIn JWT-based modes, a protected resource can validate a token using its signature, issuer, audience, expiration, and other applicable token requirements.\u003C/p\u003E\n\u003Cp\u003EThe resource may not need to consult the issuing server or a session store for every request.\u003C/p\u003E\n\u003Cp\u003EThis reduces the dependency on server-side session lookups but changes how quickly revocation and authorization changes can be enforced.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ENeither model makes the token an identity record. The token is a credential whose validity is determined by the selected authentication mechanism.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-types\u0022\u003EToken Types\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses two principal access credential formats: opaque credentials and JWTs.\u003C/p\u003E\n\u003Cp\u003ERefresh credentials serve a separate purpose.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ECredential\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003Cth\u003EValidation model\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EOpaque access credential\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthenticate protected requests\u003C/td\u003E\n\u003Ctd\u003EAuthoritative server-side validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EJWT access token\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthenticate protected requests\u003C/td\u003E\n\u003Ctd\u003ECryptographic and claims validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EOpaque refresh credential\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EContinue authentication and obtain renewed credentials\u003C/td\u003E\n\u003Ctd\u003ERefresh-specific validation and state checks\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe distinction between access and refresh credentials is important.\u003C/p\u003E\n\u003Cp\u003EAccess credentials are presented to protected resources.\u003C/p\u003E\n\u003Cp\u003ERefresh credentials are presented to the authentication system for a continuation operation. They should not be accepted as ordinary access credentials.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022opaque-access-credentials\u0022\u003EOpaque Access Credentials\u003C/h2\u003E\n\u003Cp\u003EAn opaque credential is a value whose contents do not expose the authenticated identity or authorization claims to the client.\u003C/p\u003E\n\u003Cp\u003EConceptually:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EAccess credential:\nq8Vn2...random-opaque-value...M7x\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client presents the credential, but cannot determine its authorization meaning by decoding it.\u003C/p\u003E\n\u003Cp\u003EThe server resolves and validates the associated authentication state.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-properties\u0022\u003ESecurity Properties\u003C/h3\u003E\n\u003Cp\u003EOpaque access credentials provide several useful characteristics:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ETheir meaning is determined by authoritative server-side state.\u003C/li\u003E\n\u003Cli\u003EThey do not need to expose identity claims in a client-readable payload.\u003C/li\u003E\n\u003Cli\u003ETheir validity can be affected by session expiration or revocation.\u003C/li\u003E\n\u003Cli\u003EThey can participate in account-level and chain-level security enforcement.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EHowever, opaque credentials are still bearer credentials unless an additional proof mechanism is enforced.\u003C/p\u003E\n\u003Cp\u003EAn attacker who obtains a usable opaque credential may be able to present it.\u003C/p\u003E\n\u003Cp\u003EOpacity alone does not prevent credential theft or replay.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-side-validation\u0022\u003EServer-Side Validation\u003C/h3\u003E\n\u003Cp\u003EIn a session-authoritative mode, validation can enforce the applicable session hierarchy requirements, including expiration, revocation, ownership, and security state consistency.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/session-security\u0022\u003ESession Security Model\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022jwt-access-tokens\u0022\u003EJWT Access Tokens\u003C/h2\u003E\n\u003Cp\u003EA JWT is a structured token containing signed claims.\u003C/p\u003E\n\u003Cp\u003EA typical JWT contains three encoded sections:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Eheader.payload.signature\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts payload may describe the authenticated subject, tenant, authorization information, token lifetime, and other relevant context.\u003C/p\u003E\n\u003Cp\u003EA JWT is not encrypted merely because it is encoded and signed.\u003C/p\u003E\n\u003Cp\u003EApplications should not place secrets or unnecessarily sensitive information in a JWT payload.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022cryptographic-validation\u0022\u003ECryptographic Validation\u003C/h3\u003E\n\u003Cp\u003EA protected resource must validate the JWT according to the configured token requirements.\u003C/p\u003E\n\u003Cp\u003ERelevant checks include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESignature validity.\u003C/li\u003E\n\u003Cli\u003EAccepted signing algorithm and key.\u003C/li\u003E\n\u003Cli\u003EExpected issuer.\u003C/li\u003E\n\u003Cli\u003EIntended audience.\u003C/li\u003E\n\u003Cli\u003EExpiration and other applicable time constraints.\u003C/li\u003E\n\u003Cli\u003ERequired token claims and application-specific restrictions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA successfully decoded JWT is not necessarily a valid JWT.\u003C/p\u003E\n\u003Cp\u003ELikewise, a correctly signed JWT is not automatically acceptable to every resource.\u003C/p\u003E\n\u003Cp\u003EThe resource must verify that the token was issued for its intended security context.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022local-validation\u0022\u003ELocal Validation\u003C/h3\u003E\n\u003Cp\u003EJWTs can be validated without loading current server-side session state.\u003C/p\u003E\n\u003Cp\u003EThis is useful for distributed APIs and services that need to authenticate requests efficiently.\u003C/p\u003E\n\u003Cp\u003EHowever, local validation introduces an important limitation:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EA token can remain cryptographically valid after the underlying account or authorization state has changed.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhether such changes immediately affect access depends on additional validation and revocation mechanisms.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-mode-behavior\u0022\u003EAuthentication Mode Behavior\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth selects credential behavior according to the configured authentication mode.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EAccess mechanism\u003C/th\u003E\n\u003Cth\u003EContinuation mechanism\u003C/th\u003E\n\u003Cth\u003EProtected request authority\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EPureOpaque\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EOpaque session credential\u003C/td\u003E\n\u003Ctd\u003ESession lifecycle\u003C/td\u003E\n\u003Ctd\u003EServer-managed session state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EHybrid\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EOpaque access credential\u003C/td\u003E\n\u003Ctd\u003EOpaque refresh credential\u003C/td\u003E\n\u003Ctd\u003EServer-managed session state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ESemiHybrid\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT access token\u003C/td\u003E\n\u003Ctd\u003EServer-managed refresh flow\u003C/td\u003E\n\u003Ctd\u003ELocally validated JWT\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EPureJwt\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT access token\u003C/td\u003E\n\u003Ctd\u003EOptional refresh mechanism\u003C/td\u003E\n\u003Ctd\u003ELocally validated JWT\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque\u0022\u003EPureOpaque\u003C/h3\u003E\n\u003Cp\u003EPureOpaque uses an opaque session credential.\u003C/p\u003E\n\u003Cp\u003EIt does not require a separate access-token and refresh-token pair.\u003C/p\u003E\n\u003Cp\u003EThe credential is validated through the authoritative session mechanism.\u003C/p\u003E\n\u003Cp\u003ESession lifecycle operations govern the continuation and validity of authentication state.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid\u0022\u003EHybrid\u003C/h3\u003E\n\u003Cp\u003EHybrid uses distinct opaque access and refresh credentials.\u003C/p\u003E\n\u003Cp\u003EAccess requests are validated against authoritative server-managed state.\u003C/p\u003E\n\u003Cp\u003ERefresh operations use the refresh credential to continue authentication according to the configured lifecycle and rotation behavior.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EHybrid does not require JWT access tokens.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022semihybrid\u0022\u003ESemiHybrid\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid issues JWT access tokens while maintaining server-side session state for relevant lifecycle operations.\u003C/p\u003E\n\u003Cp\u003EProtected requests can validate JWT access tokens locally.\u003C/p\u003E\n\u003Cp\u003ERefresh and logout interact with the server-managed authentication lifecycle.\u003C/p\u003E\n\u003Cp\u003EThis means that server-side revocation does not necessarily invalidate an already-issued JWT immediately.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt\u0022\u003EPureJwt\u003C/h3\u003E\n\u003Cp\u003EPureJwt uses JWT access tokens without requiring the Root \u2192 Chain \u2192 Session hierarchy for ordinary protected request validation.\u003C/p\u003E\n\u003Cp\u003EAn optional refresh mechanism may maintain refresh-specific state.\u003C/p\u003E\n\u003Cp\u003EThe existence of a refresh store does not make JWT access validation session-authoritative.\u003C/p\u003E\n\u003Cp\u003EFor more detail, see \u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-validation-requirements\u0022\u003EPureJwt Validation Requirements\u003C/h2\u003E\n\u003Cp\u003EPureJwt Resource APIs validate JWT access tokens locally using trusted verification keys and explicit validation policies.\u003C/p\u003E\n\u003Cp\u003EA valid signature alone is insufficient.\u003C/p\u003E\n\u003Cp\u003EThe current validation pipeline enforces the expected token type, issuer, audience, lifetime, allowed algorithm, key ID, tenant, subject, and device binding requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022trusted-verification-keys\u0022\u003ETrusted verification keys\u003C/h3\u003E\n\u003Cp\u003EVerification keys must come from trusted application configuration or an explicitly registered verification-key provider.\u003C/p\u003E\n\u003Cp\u003EThe Resource API does not accept signing keys supplied by an untrusted JWT header or automatically retrieve keys from token-provided URLs.\u003C/p\u003E\n\u003Cp\u003EThe built-in configured verification-key provider supports Base64-encoded symmetric keys.\u003C/p\u003E\n\u003Cp\u003EFor the built-in HS256 signing implementation, use at least 32 bytes of cryptographically secure random key material.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022device-binding\u0022\u003EDevice binding\u003C/h3\u003E\n\u003Cp\u003EPureJwt access tokens contain a device identifier.\u003C/p\u003E\n\u003Cp\u003EBy default, Resource API validation rejects requests when the required device identifier is missing or does not match the token.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EDeviceMismatchBehavior.Allow\u003C/code\u003E permits a mismatch when explicitly configured, but weakens device-binding enforcement.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowAndRebind\u003C/code\u003E is not supported in PureJwt.\u003C/p\u003E\n\u003Cp\u003EA matching device identifier is an additional binding check, not cryptographic proof that the requesting device has exclusive possession of the token.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022stateless-authorization-freshness\u0022\u003EStateless authorization freshness\u003C/h3\u003E\n\u003Cp\u003EPureJwt Resource APIs do not require a live user-state lookup during normal JWT validation.\u003C/p\u003E\n\u003Cp\u003EAs a result, an otherwise valid JWT can remain accepted after account deletion, suspension, permission changes, or refresh-chain revocation.\u003C/p\u003E\n\u003Cp\u003EApplications requiring immediate enforcement of such changes must implement an additional authoritative validation mechanism or use an appropriate session-backed authentication strategy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022access-token-lifetime\u0022\u003EAccess Token Lifetime\u003C/h2\u003E\n\u003Cp\u003EAccess credentials should have lifetimes appropriate to their authentication mode and security requirements.\u003C/p\u003E\n\u003Cp\u003EShort-lived JWT access tokens are particularly important because a token may remain usable until expiration even after server-side authorization state changes.\u003C/p\u003E\n\u003Cp\u003EFor example, an application might choose a JWT access lifetime of several minutes.\u003C/p\u003E\n\u003Cp\u003EHowever, \u003Cstrong\u003Ea lifetime such as 5\u201315 minutes is an example of an application security choice, not a universal UltimateAuth default or requirement\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThe appropriate value depends on factors such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESensitivity of protected resources.\u003C/li\u003E\n\u003Cli\u003EExpected frequency of authorization changes.\u003C/li\u003E\n\u003Cli\u003EAcceptable revocation delay.\u003C/li\u003E\n\u003Cli\u003EAvailability and security of the refresh mechanism.\u003C/li\u003E\n\u003Cli\u003EClient behavior and network conditions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022lifetime-versus-revocation\u0022\u003ELifetime Versus Revocation\u003C/h3\u003E\n\u003Cp\u003EExpiration limits how long a credential can be accepted.\u003C/p\u003E\n\u003Cp\u003ERevocation invalidates authentication state before its ordinary expiration.\u003C/p\u003E\n\u003Cp\u003EThese mechanisms are related but not interchangeable.\u003C/p\u003E\n\u003Cp\u003EIn server-authoritative modes, current revocation state can be checked during protected requests.\u003C/p\u003E\n\u003Cp\u003EIn locally validated JWT modes, expiration may remain the primary limit on an already-issued access token unless an additional revocation check is implemented.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-credentials\u0022\u003ERefresh Credentials\u003C/h2\u003E\n\u003Cp\u003ERefresh credentials allow clients to continue authentication without repeating the original authentication ceremony.\u003C/p\u003E\n\u003Cp\u003EThey are intended for the authentication system\u0027s refresh operation, not for general API access.\u003C/p\u003E\n\u003Cp\u003EIn UltimateAuth, refresh behavior is mode-dependent.\u003C/p\u003E\n\u003Cp\u003EPureOpaque does not require a separate refresh credential pair, while Hybrid and SemiHybrid use refresh flows. PureJwt can support an optional refresh mechanism.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-security-requirements\u0022\u003ERefresh Security Requirements\u003C/h3\u003E\n\u003Cp\u003EA secure refresh operation must establish that the presented credential is eligible for continued authentication.\u003C/p\u003E\n\u003Cp\u003EDepending on the mode and configured strategy, this may involve checking:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ECredential existence and validity.\u003C/li\u003E\n\u003Cli\u003EExpiration.\u003C/li\u003E\n\u003Cli\u003ERevocation or consumption state.\u003C/li\u003E\n\u003Cli\u003EAssociated user or session context.\u003C/li\u003E\n\u003Cli\u003EApplicable client and device context.\u003C/li\u003E\n\u003Cli\u003ERotation and reuse conditions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA valid refresh credential should not automatically bypass account-level or session-level security requirements that apply to the selected mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022access-and-refresh-separation\u0022\u003EAccess and Refresh Separation\u003C/h3\u003E\n\u003Cp\u003EAccess and refresh credentials have different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EAuthentication\n |\n v\nAccess credential\n |\n | Used for protected requests\n v\nAccess expires\n |\n v\nRefresh operation\n |\n | Validate refresh credential\n | Apply continuation rules\n v\nRenewed access credential\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe refresh operation does not extend the expiration timestamp of an already-issued JWT.\u003C/p\u003E\n\u003Cp\u003EIt issues new authentication material when continuation is permitted.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-rotation\u0022\u003ERefresh Rotation\u003C/h2\u003E\n\u003Cp\u003ERefresh rotation replaces refresh authentication material according to the configured refresh strategy.\u003C/p\u003E\n\u003Cp\u003EA rotating refresh mechanism can invalidate the previously used refresh credential and issue a replacement.\u003C/p\u003E\n\u003Cp\u003EConceptually:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ERefresh credential A\n |\n | Successful refresh\n v\nRefresh credential A consumed\nRefresh credential B issued\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis reduces the period during which an older refresh credential remains reusable.\u003C/p\u003E\n\u003Cp\u003EHowever, \u003Cstrong\u003Erotation behavior is not identical across every UltimateAuth mode or refresh strategy\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003ESome session continuation operations may update existing server-side state without replacing a separate refresh credential.\u003C/p\u003E\n\u003Cp\u003EThe effective behavior must follow the selected mode and its configured refresh strategy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022rotation-is-not-replay-prevention-by-itself\u0022\u003ERotation Is Not Replay Prevention by Itself\u003C/h3\u003E\n\u003Cp\u003ERotation limits credential reuse only when the server enforces the relevant consumption or replacement state.\u003C/p\u003E\n\u003Cp\u003EA secure rotating refresh mechanism must account for situations such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe same credential being submitted again.\u003C/li\u003E\n\u003Cli\u003EConcurrent refresh requests.\u003C/li\u003E\n\u003Cli\u003EA credential being reused after replacement.\u003C/li\u003E\n\u003Cli\u003EAn interrupted response after a successful rotation.\u003C/li\u003E\n\u003Cli\u003EAn attacker and legitimate client attempting to use the same credential.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe exact outcome depends on the implemented refresh strategy and concurrency guarantees.\u003C/p\u003E\n\u003Cp\u003ERotation should not be described as automatically eliminating every replay risk.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-reuse\u0022\u003ERefresh Token Reuse\u003C/h2\u003E\n\u003Cp\u003ERefresh token reuse occurs when a credential is presented after it has already been consumed, replaced, or otherwise invalidated.\u003C/p\u003E\n\u003Cp\u003EFor a single-use rotating refresh credential, this is a security-relevant event.\u003C/p\u003E\n\u003Cp\u003EConceptually:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient refreshes with A\n |\n v\nA replaced by B\n |\n v\nAnother request presents A\n |\n v\nReuse / invalid credential condition\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA reuse attempt may indicate credential theft, but it can also arise from concurrent requests or client synchronization failures.\u003C/p\u003E\n\u003Cp\u003EThe refresh implementation must distinguish these situations according to its supported guarantees and policy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-response\u0022\u003ESecurity Response\u003C/h3\u003E\n\u003Cp\u003EPossible security responses include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ERejecting the invalid refresh attempt.\u003C/li\u003E\n\u003Cli\u003EInvalidating the associated refresh state.\u003C/li\u003E\n\u003Cli\u003ERevoking an affected session.\u003C/li\u003E\n\u003Cli\u003ERevoking a broader session chain where supported and appropriate.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese are distinct actions.\u003C/p\u003E\n\u003Cp\u003EThe presence of a reuse-detection mechanism does not imply that every reuse attempt automatically revokes the entire device-associated chain.\u003C/p\u003E\n\u003Cp\u003ESuch behavior must be explicitly supported by the configured refresh strategy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-credential-storage\u0022\u003ERefresh Credential Storage\u003C/h2\u003E\n\u003Cp\u003ERefresh credentials are generally more sensitive to long-term compromise because they may allow new access credentials to be obtained.\u003C/p\u003E\n\u003Cp\u003ETheir storage therefore deserves stronger protection than ordinary client-visible access metadata.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-side-storage\u0022\u003EServer-Side Storage\u003C/h3\u003E\n\u003Cp\u003EFor persisted opaque refresh credentials, storing a one-way verifier or hash instead of the raw credential can reduce the impact of a storage disclosure.\u003C/p\u003E\n\u003Cp\u003EHowever, the exact persistence model depends on the selected authentication mode and refresh implementation.\u003C/p\u003E\n\u003Cp\u003EIt should not be assumed that every authentication mode uses the same refresh storage structure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-side-storage\u0022\u003EClient-Side Storage\u003C/h3\u003E\n\u003Cp\u003EThe appropriate client storage mechanism depends on the application environment.\u003C/p\u003E\n\u003Cp\u003EFor browser applications, HttpOnly cookies can prevent JavaScript from directly reading refresh credentials, although cookie-based refresh flows still require appropriate CSRF and origin protections.\u003C/p\u003E\n\u003Cp\u003ENative applications may use platform-provided secure storage where suitable.\u003C/p\u003E\n\u003Cp\u003ERefresh credentials should not be exposed through application logs, diagnostic output, URLs, or unrelated API responses.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022transport-security\u0022\u003ETransport Security\u003C/h3\u003E\n\u003Cp\u003EAuthentication credentials must be protected in transit.\u003C/p\u003E\n\u003Cp\u003EProduction authentication and refresh endpoints should use HTTPS.\u003C/p\u003E\n\u003Cp\u003EApplications should also avoid sending refresh credentials to services that do not need to receive them.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022claims-and-authorization-freshness\u0022\u003EClaims and Authorization Freshness\u003C/h2\u003E\n\u003Cp\u003EJWT claims represent information established when the token was issued.\u003C/p\u003E\n\u003Cp\u003EThey may include standard or application-specific information such as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Esub Subject identifier\niss Issuer\naud Audience\nexp Expiration\niat Issued-at time\njti Token identifier\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDepending on the application, a JWT may also include tenant information, roles, permissions, or session references.\u003C/p\u003E\n\u003Cp\u003EThese claims are not automatically updated when the underlying account changes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-permission-removal\u0022\u003EExample: Permission Removal\u003C/h3\u003E\n\u003Cp\u003EConsider the following sequence:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EA JWT is issued containing an administrative permission.\u003C/li\u003E\n\u003Cli\u003EAn administrator removes that permission from the user.\u003C/li\u003E\n\u003Cli\u003EThe client continues presenting the previously issued JWT.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EIf the protected resource relies only on the signed claims in that JWT, the removed permission may remain effective until the token expires.\u003C/p\u003E\n\u003Cp\u003EThe signature remains valid because the token has not been modified.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-strategies\u0022\u003EAuthorization Strategies\u003C/h3\u003E\n\u003Cp\u003EApplications can address this limitation through their security architecture, including:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EShorter JWT lifetimes.\u003C/li\u003E\n\u003Cli\u003EReissuing claims during refresh.\u003C/li\u003E\n\u003Cli\u003EConsulting authoritative authorization state for sensitive operations.\u003C/li\u003E\n\u003Cli\u003EUsing server-authoritative authentication modes where immediate state enforcement is required.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe appropriate approach depends on the security requirements of the application.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/plugin-domains/authorization\u0022\u003EAuthorization\u003C/a\u003E and \u003Ca href=\u0022/docs/plugin-domains/policies\u0022\u003EPolicies \u0026amp; Access Control\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-revocation\u0022\u003EToken Revocation\u003C/h2\u003E\n\u003Cp\u003ERevocation behavior differs fundamentally between opaque credentials and locally validated JWTs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022opaque-credential-revocation\u0022\u003EOpaque Credential Revocation\u003C/h3\u003E\n\u003Cp\u003EAn opaque credential depends on authoritative validation.\u003C/p\u003E\n\u003Cp\u003EIf the corresponding server-managed authentication state is revoked, subsequent validation can reject the credential.\u003C/p\u003E\n\u003Cp\u003EThe precise scope depends on whether the security operation targets a session, chain, or account-level root.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022jwt-revocation\u0022\u003EJWT Revocation\u003C/h3\u003E\n\u003Cp\u003EA signed JWT cannot be made cryptographically invalid merely by deleting a server-side session record.\u003C/p\u003E\n\u003Cp\u003EIts signature and expiration remain unchanged.\u003C/p\u003E\n\u003Cp\u003ETo reject an otherwise valid JWT before expiration, the resource must enforce an additional condition, such as an authoritative revocation check or another supported invalidation mechanism.\u003C/p\u003E\n\u003Cp\u003EWithout that additional enforcement, a locally validated JWT may remain acceptable until expiration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-revocation\u0022\u003ERefresh Revocation\u003C/h3\u003E\n\u003Cp\u003ERevoking a refresh credential can prevent further successful refresh operations.\u003C/p\u003E\n\u003Cp\u003EHowever, that does not necessarily invalidate access tokens already issued before the revocation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAccess revocation and refresh revocation are separate security concerns.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-security-and-token-security\u0022\u003ESession Security and Token Security\u003C/h2\u003E\n\u003Cp\u003EToken security and session security are closely related, but they operate at different levels.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EConcern\u003C/th\u003E\n\u003Cth\u003EToken Security\u003C/th\u003E\n\u003Cth\u003ESession Security\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECredential format\u003C/td\u003E\n\u003Ctd\u003EOpaque or JWT\u003C/td\u003E\n\u003Ctd\u003ERoot, chain, and session state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECryptographic validation\u003C/td\u003E\n\u003Ctd\u003EJWT signature and claims\u003C/td\u003E\n\u003Ctd\u003ENot a substitute for token signature validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EExpiration\u003C/td\u003E\n\u003Ctd\u003EToken validity period\u003C/td\u003E\n\u003Ctd\u003ESession and chain lifecycle limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERotation\u003C/td\u003E\n\u003Ctd\u003EReplacement of authentication material\u003C/td\u003E\n\u003Ctd\u003EContinuity and associated state transitions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERevocation\u003C/td\u003E\n\u003Ctd\u003EWhether a presented credential remains acceptable\u003C/td\u003E\n\u003Ctd\u003EWhich authentication state has been invalidated\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDevice context\u003C/td\u003E\n\u003Ctd\u003EMay be associated with token use\u003C/td\u003E\n\u003Ctd\u003EManaged through applicable chain and session context\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EA token may be valid according to its own format but unacceptable under authoritative session security rules.\u003C/p\u003E\n\u003Cp\u003EConversely, server-side session state may remain active while a particular access token has expired.\u003C/p\u003E\n\u003Cp\u003EBoth levels must be understood to reason correctly about the selected authentication mode.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-security-misconceptions\u0022\u003ECommon Security Misconceptions\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-valid-signature-means-current-authorization\u0022\u003EA Valid Signature Means Current Authorization\u003C/h3\u003E\n\u003Cp\u003EA valid JWT signature proves that the token has not been modified and was signed by an accepted key.\u003C/p\u003E\n\u003Cp\u003EIt does not prove that the user\u0027s permissions or account status have remained unchanged since issuance.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-device-identifier-prevents-token-theft\u0022\u003EA Device Identifier Prevents Token Theft\u003C/h3\u003E\n\u003Cp\u003EA device identifier may support context consistency checks.\u003C/p\u003E\n\u003Cp\u003EIt does not independently prevent a stolen bearer credential from being replayed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-rotation-makes-token-theft-impossible\u0022\u003ERefresh Rotation Makes Token Theft Impossible\u003C/h3\u003E\n\u003Cp\u003ERotation can reduce reuse opportunities and support detection of invalid reuse.\u003C/p\u003E\n\u003Cp\u003EIt does not prevent a stolen credential from being used before the legitimate client or server detects the compromise.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-invalidates-every-jwt-immediately\u0022\u003ELogout Invalidates Every JWT Immediately\u003C/h3\u003E\n\u003Cp\u003ELogout may revoke server-managed session or refresh state.\u003C/p\u003E\n\u003Cp\u003EPreviously issued JWT access tokens can remain valid until expiration unless protected resources enforce an additional invalidation mechanism.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022short-lived-tokens-eliminate-the-need-for-session-security\u0022\u003EShort-Lived Tokens Eliminate the Need for Session Security\u003C/h3\u003E\n\u003Cp\u003EShort lifetimes reduce the exposure window of a compromised token.\u003C/p\u003E\n\u003Cp\u003EThey do not replace account-level security policies, credential recovery protections, or session revocation controls where those capabilities are required.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-design-principles\u0022\u003ESecurity Design Principles\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s token model is best understood through a few principles.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUse credentials only for their intended purpose.\u003C/strong\u003E Access and refresh credentials must not be interchangeable.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EValidate according to the selected mode.\u003C/strong\u003E Opaque credentials require authoritative validation; JWTs require correct cryptographic and claims validation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ETreat JWT claims as issuance-time information.\u003C/strong\u003E Current authorization state may differ from what an older token contains.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EKeep access credentials appropriately short-lived.\u003C/strong\u003E Token lifetime should reflect the application\u0027s acceptable exposure window.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EEnforce refresh continuation rules.\u003C/strong\u003E Rotation, expiration, consumption, and reuse behavior must be consistent with the configured strategy.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDistinguish token expiration from session revocation.\u003C/strong\u003E They invalidate authentication through different mechanisms.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDo not promise immediate JWT revocation without enforcement.\u003C/strong\u003E Server-side state changes affect locally validated tokens only when the resource checks the relevant state.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022architectural-perspective\u0022\u003EArchitectural Perspective\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth does not impose a single token model on every application.\u003C/p\u003E\n\u003Cp\u003EPureOpaque and Hybrid emphasize server-authoritative authentication state.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid and PureJwt support locally validated JWT access, with different approaches to authentication continuation.\u003C/p\u003E\n\u003Cp\u003EThese choices affect performance, storage requirements, revocation behavior, and authorization freshness.\u003C/p\u003E\n\u003Cp\u003EThe purpose of the token security model is to make those tradeoffs explicit.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EA token establishes access only while its applicable validation requirements remain satisfied. The strength and freshness of those requirements depend on the authentication mode.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/security/session-security\u0022\u003ESession Security\u003C/a\u003E \u2014 Understand authoritative session validation and hierarchical revocation.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E \u2014 Compare credential behavior across modes.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/sessions-devices/session-lifecycle\u0022\u003ESession Model \u0026amp; Lifecycle\u003C/a\u003E \u2014 Explore session creation, continuation, and invalidation.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/plugin-domains/credentials\u0022\u003ECredentials\u003C/a\u003E \u2014 Understand credential management and recovery security.\u003C/li\u003E\n\u003C/ul\u003E\n", + "Html": "\n\u003Cp\u003EAuthentication tokens allow clients to present authentication state to protected applications and services.\u003C/p\u003E\n\u003Cp\u003EHowever, not all tokens provide the same security guarantees.\u003C/p\u003E\n\u003Cp\u003EAn opaque credential requires authoritative server-side validation. A JSON Web Token (JWT) can be verified locally using its signature and claims. A refresh credential enables authentication to continue without repeating the original login process.\u003C/p\u003E\n\u003Cp\u003EUltimateAuth supports these different mechanisms through its authentication modes.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EToken security depends on the credential\u0027s purpose, how it is validated, how long it remains valid, and which security state is consulted during validation.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThis page explains the security characteristics of access and refresh credentials, including issuance, expiration, rotation, replay risks, and revocation boundaries.\u003C/p\u003E\n\u003Cp\u003EFor the overall authentication architecture, see \u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-state-and-credentials\u0022\u003EAuthentication State and Credentials\u003C/h2\u003E\n\u003Cp\u003EA token is authentication material presented by a client.\u003C/p\u003E\n\u003Cp\u003EIt is not the user identity itself.\u003C/p\u003E\n\u003Cp\u003EDepending on the authentication mode, the token may reference server-managed authentication state or contain signed claims that can be validated without retrieving a session.\u003C/p\u003E\n\u003Cp\u003EThese approaches establish different trust boundaries.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-authoritative-authentication\u0022\u003EServer-Authoritative Authentication\u003C/h3\u003E\n\u003Cp\u003EIn server-authoritative modes, a presented opaque credential is validated against server-managed authentication state.\u003C/p\u003E\n\u003Cp\u003EThe server can evaluate the current validity of the corresponding session and applicable security conditions.\u003C/p\u003E\n\u003Cp\u003EThis allows revocation and other authoritative state changes to affect subsequent protected requests.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022locally-validated-authentication\u0022\u003ELocally Validated Authentication\u003C/h3\u003E\n\u003Cp\u003EIn JWT-based modes, a protected resource can validate a token using its signature, issuer, audience, expiration, and other applicable token requirements.\u003C/p\u003E\n\u003Cp\u003EThe resource may not need to consult the issuing server or a session store for every request.\u003C/p\u003E\n\u003Cp\u003EThis reduces the dependency on server-side session lookups but changes how quickly revocation and authorization changes can be enforced.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ENeither model makes the token an identity record. The token is a credential whose validity is determined by the selected authentication mechanism.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-types\u0022\u003EToken Types\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth uses two principal access credential formats: opaque credentials and JWTs.\u003C/p\u003E\n\u003Cp\u003ERefresh credentials serve a separate purpose.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003ECredential\u003C/th\u003E\n\u003Cth\u003EPurpose\u003C/th\u003E\n\u003Cth\u003EValidation model\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EOpaque access credential\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthenticate protected requests\u003C/td\u003E\n\u003Ctd\u003EAuthoritative server-side validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EJWT access token\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EAuthenticate protected requests\u003C/td\u003E\n\u003Ctd\u003ECryptographic and claims validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EOpaque refresh credential\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EContinue authentication and obtain renewed credentials\u003C/td\u003E\n\u003Ctd\u003ERefresh-specific validation and state checks\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EThe distinction between access and refresh credentials is important.\u003C/p\u003E\n\u003Cp\u003EAccess credentials are presented to protected resources.\u003C/p\u003E\n\u003Cp\u003ERefresh credentials are presented to the authentication system for a continuation operation. They should not be accepted as ordinary access credentials.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022opaque-access-credentials\u0022\u003EOpaque Access Credentials\u003C/h2\u003E\n\u003Cp\u003EAn opaque credential is a value whose contents do not expose the authenticated identity or authorization claims to the client.\u003C/p\u003E\n\u003Cp\u003EConceptually:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EAccess credential:\nq8Vn2...random-opaque-value...M7x\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe client presents the credential, but cannot determine its authorization meaning by decoding it.\u003C/p\u003E\n\u003Cp\u003EThe server resolves and validates the associated authentication state.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-properties\u0022\u003ESecurity Properties\u003C/h3\u003E\n\u003Cp\u003EOpaque access credentials provide several useful characteristics:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ETheir meaning is determined by authoritative server-side state.\u003C/li\u003E\n\u003Cli\u003EThey do not need to expose identity claims in a client-readable payload.\u003C/li\u003E\n\u003Cli\u003ETheir validity can be affected by session expiration or revocation.\u003C/li\u003E\n\u003Cli\u003EThey can participate in account-level and chain-level security enforcement.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EHowever, opaque credentials are still bearer credentials unless an additional proof mechanism is enforced.\u003C/p\u003E\n\u003Cp\u003EAn attacker who obtains a usable opaque credential may be able to present it.\u003C/p\u003E\n\u003Cp\u003EOpacity alone does not prevent credential theft or replay.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-side-validation\u0022\u003EServer-Side Validation\u003C/h3\u003E\n\u003Cp\u003EIn a session-authoritative mode, validation can enforce the applicable session hierarchy requirements, including expiration, revocation, ownership, and security state consistency.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/security/session-security\u0022\u003ESession Security Model\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022jwt-access-tokens\u0022\u003EJWT Access Tokens\u003C/h2\u003E\n\u003Cp\u003EA JWT is a structured token containing signed claims.\u003C/p\u003E\n\u003Cp\u003EA typical JWT contains three encoded sections:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Eheader.payload.signature\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EIts payload may describe the authenticated subject, tenant, authorization information, token lifetime, and other relevant context.\u003C/p\u003E\n\u003Cp\u003EA JWT is not encrypted merely because it is encoded and signed.\u003C/p\u003E\n\u003Cp\u003EApplications should not place secrets or unnecessarily sensitive information in a JWT payload.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022cryptographic-validation\u0022\u003ECryptographic Validation\u003C/h3\u003E\n\u003Cp\u003EA protected resource must validate the JWT according to the configured token requirements.\u003C/p\u003E\n\u003Cp\u003ERelevant checks include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESignature validity.\u003C/li\u003E\n\u003Cli\u003EAccepted signing algorithm and key.\u003C/li\u003E\n\u003Cli\u003EExpected issuer.\u003C/li\u003E\n\u003Cli\u003EIntended audience.\u003C/li\u003E\n\u003Cli\u003EExpiration and other applicable time constraints.\u003C/li\u003E\n\u003Cli\u003ERequired token claims and application-specific restrictions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA successfully decoded JWT is not necessarily a valid JWT.\u003C/p\u003E\n\u003Cp\u003ELikewise, a correctly signed JWT is not automatically acceptable to every resource.\u003C/p\u003E\n\u003Cp\u003EThe resource must verify that the token was issued for its intended security context.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022local-validation\u0022\u003ELocal Validation\u003C/h3\u003E\n\u003Cp\u003EJWTs can be validated without loading current server-side session state.\u003C/p\u003E\n\u003Cp\u003EThis is useful for distributed APIs and services that need to authenticate requests efficiently.\u003C/p\u003E\n\u003Cp\u003EHowever, local validation introduces an important limitation:\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EA token can remain cryptographically valid after the underlying account or authorization state has changed.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EWhether such changes immediately affect access depends on additional validation and revocation mechanisms.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022authentication-mode-behavior\u0022\u003EAuthentication Mode Behavior\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth selects credential behavior according to the configured authentication mode.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EMode\u003C/th\u003E\n\u003Cth\u003EAccess mechanism\u003C/th\u003E\n\u003Cth\u003EContinuation mechanism\u003C/th\u003E\n\u003Cth\u003EProtected request authority\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EPureOpaque\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EOpaque session credential\u003C/td\u003E\n\u003Ctd\u003ESession lifecycle\u003C/td\u003E\n\u003Ctd\u003EServer-managed session state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EHybrid\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EOpaque session credential and JWT access token\u003C/td\u003E\n\u003Ctd\u003EOpaque refresh credential\u003C/td\u003E\n\u003Ctd\u003EServer-managed session state for the current session-backed path\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003ESemiHybrid\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT access token\u003C/td\u003E\n\u003Ctd\u003EServer-managed refresh flow\u003C/td\u003E\n\u003Ctd\u003ELocally validated JWT\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003E\u003Cstrong\u003EPureJwt\u003C/strong\u003E\u003C/td\u003E\n\u003Ctd\u003EJWT access token\u003C/td\u003E\n\u003Ctd\u003EStateful refresh-token rotation\u003C/td\u003E\n\u003Ctd\u003ELocally validated JWT\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022pureopaque\u0022\u003EPureOpaque\u003C/h3\u003E\n\u003Cp\u003EPureOpaque uses an opaque session credential.\u003C/p\u003E\n\u003Cp\u003EIt does not require a separate access-token and refresh-token pair.\u003C/p\u003E\n\u003Cp\u003EThe credential is validated through the authoritative session mechanism.\u003C/p\u003E\n\u003Cp\u003ESession lifecycle operations govern the continuation and validity of authentication state.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022hybrid\u0022\u003EHybrid\u003C/h3\u003E\n\u003Cp\u003EHybrid establishes server-side sessions and issues JWT access tokens together with opaque refresh credentials.\u003C/p\u003E\n\u003Cp\u003EThe current session-backed authentication path relies on authoritative server-managed session state.\u003C/p\u003E\n\u003Cp\u003ERefresh operations validate the relevant session and refresh credential before issuing replacement credentials.\u003C/p\u003E\n\u003Cp\u003EHybrid-aware JWT validation in separate Resource APIs is not yet implemented.\u003C/p\u003E\n\u003Cp\u003EJWT payloads are readable by their holders. The use of signed JWTs does not provide payload confidentiality.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022semihybrid\u0022\u003ESemiHybrid\u003C/h3\u003E\n\u003Cp\u003ESemiHybrid issues JWT access tokens while maintaining server-side session state for relevant lifecycle operations.\u003C/p\u003E\n\u003Cp\u003EProtected requests can validate JWT access tokens locally.\u003C/p\u003E\n\u003Cp\u003ERefresh and logout interact with the server-managed authentication lifecycle.\u003C/p\u003E\n\u003Cp\u003EThis means that server-side revocation does not necessarily invalidate an already-issued JWT immediately.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt\u0022\u003EPureJwt\u003C/h3\u003E\n\u003Cp\u003EPureJwt uses JWT access tokens without requiring the Root \u2192 Chain \u2192 Session hierarchy for ordinary protected request validation.\u003C/p\u003E\n\u003Cp\u003EAn optional refresh mechanism may maintain refresh-specific state.\u003C/p\u003E\n\u003Cp\u003EThe existence of a refresh store does not make JWT access validation session-authoritative.\u003C/p\u003E\n\u003Cp\u003EFor more detail, see \u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022purejwt-validation-requirements\u0022\u003EPureJwt Validation Requirements\u003C/h2\u003E\n\u003Cp\u003EPureJwt Resource APIs validate JWT access tokens locally using trusted verification keys and explicit validation policies.\u003C/p\u003E\n\u003Cp\u003EA valid signature alone is insufficient.\u003C/p\u003E\n\u003Cp\u003EThe current validation pipeline enforces the expected token type, issuer, audience, lifetime, allowed algorithm, key ID, tenant, subject, and device binding requirements.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022trusted-verification-keys\u0022\u003ETrusted verification keys\u003C/h3\u003E\n\u003Cp\u003EVerification keys must come from trusted application configuration or an explicitly registered verification-key provider.\u003C/p\u003E\n\u003Cp\u003EThe Resource API does not accept signing keys supplied by an untrusted JWT header or automatically retrieve keys from token-provided URLs.\u003C/p\u003E\n\u003Cp\u003EThe built-in configured verification-key provider supports Base64-encoded symmetric keys.\u003C/p\u003E\n\u003Cp\u003EFor the built-in HS256 signing implementation, use at least 32 bytes of cryptographically secure random key material.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022device-binding\u0022\u003EDevice binding\u003C/h3\u003E\n\u003Cp\u003EPureJwt access tokens contain a device identifier.\u003C/p\u003E\n\u003Cp\u003EBy default, Resource API validation rejects requests when the required device identifier is missing or does not match the token.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EDeviceMismatchBehavior.Allow\u003C/code\u003E permits a mismatch when explicitly configured, but weakens device-binding enforcement.\u003C/p\u003E\n\u003Cp\u003E\u003Ccode\u003EAllowAndRebind\u003C/code\u003E is not supported in PureJwt.\u003C/p\u003E\n\u003Cp\u003EA matching device identifier is an additional binding check, not cryptographic proof that the requesting device has exclusive possession of the token.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022stateless-authorization-freshness\u0022\u003EStateless authorization freshness\u003C/h3\u003E\n\u003Cp\u003EPureJwt Resource APIs do not require a live user-state lookup during normal JWT validation.\u003C/p\u003E\n\u003Cp\u003EAs a result, an otherwise valid JWT can remain accepted after account deletion, suspension, permission changes, or refresh-chain revocation.\u003C/p\u003E\n\u003Cp\u003EApplications requiring immediate enforcement of such changes must implement an additional authoritative validation mechanism or use an appropriate session-backed authentication strategy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022access-token-lifetime\u0022\u003EAccess Token Lifetime\u003C/h2\u003E\n\u003Cp\u003EAccess credentials should have lifetimes appropriate to their authentication mode and security requirements.\u003C/p\u003E\n\u003Cp\u003EShort-lived JWT access tokens are particularly important because a token may remain usable until expiration even after server-side authorization state changes.\u003C/p\u003E\n\u003Cp\u003EFor example, an application might choose a JWT access lifetime of several minutes.\u003C/p\u003E\n\u003Cp\u003EHowever, \u003Cstrong\u003Ea lifetime such as 5\u201315 minutes is an example of an application security choice, not a universal UltimateAuth default or requirement\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003EThe appropriate value depends on factors such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ESensitivity of protected resources.\u003C/li\u003E\n\u003Cli\u003EExpected frequency of authorization changes.\u003C/li\u003E\n\u003Cli\u003EAcceptable revocation delay.\u003C/li\u003E\n\u003Cli\u003EAvailability and security of the refresh mechanism.\u003C/li\u003E\n\u003Cli\u003EClient behavior and network conditions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022lifetime-versus-revocation\u0022\u003ELifetime Versus Revocation\u003C/h3\u003E\n\u003Cp\u003EExpiration limits how long a credential can be accepted.\u003C/p\u003E\n\u003Cp\u003ERevocation invalidates authentication state before its ordinary expiration.\u003C/p\u003E\n\u003Cp\u003EThese mechanisms are related but not interchangeable.\u003C/p\u003E\n\u003Cp\u003EIn server-authoritative modes, current revocation state can be checked during protected requests.\u003C/p\u003E\n\u003Cp\u003EIn locally validated JWT modes, expiration may remain the primary limit on an already-issued access token unless an additional revocation check is implemented.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-credentials\u0022\u003ERefresh Credentials\u003C/h2\u003E\n\u003Cp\u003ERefresh credentials allow clients to continue authentication without repeating the original authentication ceremony.\u003C/p\u003E\n\u003Cp\u003EThey are intended for the authentication system\u0027s refresh operation, not for general API access.\u003C/p\u003E\n\u003Cp\u003EIn UltimateAuth, refresh behavior is mode-dependent.\u003C/p\u003E\n\u003Cp\u003EPureOpaque does not issue a separate access-token and refresh-token pair.\u003C/p\u003E\n\u003Cp\u003EHybrid uses refresh-token rotation together with session validation.\u003C/p\u003E\n\u003Cp\u003EPureJwt uses stateful refresh-token rotation without requiring an authentication session.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid is intended to combine JWT authentication with server-managed session lifecycle operations.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-security-requirements\u0022\u003ERefresh Security Requirements\u003C/h3\u003E\n\u003Cp\u003EA secure refresh operation must establish that the presented credential is eligible for continued authentication.\u003C/p\u003E\n\u003Cp\u003EDepending on the mode and configured strategy, this may involve checking:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ECredential existence and validity.\u003C/li\u003E\n\u003Cli\u003EExpiration.\u003C/li\u003E\n\u003Cli\u003ERevocation or consumption state.\u003C/li\u003E\n\u003Cli\u003EAssociated user or session context.\u003C/li\u003E\n\u003Cli\u003EApplicable client and device context.\u003C/li\u003E\n\u003Cli\u003ERotation and reuse conditions.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EA valid refresh credential should not automatically bypass account-level or session-level security requirements that apply to the selected mode.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022access-and-refresh-separation\u0022\u003EAccess and Refresh Separation\u003C/h3\u003E\n\u003Cp\u003EAccess and refresh credentials have different responsibilities.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EAuthentication\n |\n v\nAccess credential\n |\n | Used for protected requests\n v\nAccess expires\n |\n v\nRefresh operation\n |\n | Validate refresh credential\n | Apply continuation rules\n v\nRenewed access credential\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThe refresh operation does not extend the expiration timestamp of an already-issued JWT.\u003C/p\u003E\n\u003Cp\u003EIt issues new authentication material when continuation is permitted.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-rotation\u0022\u003ERefresh Rotation\u003C/h2\u003E\n\u003Cp\u003ERefresh rotation replaces refresh authentication material according to the configured refresh strategy.\u003C/p\u003E\n\u003Cp\u003EA rotating refresh mechanism can invalidate the previously used refresh credential and issue a replacement.\u003C/p\u003E\n\u003Cp\u003EConceptually:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003ERefresh credential A\n |\n | Successful refresh\n v\nRefresh credential A consumed\nRefresh credential B issued\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EThis reduces the period during which an older refresh credential remains reusable.\u003C/p\u003E\n\u003Cp\u003EHowever, \u003Cstrong\u003Erotation behavior is not identical across every UltimateAuth mode or refresh strategy\u003C/strong\u003E.\u003C/p\u003E\n\u003Cp\u003ESome session continuation operations may update existing server-side state without replacing a separate refresh credential.\u003C/p\u003E\n\u003Cp\u003EThe effective behavior must follow the selected mode and its configured refresh strategy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022rotation-is-not-replay-prevention-by-itself\u0022\u003ERotation Is Not Replay Prevention by Itself\u003C/h3\u003E\n\u003Cp\u003ERotation limits credential reuse only when the server enforces the relevant consumption or replacement state.\u003C/p\u003E\n\u003Cp\u003EA secure rotating refresh mechanism must account for situations such as:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EThe same credential being submitted again.\u003C/li\u003E\n\u003Cli\u003EConcurrent refresh requests.\u003C/li\u003E\n\u003Cli\u003EA credential being reused after replacement.\u003C/li\u003E\n\u003Cli\u003EAn interrupted response after a successful rotation.\u003C/li\u003E\n\u003Cli\u003EAn attacker and legitimate client attempting to use the same credential.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe exact outcome depends on the implemented refresh strategy and concurrency guarantees.\u003C/p\u003E\n\u003Cp\u003ERotation should not be described as automatically eliminating every replay risk.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-token-reuse\u0022\u003ERefresh Token Reuse\u003C/h2\u003E\n\u003Cp\u003ERefresh token reuse occurs when a credential is presented after it has already been consumed, replaced, or otherwise invalidated.\u003C/p\u003E\n\u003Cp\u003EFor a single-use rotating refresh credential, this is a security-relevant event.\u003C/p\u003E\n\u003Cp\u003EConceptually:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003EClient refreshes with A\n |\n v\nA replaced by B\n |\n v\nAnother request presents A\n |\n v\nReuse / invalid credential condition\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EA reuse attempt may indicate credential theft, but it can also arise from concurrent requests or client synchronization failures.\u003C/p\u003E\n\u003Cp\u003EThe refresh implementation must distinguish these situations according to its supported guarantees and policy.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-response\u0022\u003ESecurity Response\u003C/h3\u003E\n\u003Cp\u003EPossible security responses include:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003ERejecting the invalid refresh attempt.\u003C/li\u003E\n\u003Cli\u003EInvalidating the associated refresh state.\u003C/li\u003E\n\u003Cli\u003ERevoking an affected session.\u003C/li\u003E\n\u003Cli\u003ERevoking a broader session chain where supported and appropriate.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThese are distinct actions.\u003C/p\u003E\n\u003Cp\u003EThe presence of a reuse-detection mechanism does not imply that every reuse attempt automatically revokes the entire device-associated chain.\u003C/p\u003E\n\u003Cp\u003ESuch behavior must be explicitly supported by the configured refresh strategy.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-credential-storage\u0022\u003ERefresh Credential Storage\u003C/h2\u003E\n\u003Cp\u003ERefresh credentials are generally more sensitive to long-term compromise because they may allow new access credentials to be obtained.\u003C/p\u003E\n\u003Cp\u003ETheir storage therefore deserves stronger protection than ordinary client-visible access metadata.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022server-side-storage\u0022\u003EServer-Side Storage\u003C/h3\u003E\n\u003Cp\u003EFor persisted opaque refresh credentials, storing a one-way verifier or hash instead of the raw credential can reduce the impact of a storage disclosure.\u003C/p\u003E\n\u003Cp\u003EHowever, the exact persistence model depends on the selected authentication mode and refresh implementation.\u003C/p\u003E\n\u003Cp\u003EIt should not be assumed that every authentication mode uses the same refresh storage structure.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022client-side-storage\u0022\u003EClient-Side Storage\u003C/h3\u003E\n\u003Cp\u003EThe appropriate client storage mechanism depends on the application environment.\u003C/p\u003E\n\u003Cp\u003EFor browser applications, HttpOnly cookies can prevent JavaScript from directly reading refresh credentials, although cookie-based refresh flows still require appropriate CSRF and origin protections.\u003C/p\u003E\n\u003Cp\u003ENative applications may use platform-provided secure storage where suitable.\u003C/p\u003E\n\u003Cp\u003ERefresh credentials should not be exposed through application logs, diagnostic output, URLs, or unrelated API responses.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022transport-security\u0022\u003ETransport Security\u003C/h3\u003E\n\u003Cp\u003EAuthentication credentials must be protected in transit.\u003C/p\u003E\n\u003Cp\u003EProduction authentication and refresh endpoints should use HTTPS.\u003C/p\u003E\n\u003Cp\u003EApplications should also avoid sending refresh credentials to services that do not need to receive them.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022claims-and-authorization-freshness\u0022\u003EClaims and Authorization Freshness\u003C/h2\u003E\n\u003Cp\u003EJWT claims represent information established when the token was issued.\u003C/p\u003E\n\u003Cp\u003EThey may include standard or application-specific information such as:\u003C/p\u003E\n\u003Cdiv class=\u0022docs-code-wrapper\u0022\u003E\u003Cdiv class=\u0022docs-code-header\u0022\u003E\u003Cspan class=\u0022docs-code-language\u0022\u003EText\u003C/span\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022docs-code-copy\u0022 aria-label=\u0022Copy code\u0022\u003ECopy\u003C/button\u003E\u003C/div\u003E\u003Cpre\u003E\u003Ccode class=\u0022language-text\u0022\u003Esub Subject identifier\niss Issuer\naud Audience\nexp Expiration\niat Issued-at time\njti Token identifier\n\u003C/code\u003E\u003C/pre\u003E\u003C/div\u003E\n\u003Cp\u003EDepending on the application, a JWT may also include tenant information, roles, permissions, or session references.\u003C/p\u003E\n\u003Cp\u003EThese claims are not automatically updated when the underlying account changes.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022example-permission-removal\u0022\u003EExample: Permission Removal\u003C/h3\u003E\n\u003Cp\u003EConsider the following sequence:\u003C/p\u003E\n\u003Col\u003E\n\u003Cli\u003EA JWT is issued containing an administrative permission.\u003C/li\u003E\n\u003Cli\u003EAn administrator removes that permission from the user.\u003C/li\u003E\n\u003Cli\u003EThe client continues presenting the previously issued JWT.\u003C/li\u003E\n\u003C/ol\u003E\n\u003Cp\u003EIf the protected resource relies only on the signed claims in that JWT, the removed permission may remain effective until the token expires.\u003C/p\u003E\n\u003Cp\u003EThe signature remains valid because the token has not been modified.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022authorization-strategies\u0022\u003EAuthorization Strategies\u003C/h3\u003E\n\u003Cp\u003EApplications can address this limitation through their security architecture, including:\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003EShorter JWT lifetimes.\u003C/li\u003E\n\u003Cli\u003EReissuing claims during refresh.\u003C/li\u003E\n\u003Cli\u003EConsulting authoritative authorization state for sensitive operations.\u003C/li\u003E\n\u003Cli\u003EUsing server-authoritative authentication modes where immediate state enforcement is required.\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cp\u003EThe appropriate approach depends on the security requirements of the application.\u003C/p\u003E\n\u003Cp\u003ESee \u003Ca href=\u0022/docs/plugin-domains/authorization\u0022\u003EAuthorization\u003C/a\u003E and \u003Ca href=\u0022/docs/plugin-domains/policies\u0022\u003EPolicies \u0026amp; Access Control\u003C/a\u003E.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022token-revocation\u0022\u003EToken Revocation\u003C/h2\u003E\n\u003Cp\u003ERevocation behavior differs fundamentally between opaque credentials and locally validated JWTs.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022opaque-credential-revocation\u0022\u003EOpaque Credential Revocation\u003C/h3\u003E\n\u003Cp\u003EAn opaque credential depends on authoritative validation.\u003C/p\u003E\n\u003Cp\u003EIf the corresponding server-managed authentication state is revoked, subsequent validation can reject the credential.\u003C/p\u003E\n\u003Cp\u003EThe precise scope depends on whether the security operation targets a session, chain, or account-level root.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022jwt-revocation\u0022\u003EJWT Revocation\u003C/h3\u003E\n\u003Cp\u003EA signed JWT cannot be made cryptographically invalid merely by deleting a server-side session record.\u003C/p\u003E\n\u003Cp\u003EIts signature and expiration remain unchanged.\u003C/p\u003E\n\u003Cp\u003ETo reject an otherwise valid JWT before expiration, the resource must enforce an additional condition, such as an authoritative revocation check or another supported invalidation mechanism.\u003C/p\u003E\n\u003Cp\u003EWithout that additional enforcement, a locally validated JWT may remain acceptable until expiration.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-revocation\u0022\u003ERefresh Revocation\u003C/h3\u003E\n\u003Cp\u003ERevoking a refresh credential can prevent further successful refresh operations.\u003C/p\u003E\n\u003Cp\u003EHowever, that does not necessarily invalidate access tokens already issued before the revocation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EAccess revocation and refresh revocation are separate security concerns.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022session-security-and-token-security\u0022\u003ESession Security and Token Security\u003C/h2\u003E\n\u003Cp\u003EToken security and session security are closely related, but they operate at different levels.\u003C/p\u003E\n\u003Cdiv class=\u0022docs-table-wrapper\u0022\u003E\u003Ctable\u003E\n\u003Cthead\u003E\n\u003Ctr\u003E\n\u003Cth\u003EConcern\u003C/th\u003E\n\u003Cth\u003EToken Security\u003C/th\u003E\n\u003Cth\u003ESession Security\u003C/th\u003E\n\u003C/tr\u003E\n\u003C/thead\u003E\n\u003Ctbody\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECredential format\u003C/td\u003E\n\u003Ctd\u003EOpaque or JWT\u003C/td\u003E\n\u003Ctd\u003ERoot, chain, and session state\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ECryptographic validation\u003C/td\u003E\n\u003Ctd\u003EJWT signature and claims\u003C/td\u003E\n\u003Ctd\u003ENot a substitute for token signature validation\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EExpiration\u003C/td\u003E\n\u003Ctd\u003EToken validity period\u003C/td\u003E\n\u003Ctd\u003ESession and chain lifecycle limits\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERotation\u003C/td\u003E\n\u003Ctd\u003EReplacement of authentication material\u003C/td\u003E\n\u003Ctd\u003EContinuity and associated state transitions\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003ERevocation\u003C/td\u003E\n\u003Ctd\u003EWhether a presented credential remains acceptable\u003C/td\u003E\n\u003Ctd\u003EWhich authentication state has been invalidated\u003C/td\u003E\n\u003C/tr\u003E\n\u003Ctr\u003E\n\u003Ctd\u003EDevice context\u003C/td\u003E\n\u003Ctd\u003EMay be associated with token use\u003C/td\u003E\n\u003Ctd\u003EManaged through applicable chain and session context\u003C/td\u003E\n\u003C/tr\u003E\n\u003C/tbody\u003E\n\u003C/table\u003E\u003C/div\u003E\n\u003Cp\u003EA token may be valid according to its own format but unacceptable under authoritative session security rules.\u003C/p\u003E\n\u003Cp\u003EConversely, server-side session state may remain active while a particular access token has expired.\u003C/p\u003E\n\u003Cp\u003EBoth levels must be understood to reason correctly about the selected authentication mode.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022common-security-misconceptions\u0022\u003ECommon Security Misconceptions\u003C/h2\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-valid-signature-means-current-authorization\u0022\u003EA Valid Signature Means Current Authorization\u003C/h3\u003E\n\u003Cp\u003EA valid JWT signature proves that the token has not been modified and was signed by an accepted key.\u003C/p\u003E\n\u003Cp\u003EIt does not prove that the user\u0027s permissions or account status have remained unchanged since issuance.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022a-device-identifier-prevents-token-theft\u0022\u003EA Device Identifier Prevents Token Theft\u003C/h3\u003E\n\u003Cp\u003EA device identifier may support context consistency checks.\u003C/p\u003E\n\u003Cp\u003EIt does not independently prevent a stolen bearer credential from being replayed.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022refresh-rotation-makes-token-theft-impossible\u0022\u003ERefresh Rotation Makes Token Theft Impossible\u003C/h3\u003E\n\u003Cp\u003ERotation can reduce reuse opportunities and support detection of invalid reuse.\u003C/p\u003E\n\u003Cp\u003EIt does not prevent a stolen credential from being used before the legitimate client or server detects the compromise.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022logout-invalidates-every-jwt-immediately\u0022\u003ELogout Invalidates Every JWT Immediately\u003C/h3\u003E\n\u003Cp\u003ELogout may revoke server-managed session or refresh state.\u003C/p\u003E\n\u003Cp\u003EPreviously issued JWT access tokens can remain valid until expiration unless protected resources enforce an additional invalidation mechanism.\u003C/p\u003E\n\u003Ch3 class=\u0022mud-scrollspy-section\u0022 id=\u0022short-lived-tokens-eliminate-the-need-for-session-security\u0022\u003EShort-Lived Tokens Eliminate the Need for Session Security\u003C/h3\u003E\n\u003Cp\u003EShort lifetimes reduce the exposure window of a compromised token.\u003C/p\u003E\n\u003Cp\u003EThey do not replace account-level security policies, credential recovery protections, or session revocation controls where those capabilities are required.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022security-design-principles\u0022\u003ESecurity Design Principles\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth\u0027s token model is best understood through a few principles.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EUse credentials only for their intended purpose.\u003C/strong\u003E Access and refresh credentials must not be interchangeable.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EValidate according to the selected mode.\u003C/strong\u003E Opaque credentials require authoritative validation; JWTs require correct cryptographic and claims validation.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ETreat JWT claims as issuance-time information.\u003C/strong\u003E Current authorization state may differ from what an older token contains.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EKeep access credentials appropriately short-lived.\u003C/strong\u003E Token lifetime should reflect the application\u0027s acceptable exposure window.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EEnforce refresh continuation rules.\u003C/strong\u003E Rotation, expiration, consumption, and reuse behavior must be consistent with the configured strategy.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDistinguish token expiration from session revocation.\u003C/strong\u003E They invalidate authentication through different mechanisms.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EDo not promise immediate JWT revocation without enforcement.\u003C/strong\u003E Server-side state changes affect locally validated tokens only when the resource checks the relevant state.\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022architectural-perspective\u0022\u003EArchitectural Perspective\u003C/h2\u003E\n\u003Cp\u003EUltimateAuth does not impose a single token model on every application.\u003C/p\u003E\n\u003Cp\u003EPureOpaque and Hybrid emphasize server-authoritative authentication state.\u003C/p\u003E\n\u003Cp\u003ESemiHybrid and PureJwt support locally validated JWT access, with different approaches to authentication continuation.\u003C/p\u003E\n\u003Cp\u003EThese choices affect performance, storage requirements, revocation behavior, and authorization freshness.\u003C/p\u003E\n\u003Cp\u003EThe purpose of the token security model is to make those tradeoffs explicit.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003EA token establishes access only while its applicable validation requirements remain satisfied. The strength and freshness of those requirements depend on the authentication mode.\u003C/strong\u003E\u003C/p\u003E\n\u003Ch2 class=\u0022mud-scrollspy-section\u0022 id=\u0022next-steps\u0022\u003ENext Steps\u003C/h2\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/security/session-security\u0022\u003ESession Security\u003C/a\u003E \u2014 Understand authoritative session validation and hierarchical revocation.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/fundamentals/auth-modes\u0022\u003EAuthentication Modes\u003C/a\u003E \u2014 Compare credential behavior across modes.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/sessions-devices/session-lifecycle\u0022\u003ESession Model \u0026amp; Lifecycle\u003C/a\u003E \u2014 Explore session creation, continuation, and invalidation.\u003C/li\u003E\n\u003Cli\u003E\u003Ca href=\u0022/docs/plugin-domains/credentials\u0022\u003ECredentials\u003C/a\u003E \u2014 Understand credential management and recovery security.\u003C/li\u003E\n\u003C/ul\u003E\n", "Headings": [ { "Id": "authentication-state-and-credentials", @@ -249,6 +249,6 @@ "Level": 0 } ], - "SourceHash": "1B938DBCF5811471F4B72FFC76F4F6C9524FD622075A1738E07F489F15592169", + "SourceHash": "1343160C1FB25288766B429B71863855D87AD4C8FDCBEA2772138A7678559954", "BuilderVersion": "1" } \ No newline at end of file diff --git a/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleHome.razor.cs b/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleHome.razor.cs index f7ab64a6..02a4771b 100644 --- a/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleHome.razor.cs +++ b/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleHome.razor.cs @@ -108,23 +108,23 @@ private async Task Validate() private Color GetHealthColor() { - if (Diagnostics.RefreshReauthRequiredCount > 0) - return Color.Warning; - - if (Diagnostics.TerminatedCount > 0) + if (Diagnostics.IsTerminated) return Color.Error; + if (!AuthState.IsAuthenticated) + return Color.Warning; + return Color.Success; } private string GetHealthText() { - if (Diagnostics.RefreshReauthRequiredCount > 0) - return "Reauthentication Required"; - - if (Diagnostics.TerminatedCount > 0) + if (Diagnostics.IsTerminated) return "Session Terminated"; + if (!AuthState.IsAuthenticated) + return "Reauthentication Required"; + return "Healthy"; } diff --git a/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleLogin.razor.cs b/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleLogin.razor.cs index d0e98424..29742d8e 100644 --- a/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleLogin.razor.cs +++ b/samples/CodeBeam.UltimateAuth.Sample.Shared/Components/Page/SampleLogin.razor.cs @@ -1,8 +1,10 @@ -using CodeBeam.UltimateAuth.Client.Blazor; +using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Blazor; using CodeBeam.UltimateAuth.Client.Runtime; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Sample.Shared.Components.Dialogs; +using Microsoft.AspNetCore.Components; using MudBlazor; namespace CodeBeam.UltimateAuth.Sample.Shared.Components.Page; @@ -78,14 +80,24 @@ AuthFailureReason.InvalidCredentials when remainingAttempts is > 0 Snackbar.Add(message, Severity.Error); } + [Inject] + private IUAuthStateManager StateManager { get; set; } = default!; + private async Task ProgrammaticLogin() { var request = new LoginRequest { Identifier = "admin", - Secret = "admin", + Secret = "admin" }; - await UAuthClient.Flows.LoginAsync(request, ReturnUrl ?? "/home"); + + var result = await UAuthClient.Flows.LoginAsync(request, returnUrl: ReturnUrl ?? "/home"); + + if (!result.IsSuccess) + { + Snackbar.Add("Login failed.", Severity.Error); + return; + } } private async void StartCountdown() diff --git a/samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Program.cs b/samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Program.cs index 472319cb..b226287d 100644 --- a/samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Program.cs +++ b/samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Program.cs @@ -29,7 +29,6 @@ builder.Services.AddScoped(); builder.Services.AddUltimateAuthServer(o => { - //o.AuthMode = UAuthMode.PureJwt; //o.GrantDelivery.Default = GrantDeliveryMode.Cookie; o.Cryptography.JwtSigningKey = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes("UltimateAuth-Development-JWT-Signing-Key-2026-Only")); diff --git a/samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Program.cs b/samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Program.cs index 56ff01da..f55c591b 100644 --- a/samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Program.cs +++ b/samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Program.cs @@ -45,7 +45,6 @@ builder.Services.AddUltimateAuthServer(o => { - o.AuthMode = UAuthMode.PureJwt; o.Diagnostics.EnableRefreshDetails = true; o.Login.MaxFailedAttempts = 2; o.Login.LockoutDuration = TimeSpan.FromSeconds(10); @@ -68,28 +67,11 @@ //o.Session.Lifetime = TimeSpan.FromSeconds(20); //o.Session.TouchInterval = TimeSpan.FromSeconds(9); //o.Session.IdleTimeout = TimeSpan.FromSeconds(10); - - o.GrantDelivery.Default = GrantDeliveryMode.Cookie; - // PureJwt access token cookie - o.Cookie.AccessToken.Name = "uat"; - o.Cookie.AccessToken.HttpOnly = true; - o.Cookie.AccessToken.SecurePolicy = CookieSecurePolicy.Always; - o.Cookie.AccessToken.SameSite = SameSiteMode.Lax; - o.Cookie.AccessToken.Path = "/"; - - // PureJwt refresh token cookie - o.Cookie.RefreshToken.Name = "uar"; - o.Cookie.RefreshToken.HttpOnly = true; - o.Cookie.RefreshToken.SecurePolicy = CookieSecurePolicy.Always; - o.Cookie.RefreshToken.SameSite = SameSiteMode.Lax; - o.Cookie.RefreshToken.Path = "/"; }) .AddUltimateAuthInMemory(); builder.Services.AddUltimateAuthClientBlazor(o => { - o.ApplicationProfile = UAuthApplicationProfile.BlazorServer; - o.AutoDetectApplicationProfile = false; o.Login.AllowCredentialPost = true; //o.AutoRefresh.Interval = TimeSpan.FromSeconds(5); o.Reauth.Behavior = ReauthBehavior.RaiseEvent; diff --git a/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/Program.cs b/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/Program.cs index d50eca1a..2982a766 100644 --- a/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/Program.cs +++ b/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/Program.cs @@ -26,8 +26,6 @@ Key = Convert.ToBase64String(Encoding.UTF8.GetBytes("UltimateAuth-Development-JWT-Signing-Key-2026-Only")) }); - o.Auth.AccessToken.DeliveryMode = GrantDeliveryMode.Cookie; - o.Hub.BaseUrl = "https://localhost:6112"; o.Cors.AllowedOrigins.Add("https://localhost:6132"); o.Cors.PolicyName = "resourceApi"; diff --git a/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi/Program.cs b/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi/Program.cs index 8fa57a43..d8aa42cb 100644 --- a/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi/Program.cs +++ b/samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi/Program.cs @@ -1,3 +1,4 @@ +using CodeBeam.UltimateAuth.Core; using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Server.Abstractions; using CodeBeam.UltimateAuth.Server.Extensions; @@ -30,10 +31,10 @@ Key = Convert.ToBase64String(Encoding.UTF8.GetBytes("UltimateAuth-Development-JWT-Signing-Key-2026-Only")) }); - o.Auth.AccessToken.DeliveryMode = GrantDeliveryMode.Cookie; + //o.Auth.Mode = UAuthMode.PureJwt; // TODO: Make multiple UAuthHub support via resolver, then different client apps can use different UAuthHub instances if needed. - //o.Hub.BaseUrl = "https://localhost:6110"; // PureJwt auth mode doesn't need UAuthHub, but other auth modes do. This is the URL of the UAuthHub instance that this resource API trusts. + o.Hub.BaseUrl = "https://localhost:6110"; // PureJwt auth mode doesn't need UAuthHub, but other auth modes do. This is the URL of the UAuthHub instance that this resource API trusts. // o.UAuthHubBaseUrl = "https://localhost:7213"; // Comment upper line and uncomment this if you want to try blazor server sample. // Standalone WASM diff --git a/src/CodeBeam.UltimateAuth.Core/Contracts/Token/AccessToken.cs b/src/CodeBeam.UltimateAuth.Core/Contracts/Token/AccessToken.cs index 8c7169c3..e292e315 100644 --- a/src/CodeBeam.UltimateAuth.Core/Contracts/Token/AccessToken.cs +++ b/src/CodeBeam.UltimateAuth.Core/Contracts/Token/AccessToken.cs @@ -12,7 +12,7 @@ public sealed class AccessToken // TODO: TokenKind enum? /// - /// Token type: "jwt" or "opaque". + /// Token format (JWT or opaque). /// Used for diagnostics and middleware behavior. /// public TokenFormat Format { get; init; } @@ -23,9 +23,17 @@ public sealed class AccessToken public required DateTimeOffset ExpiresAt { get; init; } /// - /// Optional session id this token is bound to (Hybrid / SemiHybrid). + /// Optional session identifier associated with the token. /// public string? SessionId { get; init; } + /// + /// Optional token scope. + /// public string? Scope { get; init; } + + /// + /// Determines whether the token has expired. + /// + public bool IsExpired(DateTimeOffset now) => now >= ExpiresAt; } diff --git a/src/CodeBeam.UltimateAuth.Server/Auth/Response/AuthResponseResolver.cs b/src/CodeBeam.UltimateAuth.Server/Auth/Response/AuthResponseResolver.cs index 7b8873af..210b7f00 100644 --- a/src/CodeBeam.UltimateAuth.Server/Auth/Response/AuthResponseResolver.cs +++ b/src/CodeBeam.UltimateAuth.Server/Auth/Response/AuthResponseResolver.cs @@ -72,21 +72,13 @@ or UAuthMode.SemiHybrid effectiveMode is UAuthMode.Hybrid or UAuthMode.SemiHybrid or UAuthMode.PureJwt, - effectiveMode == UAuthMode.Hybrid - ? GrantDeliveryMode.Cookie - : effectiveMode == UAuthMode.PureOpaque - ? GrantDeliveryMode.None - : GrantDeliveryMode.Header, + GrantDeliveryMode.Cookie, delivery.RefreshToken, delivery.Default, applicationProfile, options); - return new EffectiveAuthResponse( - session, - accessToken, - refreshToken, - redirect); + return new EffectiveAuthResponse(session, accessToken, refreshToken, redirect); } private static EffectiveGrantDelivery ResolveGrant( diff --git a/src/CodeBeam.UltimateAuth.Server/Auth/Response/EffectiveAuthModeResolver.cs b/src/CodeBeam.UltimateAuth.Server/Auth/Response/EffectiveAuthModeResolver.cs index 1a24fdf1..d5ca7692 100644 --- a/src/CodeBeam.UltimateAuth.Server/Auth/Response/EffectiveAuthModeResolver.cs +++ b/src/CodeBeam.UltimateAuth.Server/Auth/Response/EffectiveAuthModeResolver.cs @@ -13,8 +13,9 @@ public UAuthMode Resolve(AuthModeResolutionContext context) UAuthApplicationProfile.WebServer => UAuthMode.Hybrid, UAuthApplicationProfile.BlazorWasm => UAuthMode.Hybrid, UAuthApplicationProfile.Maui => UAuthMode.Hybrid, - UAuthApplicationProfile.Api => UAuthMode.PureJwt, - UAuthApplicationProfile.ResourceApi => UAuthMode.PureJwt, + UAuthApplicationProfile.UAuthHub => UAuthMode.Hybrid, + UAuthApplicationProfile.Api => UAuthMode.Hybrid, + UAuthApplicationProfile.ResourceApi => UAuthMode.Hybrid, _ => UAuthMode.Hybrid }; } diff --git a/src/CodeBeam.UltimateAuth.Server/Endpoints/LoginEndpointHandler.cs b/src/CodeBeam.UltimateAuth.Server/Endpoints/LoginEndpointHandler.cs index 483e17c4..84db0de1 100644 --- a/src/CodeBeam.UltimateAuth.Server/Endpoints/LoginEndpointHandler.cs +++ b/src/CodeBeam.UltimateAuth.Server/Endpoints/LoginEndpointHandler.cs @@ -1,6 +1,7 @@ using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; +using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Server.Abstractions; using CodeBeam.UltimateAuth.Server.Auth; using CodeBeam.UltimateAuth.Server.Extensions; @@ -57,6 +58,15 @@ public async Task LoginAsync(HttpContext ctx) return failure.Enabled ? Results.Redirect(failure.TargetUrl!) : Results.Unauthorized(); } + var isFetch = ctx.Request.HasFormContentType && (await ctx.GetCachedFormAsync())?["__uauth_response_mode"].FirstOrDefault() == "fetch"; + + if (!isFetch && (authFlow.Response.AccessTokenDelivery.Mode == GrantDeliveryMode.Header || authFlow.Response.SessionIdDelivery.Mode == GrantDeliveryMode.Header)) + { + return Results.BadRequest(new + { + error = "fetch_transport_required" + }); + } var suppressFailureAttempt = false; @@ -126,6 +136,17 @@ public async Task LoginAsync(HttpContext ctx) if (!result.IsSuccess) { + if (isFetch) + { + return Results.Json(new + { + IsSuccess = false, + Reason = result.FailureReason, + RemainingAttempts = result.RemainingAttempts, + LockoutUntilUtc = result.LockoutUntilUtc + }, statusCode: StatusCodes.Status401Unauthorized); + } + var decisionFailure = _redirectResolver.ResolveFailure(authFlow, ctx, result.FailureReason ?? AuthFailureReason.Unknown, result); return decisionFailure.Enabled @@ -150,6 +171,19 @@ public async Task LoginAsync(HttpContext ctx) var decision = _redirectResolver.ResolveSuccess(authFlow, ctx); + if (ctx.Request.HasFormContentType) + { + var form = await ctx.GetCachedFormAsync(); + + if (form?["__uauth_response_mode"].FirstOrDefault() == "fetch") + { + return Results.Ok(new + { + RedirectUrl = decision.Enabled ? decision.TargetUrl : null + }); + } + } + return decision.Enabled ? Results.Redirect(decision.TargetUrl!) : Results.Ok(); diff --git a/src/CodeBeam.UltimateAuth.Server/Endpoints/PkceEndpointHandler.cs b/src/CodeBeam.UltimateAuth.Server/Endpoints/PkceEndpointHandler.cs index 9833ed53..758a4e2b 100644 --- a/src/CodeBeam.UltimateAuth.Server/Endpoints/PkceEndpointHandler.cs +++ b/src/CodeBeam.UltimateAuth.Server/Endpoints/PkceEndpointHandler.cs @@ -3,6 +3,7 @@ using CodeBeam.UltimateAuth.Core.Defaults; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.Errors; +using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Server.Abstractions; using CodeBeam.UltimateAuth.Server.Auth; using CodeBeam.UltimateAuth.Server.Extensions; @@ -157,6 +158,18 @@ public async Task CompleteAsync(HttpContext ctx) { var auth = _authContext.Current; + var isFetch = ctx.Request.HasFormContentType && (await ctx.GetCachedFormAsync())?["__uauth_response_mode"].FirstOrDefault() == "fetch"; + + if (!isFetch && + (auth.Response.AccessTokenDelivery.Mode == GrantDeliveryMode.Header || + auth.Response.SessionIdDelivery.Mode == GrantDeliveryMode.Header)) + { + return Results.BadRequest(new + { + error = "fetch_transport_required" + }); + } + var request = await ReadPkceCompleteRequestAsync(ctx); if (request is null) return Results.BadRequest("Invalid PKCE payload."); @@ -183,7 +196,15 @@ public async Task CompleteAsync(HttpContext ctx) return Results.Unauthorized(); if (!result.IsSuccess) - return await RedirectToLoginWithErrorAsync(ctx, auth, request.HubSessionId, result.FailureReason); + { + return isFetch + ? Results.Unauthorized() + : await RedirectToLoginWithErrorAsync( + ctx, + auth, + request.HubSessionId, + result.FailureReason); + } var login = result.LoginResult!; @@ -198,6 +219,16 @@ public async Task CompleteAsync(HttpContext ctx) var decision = _redirectResolver.ResolveSuccess(auth, ctx); + if (isFetch) + { + return Results.Ok(new + { + RedirectUrl = decision.Enabled + ? decision.TargetUrl + : null + }); + } + return decision.Enabled ? Results.Redirect(decision.TargetUrl!) : Results.Ok(); diff --git a/src/CodeBeam.UltimateAuth.Server/Endpoints/UAuthEndpointRegistrar.cs b/src/CodeBeam.UltimateAuth.Server/Endpoints/UAuthEndpointRegistrar.cs index 23698d85..a99be842 100644 --- a/src/CodeBeam.UltimateAuth.Server/Endpoints/UAuthEndpointRegistrar.cs +++ b/src/CodeBeam.UltimateAuth.Server/Endpoints/UAuthEndpointRegistrar.cs @@ -60,6 +60,9 @@ public void MapEndpoints(RouteGroupBuilder rootGroup, UAuthServerOptions options if (options.Endpoints.Authentication != false) { + group.MapGet("/login/transport", UAuthLoginTransportEndpoint.Get) + .WithMetadata(new AuthFlowMetadata(AuthFlowType.Login)).WithUAuthRateLimit(UAuthEndpoint.LoginTransport); + group.MapPost("/login", async ([FromServices] ILoginEndpointHandler h, HttpContext ctx) => await h.LoginAsync(ctx)).WithMetadata(new AuthFlowMetadata(AuthFlowType.Login), new UAuthCsrfMetadata(UAuthCsrfOperation.Login)).WithUAuthRateLimit(UAuthEndpoint.Login); diff --git a/src/CodeBeam.UltimateAuth.Server/Endpoints/UAuthLoginTransportEndpoint.cs b/src/CodeBeam.UltimateAuth.Server/Endpoints/UAuthLoginTransportEndpoint.cs new file mode 100644 index 00000000..89684d38 --- /dev/null +++ b/src/CodeBeam.UltimateAuth.Server/Endpoints/UAuthLoginTransportEndpoint.cs @@ -0,0 +1,30 @@ +using CodeBeam.UltimateAuth.Core.Options; +using CodeBeam.UltimateAuth.Server.Auth; +using Microsoft.AspNetCore.Http; + +namespace CodeBeam.UltimateAuth.Server.Endpoints; + +internal static class UAuthLoginTransportEndpoint +{ + public static IResult Get(HttpContext context, IAuthFlowContextAccessor accessor) + { + var response = accessor.Current.Response; + + var sessionHeader = response.SessionIdDelivery.Mode == GrantDeliveryMode.Header; + + var accessHeader = response.AccessTokenDelivery.Mode == GrantDeliveryMode.Header; + + context.Response.Headers.CacheControl = "no-store"; + + return Results.Ok(new + { + // The current client does not manage header-delivered opaque session IDs. + Supported = !sessionHeader, + + // Native navigation cannot capture response headers. + NavigationSupported = !sessionHeader && !accessHeader, + + AccessTokenInHeader = accessHeader + }); + } +} diff --git a/src/CodeBeam.UltimateAuth.Server/Endpoints/ValidateEndpointHandler.cs b/src/CodeBeam.UltimateAuth.Server/Endpoints/ValidateEndpointHandler.cs index f7834c2a..a169ebb7 100644 --- a/src/CodeBeam.UltimateAuth.Server/Endpoints/ValidateEndpointHandler.cs +++ b/src/CodeBeam.UltimateAuth.Server/Endpoints/ValidateEndpointHandler.cs @@ -143,11 +143,24 @@ public async Task ValidateAsync(HttpContext context, CancellationToken ); } - private static async Task ValidatePureJwtAsync(HttpContext context) + private static async Task ValidatePureJwtAsync( + HttpContext context) { - var result = await context.AuthenticateAsync(UAuthConstants.SchemeDefaults.GlobalScheme); + var result = await context.AuthenticateAsync( + UAuthConstants.SchemeDefaults.GlobalScheme); - if (!result.Succeeded || result.Principal?.Identity?.IsAuthenticated != true) + if (result.None) + { + return Results.Json( + new AuthValidationResult + { + State = SessionState.NotFound + }, + statusCode: StatusCodes.Status401Unauthorized); + } + + if (!result.Succeeded || + result.Principal?.Identity?.IsAuthenticated != true) { return Results.Json( new AuthValidationResult @@ -159,7 +172,8 @@ private static async Task ValidatePureJwtAsync(HttpContext context) var principal = result.Principal; - var subject = principal.FindFirst(ClaimTypes.NameIdentifier)?.Value; + var subject = principal + .FindFirst(ClaimTypes.NameIdentifier)?.Value; if (!UserKey.TryParse(subject, null, out var userKey)) { @@ -171,7 +185,10 @@ private static async Task ValidatePureJwtAsync(HttpContext context) statusCode: StatusCodes.Status401Unauthorized); } - var snapshot = PureJwtSnapshotFactory.Create(principal, userKey, context.GetTenant()); + var snapshot = PureJwtSnapshotFactory.Create( + principal, + userKey, + context.GetTenant()); return Results.Ok(new AuthValidationResult { diff --git a/src/CodeBeam.UltimateAuth.Server/Extensions/ServiceCollectionExtensions.cs b/src/CodeBeam.UltimateAuth.Server/Extensions/ServiceCollectionExtensions.cs index 1613dcdc..ebcfa2d4 100644 --- a/src/CodeBeam.UltimateAuth.Server/Extensions/ServiceCollectionExtensions.cs +++ b/src/CodeBeam.UltimateAuth.Server/Extensions/ServiceCollectionExtensions.cs @@ -470,6 +470,7 @@ internal static IServiceCollection AddAuthorizationInternal(IServiceCollection s return services; } + public static IServiceCollection AddUAuthHub(this IServiceCollection services, Action? configure = null) { services.PostConfigure(options => @@ -483,28 +484,9 @@ public static IServiceCollection AddUAuthHub(this IServiceCollection services, A services.TryAddScoped(); services.TryAddScoped(); - services.AddCors(options => - { - options.AddPolicy("UAuthHub", policy => - { - var sp = services.BuildServiceProvider(); - var serverOptions = sp.GetRequiredService>().Value; - - var origins = serverOptions.Hub.AllowedClientOrigins - .Select(OriginHelper.Normalize) - .ToArray(); + services.AddCors(); - if (origins.Length > 0) - { - policy - .WithOrigins(origins) - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials() - .WithExposedHeaders("X-UAuth-Refresh"); - } - }); - }); + services.TryAddEnumerable(ServiceDescriptor.Singleton, UAuthHubCorsOptionsSetup>()); return services; } @@ -519,12 +501,10 @@ private static IServiceCollection AddUltimateAuthResourceInternal(this IServiceC services.TryAddSingleton>(sp => { - var resource = sp.GetRequiredService< - IOptions>().Value; + var resource = sp.GetRequiredService>().Value; var jwt = resource.Auth.Jwt - ?? throw new InvalidOperationException( - "Auth.Jwt is required for JWT validation."); + ?? throw new InvalidOperationException("Auth.Jwt is required for JWT validation."); return Microsoft.Extensions.Options.Options.Create(jwt); }); @@ -532,12 +512,10 @@ private static IServiceCollection AddUltimateAuthResourceInternal(this IServiceC services.TryAddSingleton(); services.AddSingleton(); - services.AddScoped(); services.TryAddScoped(); services.TryAddSingleton(); services.AddScoped, ResourceUserAccessor>(); - //services.AddScoped(); services.AddScoped(); // Server & Resource API Shared @@ -603,7 +581,13 @@ private static IServiceCollection AddUltimateAuthResourceInternal(this IServiceC var options = sp.GetRequiredService>().Value; client.BaseAddress = new Uri(options.Hub.BaseUrl, UriKind.Absolute); - }); + }) + .ConfigurePrimaryHttpMessageHandler(() => + new HttpClientHandler + { + UseCookies = false, + AllowAutoRedirect = false + }); return services; } diff --git a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/AspNetCore/TransportCredentialResolver.cs b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/AspNetCore/TransportCredentialResolver.cs index 84da3930..487cff72 100644 --- a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/AspNetCore/TransportCredentialResolver.cs +++ b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/AspNetCore/TransportCredentialResolver.cs @@ -13,10 +13,16 @@ internal sealed class TransportCredentialResolver : ITransportCredentialResolver return mode switch { UAuthMode.PureJwt or UAuthMode.SemiHybrid => - await ResolveDeliveryAsync(context, response.AccessTokenDelivery, TransportCredentialKind.AccessToken), + await ResolveDeliveryAsync( + context, + response.AccessTokenDelivery, + TransportCredentialKind.AccessToken), UAuthMode.PureOpaque or UAuthMode.Hybrid => - await ResolveDeliveryAsync(context, response.SessionIdDelivery, TransportCredentialKind.Session), + await ResolveDeliveryAsync( + context, + response.SessionIdDelivery, + TransportCredentialKind.Session), _ => null }; @@ -29,8 +35,18 @@ await ResolveDeliveryAsync(context, response.SessionIdDelivery, TransportCredent GrantDeliveryMode.Cookie => ReadCookie(context, delivery.Cookie?.Name), + GrantDeliveryMode.Header + when kind == TransportCredentialKind.AccessToken => + ReadHeader( + context, + "Authorization", + HeaderTokenFormat.Bearer), + GrantDeliveryMode.Header => - ReadHeader(context, delivery.Name, delivery.HeaderFormat), + ReadHeader( + context, + delivery.Name, + delivery.HeaderFormat), _ => null }; @@ -47,7 +63,9 @@ await ResolveDeliveryAsync(context, response.SessionIdDelivery, TransportCredent }; } - private static string? ReadCookie(HttpContext context, string? name) + private static string? ReadCookie( + HttpContext context, + string? name) { if (string.IsNullOrWhiteSpace(name)) return null; @@ -58,9 +76,13 @@ await ResolveDeliveryAsync(context, response.SessionIdDelivery, TransportCredent : null; } - private static string? ReadHeader(HttpContext context, string? name, HeaderTokenFormat format) + private static string? ReadHeader( + HttpContext context, + string? name, + HeaderTokenFormat format) { - if (string.IsNullOrWhiteSpace(name) || !context.Request.Headers.TryGetValue(name, out var header)) + if (string.IsNullOrWhiteSpace(name) || + !context.Request.Headers.TryGetValue(name, out var header)) { return null; } @@ -71,7 +93,9 @@ await ResolveDeliveryAsync(context, response.SessionIdDelivery, TransportCredent { const string prefix = "Bearer "; - if (!value.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) + if (!value.StartsWith( + prefix, + StringComparison.OrdinalIgnoreCase)) { return null; } diff --git a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/CredentialResponseWriter.cs b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/CredentialResponseWriter.cs index 56de8b2d..093f8638 100644 --- a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/CredentialResponseWriter.cs +++ b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/CredentialResponseWriter.cs @@ -30,7 +30,34 @@ public void Write(HttpContext context, GrantKind kind, AuthSessionId sessionId) => WriteInternal(context, kind, sessionId.ToString()); public void Write(HttpContext context, GrantKind kind, AccessToken token) - => WriteInternal(context, kind, token.Token); + { + ArgumentNullException.ThrowIfNull(token); + + WriteInternal(context, kind, token.Token); + + if (kind != GrantKind.AccessToken) + return; + + var auth = _authContext.Current; + var delivery = auth.Response.AccessTokenDelivery; + + if (delivery.Mode != GrantDeliveryMode.Header) + return; + + var headerName = delivery.Name; + + if (string.IsNullOrWhiteSpace(headerName)) + throw new InvalidOperationException("Access token header name is missing."); + + var headers = context.Response.Headers; + + headers["X-UAuth-Access-Header"] = headerName; + headers["X-UAuth-Access-Expires"] = token.ExpiresAt.ToUniversalTime().ToString("O"); + headers["X-UAuth-Access-Format"] = token.Format.ToString().ToLowerInvariant(); + headers["X-UAuth-Access-HeaderFormat"] = delivery.HeaderFormat.ToString().ToLowerInvariant(); + + headers.CacheControl = "no-store"; + } public void Write(HttpContext context, GrantKind kind, RefreshTokenInfo token) => WriteInternal(context, kind, token.Token); diff --git a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/ValidateCredentialResolver.cs b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/ValidateCredentialResolver.cs index c06611d3..1e032edd 100644 --- a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/ValidateCredentialResolver.cs +++ b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Credentials/ValidateCredentialResolver.cs @@ -1,33 +1,16 @@ using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.Options; -using CodeBeam.UltimateAuth.Server.Abstractions; using CodeBeam.UltimateAuth.Server.Auth; using CodeBeam.UltimateAuth.Server.Contracts; using CodeBeam.UltimateAuth.Server.Extensions; +using CodeBeam.UltimateAuth.Server.Infrastructure; using Microsoft.AspNetCore.Http; -namespace CodeBeam.UltimateAuth.Server.Infrastructure; - internal sealed class ValidateCredentialResolver : IValidateCredentialResolver { - private readonly IPrimaryCredentialResolver _primaryResolver; - - public ValidateCredentialResolver(IPrimaryCredentialResolver primaryResolver) - { - _primaryResolver = primaryResolver; - } - - public async Task ResolveAsync(HttpContext context, EffectiveAuthResponse response) + public Task ResolveAsync(HttpContext context, EffectiveAuthResponse response) { - var kind = _primaryResolver.Resolve(context); - - return kind switch - { - PrimaryTokenKind.Session => await ResolveSession(context, response), - PrimaryTokenKind.AccessToken => await ResolveAccessToken(context, response), - - _ => null - }; + return ResolveSession(context, response); } private static async Task ResolveSession(HttpContext context, EffectiveAuthResponse response) @@ -38,6 +21,7 @@ public ValidateCredentialResolver(IPrimaryCredentialResolver primaryResolver) return null; var cookie = delivery.Cookie; + if (cookie is null) return null; @@ -55,56 +39,4 @@ public ValidateCredentialResolver(IPrimaryCredentialResolver primaryResolver) Device = await context.GetDeviceAsync() }; } - - private static async Task ResolveAccessToken(HttpContext context, EffectiveAuthResponse response) - { - var delivery = response.AccessTokenDelivery; - - if (delivery.Mode == GrantDeliveryMode.Cookie) - { - var cookieName = delivery.Cookie?.Name; - - if (string.IsNullOrWhiteSpace(cookieName) || - !context.Request.Cookies.TryGetValue(cookieName, out var raw) || - string.IsNullOrWhiteSpace(raw)) - { - return null; - } - - return new ResolvedCredential - { - Kind = PrimaryTokenKind.AccessToken, - Value = raw.Trim(), - Tenant = context.GetTenant(), - Device = await context.GetDeviceAsync() - }; - } - - if (delivery.Mode != GrantDeliveryMode.Header) - return null; - - var headerName = delivery.Name ?? "Authorization"; - - if (!context.Request.Headers.TryGetValue(headerName, out var header)) - return null; - - var value = header.ToString(); - - if (delivery.HeaderFormat == HeaderTokenFormat.Bearer && - value.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) - { - value = value["Bearer ".Length..].Trim(); - } - - if (string.IsNullOrWhiteSpace(value)) - return null; - - return new ResolvedCredential - { - Kind = PrimaryTokenKind.AccessToken, - Value = value, - Tenant = context.GetTenant(), - Device = await context.GetDeviceAsync() - }; - } } diff --git a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Issuers/UAuthTokenIssuer.cs b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Issuers/UAuthTokenIssuer.cs index cd39b5c9..19a9e771 100644 --- a/src/CodeBeam.UltimateAuth.Server/Infrastructure/Issuers/UAuthTokenIssuer.cs +++ b/src/CodeBeam.UltimateAuth.Server/Infrastructure/Issuers/UAuthTokenIssuer.cs @@ -39,6 +39,7 @@ public Task IssueAccessTokenAsync(AuthFlowContext flow, TokenIssuan return flow.EffectiveMode switch { + // TODO: Hybrid should issue opaque session id and JWT access token with session id claim. This may be inconsistent with current AuthResponseResolver behavior. UAuthMode.PureOpaque or UAuthMode.Hybrid => Task.FromResult(IssueOpaqueAccessToken(expires, context.SessionId)), diff --git a/src/CodeBeam.UltimateAuth.Server/Options/UAuthHubCorsOptionsSetup.cs b/src/CodeBeam.UltimateAuth.Server/Options/UAuthHubCorsOptionsSetup.cs new file mode 100644 index 00000000..21816066 --- /dev/null +++ b/src/CodeBeam.UltimateAuth.Server/Options/UAuthHubCorsOptionsSetup.cs @@ -0,0 +1,44 @@ +using CodeBeam.UltimateAuth.Server.Infrastructure; +using Microsoft.AspNetCore.Cors.Infrastructure; +using Microsoft.Extensions.Options; + +namespace CodeBeam.UltimateAuth.Server.Options; + +internal sealed class UAuthHubCorsOptionsSetup(IOptions serverOptions) : IConfigureOptions +{ + public void Configure(CorsOptions options) + { + var server = serverOptions.Value; + + var origins = server.Hub.AllowedClientOrigins + .Select(OriginHelper.Normalize) + .Distinct(StringComparer.Ordinal) + .ToArray(); + + options.AddPolicy("UAuthHub", policy => + { + if (origins.Length == 0) + return; + + var accessHeader = server.GrantDelivery.AccessToken.HeaderName ?? "uat"; + + var exposedHeaders = new HashSet(StringComparer.OrdinalIgnoreCase) + { + "X-UAuth-Refresh", + "X-UAuth-Access-Header", + "X-UAuth-Access-Expires", + "X-UAuth-Access-Format", + "X-UAuth-Access-HeaderFormat", + "Retry-After", + accessHeader + }; + + policy + .WithOrigins(origins) + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials() + .WithExposedHeaders(exposedHeaders.ToArray()); + }); + } +} diff --git a/src/CodeBeam.UltimateAuth.Server/Options/UAuthResourceApiOptions.cs b/src/CodeBeam.UltimateAuth.Server/Options/UAuthResourceApiOptions.cs index 1c46deac..32134b39 100644 --- a/src/CodeBeam.UltimateAuth.Server/Options/UAuthResourceApiOptions.cs +++ b/src/CodeBeam.UltimateAuth.Server/Options/UAuthResourceApiOptions.cs @@ -37,7 +37,7 @@ public sealed class UAuthResourceAuthOptions /// /// /// When null, the registered authentication mode resolver determines the mode using the ResourceApi application profile. - /// The built-in resolver selects PureJwt. + /// The built-in resolver selects Hybrid. /// The resolved mode is fixed for this Resource API runtime. /// public UAuthMode? Mode { get; set; } @@ -74,7 +74,7 @@ public sealed class UAuthResourceAuthOptions /// public sealed class UAuthResourceSessionOptions { - public GrantDeliveryMode DeliveryMode { get; set; } = GrantDeliveryMode.Header; + public GrantDeliveryMode DeliveryMode { get; set; } = GrantDeliveryMode.Cookie; public string CookieName { get; set; } = "uas"; @@ -126,10 +126,12 @@ public sealed class UAuthResourceDeviceOptions public sealed class UAuthResourceHubOptions { public string BaseUrl { get; set; } = string.Empty; + public string SessionCookieName { get; set; } = "uas"; internal UAuthResourceHubOptions Clone() => new() { - BaseUrl = BaseUrl + BaseUrl = BaseUrl, + SessionCookieName = SessionCookieName }; } diff --git a/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpoint.cs b/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpoint.cs index 51c3b4c5..d438a3ee 100644 --- a/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpoint.cs +++ b/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpoint.cs @@ -86,6 +86,7 @@ public enum UAuthEndpoint AntiforgeryToken, GetAuthenticationLockoutAdmin, UnlockAuthenticationAdmin, + LoginTransport, } internal enum UAuthRateLimitGroup { Sensitive, Standard, Frequent } diff --git a/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpointClassification.cs b/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpointClassification.cs index d09d79dd..520b235d 100644 --- a/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpointClassification.cs +++ b/src/CodeBeam.UltimateAuth.Server/RateLimiting/UAuthEndpointClassification.cs @@ -89,6 +89,7 @@ internal static class UAuthEndpointClassification UAuthEndpoint.AntiforgeryToken => new(endpoint, UAuthRateLimitGroup.Frequent, false), UAuthEndpoint.GetAuthenticationLockoutAdmin => new(endpoint, UAuthRateLimitGroup.Standard, false), UAuthEndpoint.UnlockAuthenticationAdmin => new(endpoint, UAuthRateLimitGroup.Sensitive, false), + UAuthEndpoint.LoginTransport => new(endpoint, UAuthRateLimitGroup.Standard, true), _ => throw new ArgumentOutOfRangeException(nameof(endpoint)) }; diff --git a/src/CodeBeam.UltimateAuth.Server/ResourceApi/RemoteSessionValidator.cs b/src/CodeBeam.UltimateAuth.Server/ResourceApi/RemoteSessionValidator.cs index bc138c28..81459e85 100644 --- a/src/CodeBeam.UltimateAuth.Server/ResourceApi/RemoteSessionValidator.cs +++ b/src/CodeBeam.UltimateAuth.Server/ResourceApi/RemoteSessionValidator.cs @@ -1,8 +1,8 @@ using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.Infrastructure; -using Microsoft.AspNetCore.Http; -using System.Net.Http.Json; +using CodeBeam.UltimateAuth.Server.Options; +using Microsoft.Extensions.Options; using System.Text.Json; namespace CodeBeam.UltimateAuth.Server.ResourceApi; @@ -11,70 +11,101 @@ namespace CodeBeam.UltimateAuth.Server.ResourceApi; internal sealed class RemoteSessionValidator : ISessionValidator { private readonly HttpClient _http; - private readonly IHttpContextAccessor _httpContextAccessor; + private readonly UAuthResourceApiOptions _options; - public RemoteSessionValidator(HttpClient http, IHttpContextAccessor httpContextAccessor) + public RemoteSessionValidator(HttpClient http, IOptions options) { _http = http; - _httpContextAccessor = httpContextAccessor; + _options = options.Value; } public async Task ValidateSessionAsync(SessionValidationContext context, CancellationToken ct = default) { - var request = new HttpRequestMessage(HttpMethod.Post, "/auth/validate") - { - Content = JsonContent.Create(new - { - sessionId = context.SessionId.Value, - tenant = context.Tenant.Value - }) - }; + SessionValidationResult Invalid(SessionState state = SessionState.Invalid) + => SessionValidationResult.Invalid(state, sessionId: context.SessionId); + + using var request = new HttpRequestMessage(HttpMethod.Post, "/auth/validate"); - var httpContext = _httpContextAccessor.HttpContext!; + var cookieName = _options.Hub.SessionCookieName; + var sessionValue = context.SessionId.Value; - if (httpContext.Request.Headers.TryGetValue("Cookie", out var cookie)) + if (string.IsNullOrWhiteSpace(cookieName) || + string.IsNullOrWhiteSpace(sessionValue) || + sessionValue.Any(c => + char.IsWhiteSpace(c) || + char.IsControl(c) || + c is ';' or ',' or '"' or '\\')) { - request.Headers.Add("Cookie", cookie.ToString()); + return Invalid(); } + request.Headers.Add( + "Cookie", + $"{cookieName}={sessionValue}"); + if (context.Device.DeviceId is { } deviceId) { - request.Headers.TryAddWithoutValidation("X-UDID", deviceId.Value); + request.Headers.Add("X-UDID", deviceId.Value); } - var response = await _http.SendAsync(request, ct); + try + { + using var response = await _http.SendAsync(request, ct); - if (!response.IsSuccessStatusCode) - return SessionValidationResult.Invalid(SessionState.NotFound, sessionId: context.SessionId); + if (!response.IsSuccessStatusCode) + return Invalid(SessionState.NotFound); - using var stream = await response.Content.ReadAsStreamAsync(ct); - using var document = await JsonDocument.ParseAsync(stream, cancellationToken: ct); + using var stream = + await response.Content.ReadAsStreamAsync(ct); - var dto = document.Deserialize(new JsonSerializerOptions(JsonSerializerDefaults.Web)); + using var document = + await JsonDocument.ParseAsync( + stream, + cancellationToken: ct); - if (dto is null) - { - return SessionValidationResult.Invalid(SessionState.NotFound, sessionId: context.SessionId); - } + var dto = document.Deserialize( + new JsonSerializerOptions(JsonSerializerDefaults.Web)); - if (dto.IsValid) - { - var hasUserStatus = - document.RootElement.ValueKind == JsonValueKind.Object && - document.RootElement.TryGetProperty("snapshot", out var snapshot) && - snapshot.ValueKind == JsonValueKind.Object && - snapshot.TryGetProperty("identity", out var identity) && - identity.ValueKind == JsonValueKind.Object && - identity.TryGetProperty("userStatus", out var status) && - status.ValueKind != JsonValueKind.Null && - status.ValueKind != JsonValueKind.Undefined; - - if (!hasUserStatus || dto.Snapshot?.Identity is null || !Enum.IsDefined(dto.Snapshot.Identity.UserStatus)) + if (dto is null) + return Invalid(); + + if (dto.IsValid) { - return SessionValidationResult.Invalid(SessionState.Invalid, sessionId: context.SessionId); + var hasUserStatus = + document.RootElement.ValueKind == JsonValueKind.Object && + document.RootElement.TryGetProperty("snapshot", out var snapshot) && + snapshot.ValueKind == JsonValueKind.Object && + snapshot.TryGetProperty("identity", out var identity) && + identity.ValueKind == JsonValueKind.Object && + identity.TryGetProperty("userStatus", out var status) && + status.ValueKind != JsonValueKind.Null && + status.ValueKind != JsonValueKind.Undefined; + + if (!hasUserStatus || + dto.Snapshot?.Identity is null || + !Enum.IsDefined(dto.Snapshot.Identity.UserStatus) || + dto.Snapshot.Identity.Tenant != context.Tenant) + { + return Invalid(); + } } - } - return SessionValidationMapper.ToDomain(dto, context.SessionId); + return SessionValidationMapper.ToDomain( + dto, + context.SessionId); + } + catch (HttpRequestException) + { + return Invalid(); + } + catch (OperationCanceledException) + when (!ct.IsCancellationRequested) + { + return Invalid(); + } + catch (JsonException) + { + return Invalid(); + } } } diff --git a/src/CodeBeam.UltimateAuth.Server/Security/UAuthAntiforgeryEndpoint.cs b/src/CodeBeam.UltimateAuth.Server/Security/UAuthAntiforgeryEndpoint.cs index 380bb729..2fec2cf4 100644 --- a/src/CodeBeam.UltimateAuth.Server/Security/UAuthAntiforgeryEndpoint.cs +++ b/src/CodeBeam.UltimateAuth.Server/Security/UAuthAntiforgeryEndpoint.cs @@ -1,17 +1,32 @@ -using Microsoft.AspNetCore.Antiforgery; +using CodeBeam.UltimateAuth.Core.Defaults; +using Microsoft.AspNetCore.Antiforgery; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; namespace CodeBeam.UltimateAuth.Server.Security; internal static class UAuthAntiforgeryEndpoint { - public static IResult GetToken(HttpContext context, IAntiforgery antiforgery) + public static async Task GetToken(HttpContext context, IAntiforgery antiforgery) { context.Response.Headers.CacheControl = "no-store, no-cache"; - context.Response.Headers.Pragma = "no-cache"; context.Response.Headers["X-Content-Type-Options"] = "nosniff"; + // Explicitly authenticate using UltimateAuth's own scheme. + // This ensures antiforgery uses the same principal as authenticated mutation endpoints. + var authentication = await context.AuthenticateAsync(UAuthConstants.SchemeDefaults.GlobalScheme); + + if (authentication.Succeeded && authentication.Principal is not null) + { + context.User = authentication.Principal; + } + else if (context.Request.Headers.ContainsKey("Authorization")) + { + // Never issue an anonymous antiforgery token when the caller supplied an invalid access credential. + return Results.Unauthorized(); + } + var tokens = antiforgery.GetAndStoreTokens(context); return Results.Ok(new diff --git a/src/client/CodeBeam.UltimateAuth.Client.Blazor/Components/UAuthLoginForm.razor.cs b/src/client/CodeBeam.UltimateAuth.Client.Blazor/Components/UAuthLoginForm.razor.cs index fc64ff5c..a046c0a3 100644 --- a/src/client/CodeBeam.UltimateAuth.Client.Blazor/Components/UAuthLoginForm.razor.cs +++ b/src/client/CodeBeam.UltimateAuth.Client.Blazor/Components/UAuthLoginForm.razor.cs @@ -1,4 +1,7 @@ -using CodeBeam.UltimateAuth.Client.Errors; +using CodeBeam.UltimateAuth.Client.Abstractions; +using CodeBeam.UltimateAuth.Client.Contracts; +using CodeBeam.UltimateAuth.Client.Errors; +using CodeBeam.UltimateAuth.Client.Events; using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; @@ -29,6 +32,12 @@ public partial class UAuthLoginForm [Inject] IDeviceIdProvider DeviceIdProvider { get; set; } = null!; + [Inject] + IUAuthTokenStore TokenStore { get; set; } = null!; + + [Inject] + IUAuthClientEvents ClientEvents { get; set; } = null!; + [Inject] IHubCredentialResolver HubCredentialResolver { get; set; } = null!; @@ -71,6 +80,13 @@ public partial class UAuthLoginForm [Parameter] public UAuthSubmitMode SubmitMode { get; set; } = UAuthSubmitMode.TryAndCommit; + /// + /// Controls login submission transport. + /// Auto uses effective server delivery configuration. + /// + [Parameter] + public UAuthLoginTransport Transport { get; set; } = UAuthLoginTransport.Auto; + /// /// Gets or sets custom form content. /// When omitted, a complete login form is rendered automatically. @@ -124,11 +140,9 @@ protected override async Task OnParametersSetAsync() { await base.OnParametersSetAsync(); - if (LoginType == UAuthLoginType.Pkce && - !HubCapabilities.SupportsPkce) + if (LoginType == UAuthLoginType.Pkce && !HubCapabilities.SupportsPkce) { - throw new InvalidOperationException( - "PKCE login requires UAuthHub (Blazor Server)."); + throw new InvalidOperationException("PKCE login requires UAuthHub (Blazor Server)."); } await ReloadCredentialsAsync(); @@ -147,22 +161,18 @@ protected override async Task OnAfterRenderAsync(bool firstRender) protected async Task ReloadCredentialsAsync() { - if (LoginType != UAuthLoginType.Pkce || - EffectiveHubSessionId is null) + if (LoginType != UAuthLoginType.Pkce || EffectiveHubSessionId is null) return; - _credentials = await HubCredentialResolver.ResolveAsync( - EffectiveHubSessionId.Value); + _credentials = await HubCredentialResolver.ResolveAsync(EffectiveHubSessionId.Value); } protected async Task ReloadStateAsync() { - if (LoginType != UAuthLoginType.Pkce || - EffectiveHubSessionId is null) + if (LoginType != UAuthLoginType.Pkce || EffectiveHubSessionId is null) return; - _flow = await HubFlowReader.GetStateAsync( - EffectiveHubSessionId.Value); + _flow = await HubFlowReader.GetStateAsync(EffectiveHubSessionId.Value); } /// @@ -218,9 +228,81 @@ public async Task SubmitAsync() commitUrl = ResolvedCommitEndpoint, applicationProfile = ApplicationProfileValue, trustedOrigin = TrustedOrigin, + transport = Transport.ToString(), + transportUrl = BuildEndpoint(Options.Value.Endpoints.LoginTransport), + returnUrl = EffectiveReturnUrl, isPkce = LoginType == UAuthLoginType.Pkce }); + if (result.ValueKind == JsonValueKind.Object && result.TryGetProperty("commit", out var commitElement)) + { + var transportResponse = + commitElement.Deserialize(new JsonSerializerOptions(JsonSerializerDefaults.Web)) + ?? throw new UAuthProtocolException("Invalid login commit response."); + + var accessTokenRequired = result.TryGetProperty("accessTokenInHeader", out var required) && + required.ValueKind == JsonValueKind.True; + + var redirectUrl = + UAuthLoginCompletion.GetRedirectUrl(transportResponse); + + var isHubHandoff = + LoginType == UAuthLoginType.Pkce && + EffectiveHubSessionId is not null; + + if (isHubHandoff) + { + if (!transportResponse.Ok || + transportResponse.Status is < 200 or >= 300) + { + throw new UAuthProtocolException( + "PKCE completion failed."); + } + + var expectedReturnUrl = _flow?.ReturnUrl; + + if (string.IsNullOrWhiteSpace(redirectUrl) || + string.IsNullOrWhiteSpace(expectedReturnUrl) || + !Uri.TryCreate(redirectUrl, UriKind.Absolute, out var target) || + !Uri.TryCreate(expectedReturnUrl, UriKind.Absolute, out var expected) || + target != expected || + target.Scheme is not ("https" or "http") || + !string.IsNullOrEmpty(target.UserInfo)) + { + throw new UAuthProtocolException( + "Invalid PKCE handoff redirect."); + } + + // The issued credentials belong to the initiating application. + // Do not store them in the Hub's local authentication state. + Navigation.NavigateTo(target.AbsoluteUri, forceLoad: true); + + return; + } + + await UAuthLoginCompletion.CompleteAsync( + transportResponse, + accessTokenRequired, + TokenStore, + ClientEvents); + + if (!string.IsNullOrWhiteSpace(redirectUrl)) + { + var target = Navigation.ToAbsoluteUri(redirectUrl); + var current = new Uri(Navigation.Uri); + + if (target.Scheme != current.Scheme || + target.Authority != current.Authority || + !string.IsNullOrEmpty(target.UserInfo)) + { + throw new UAuthProtocolException( + "Fetch login redirect must remain on the application origin."); + } + + Navigation.NavigateTo(target.ToString(), forceLoad: false); + } + } + if (SubmitMode == UAuthSubmitMode.DirectCommit) return; @@ -237,8 +319,7 @@ public async Task SubmitAsync() ? retry.GetString() : null; - var delay = UAuthRateLimit.ParseRetryAfter( - retryAfter, DateTimeOffset.UtcNow); + var delay = UAuthRateLimit.ParseRetryAfter(retryAfter, DateTimeOffset.UtcNow); parsed = LoginType == UAuthLoginType.Pkce ? new TryPkceLoginResult @@ -256,8 +337,7 @@ public async Task SubmitAsync() } else { - var options = new JsonSerializerOptions( - JsonSerializerDefaults.Web); + var options = new JsonSerializerOptions(JsonSerializerDefaults.Web); parsed = LoginType == UAuthLoginType.Pkce ? result.Deserialize(options) diff --git a/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthRequestClient.cs b/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthRequestClient.cs index 5d60478a..cf1e9cf7 100644 --- a/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthRequestClient.cs +++ b/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthRequestClient.cs @@ -1,11 +1,11 @@ -using CodeBeam.UltimateAuth.Client.Contracts; +using CodeBeam.UltimateAuth.Client.Abstractions; +using CodeBeam.UltimateAuth.Client.Contracts; using CodeBeam.UltimateAuth.Client.Errors; using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; -using CodeBeam.UltimateAuth.Core.Contracts; +using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Options; using Microsoft.JSInterop; -using System.Net; using System.Text.Json; // TODO: Add fluent helper API like RequiredOk @@ -14,14 +14,23 @@ namespace CodeBeam.UltimateAuth.Client.Blazor.Infrastructure; internal sealed class UAuthRequestClient : IUAuthRequestClient { private readonly IJSRuntime _js; - IUAuthClientBootstrapper _bootstrapper; - private UAuthClientOptions _options; - - public UAuthRequestClient(IJSRuntime js, IUAuthClientBootstrapper bootstrapper, IOptions options) + private readonly IUAuthClientBootstrapper _bootstrapper; + private readonly IUAuthTokenStore _tokenStore; + private readonly UAuthClientOptions _options; + private readonly NavigationManager _navigation; + + public UAuthRequestClient( + IJSRuntime js, + IUAuthClientBootstrapper bootstrapper, + IOptions options, + IUAuthTokenStore tokenStore, + NavigationManager navigation) { _js = js; _bootstrapper = bootstrapper; _options = options.Value; + _tokenStore = tokenStore; + _navigation = navigation; } public async Task NavigateAsync(string endpoint, IDictionary? form = null, CancellationToken ct = default) @@ -40,30 +49,34 @@ public async Task NavigateAsync(string endpoint, IDictionary? fo }); } - public async Task SendFormAsync(string endpoint, IDictionary? form = null, CancellationToken ct = default) + public Task SendFormAsync(string endpoint, IDictionary? form = null, CancellationToken ct = default) + => SendFormAsync(endpoint, form, accessToken: null, ct); + + public async Task SendFormAsync(string endpoint, IDictionary? form, string? accessToken, CancellationToken ct = default) { ct.ThrowIfCancellationRequested(); await _bootstrapper.EnsureStartedAsync(); - var result = await _js.InvokeAsync("uauth.post", ct, new - { - url = endpoint, - mode = "fetch", - data = form, - applicationProfile = _options.ApplicationProfile.ToString(), - trustedOrigin = ResolveTrustedOrigin() - }); + var result = await _js.InvokeAsync( + "uauth.post", + ct, + new + { + url = endpoint, + mode = "fetch", + data = form, + accessToken, + applicationProfile = _options.ApplicationProfile.ToString(), + trustedOrigin = ResolveTrustedOrigin() + }); - if (result == null) + if (result is null) throw new UAuthProtocolException("Invalid error response format."); if (result.Status == 0) throw new UAuthTransportException("Network error."); - //if (result.Status >= 500) - // throw new UAuthTransportException($"Server error {result.Status}", (HttpStatusCode)result.Status); - return result; } @@ -98,15 +111,19 @@ public async Task SendJsonAsync(string endpoint, object? p await _bootstrapper.EnsureStartedAsync(); - var result = await _js.InvokeAsync("uauth.postJson", ct, new - { - url = endpoint, - payload = payload, - applicationProfile = _options.ApplicationProfile.ToString(), - trustedOrigin = ResolveTrustedOrigin() - }); + var result = await _js.InvokeAsync( + "uauth.postJson", + ct, + new + { + url = endpoint, + payload, + accessToken = GetAccessToken(), + applicationProfile = _options.ApplicationProfile.ToString(), + trustedOrigin = ResolveTrustedOrigin() + }); - if (result == null) + if (result is null) throw new UAuthProtocolException("Invalid error response format."); if (result.Status == 0) @@ -146,6 +163,104 @@ public async Task TryAndCommitAsync(string tryEndpoint, catch (JsonException ex) { throw new UAuthProtocolException("Invalid tryAndCommit response.", ex); } } + public async Task GetLoginTransportAsync(string endpoint, CancellationToken ct = default) + { + ct.ThrowIfCancellationRequested(); + + await _bootstrapper.EnsureStartedAsync(ct); + + var response = await _js.InvokeAsync( + "uauth.getLoginTransport", + ct, + new + { + url = endpoint, + applicationProfile = _options.ApplicationProfile.ToString(), + trustedOrigin = ResolveTrustedOrigin() + }); + + if (response is null || !response.Ok || response.Body is null) + { + throw new UAuthProtocolException("Unable to resolve effective login transport."); + } + + return response.Body.Value.Deserialize(new JsonSerializerOptions(JsonSerializerDefaults.Web)) + ?? throw new UAuthProtocolException("Invalid login transport response."); + } + + public Task NavigateToUrlAsync(string url, CancellationToken ct = default) + { + ct.ThrowIfCancellationRequested(); + + if (string.IsNullOrWhiteSpace(url)) + throw new ArgumentException("Navigation URL is required.", nameof(url)); + + if (url.StartsWith("//", StringComparison.Ordinal) || url.StartsWith(@"\\", StringComparison.Ordinal)) + { + throw new UAuthProtocolException("Invalid login redirect URL."); + } + + var target = _navigation.ToAbsoluteUri(url); + var current = new Uri(_navigation.Uri); + + if (target.Scheme != current.Scheme || target.Authority != current.Authority || + !string.IsNullOrEmpty(target.UserInfo)) + { + throw new UAuthProtocolException("Fetch login navigation must remain on the application origin."); + } + + // Keep the Blazor Server circuit and its scoped token store. + _navigation.NavigateTo(target.ToString(), forceLoad: false); + + return Task.CompletedTask; + } + + public Task NavigateToPkceReturnUrlAsync(string redirectUrl, string expectedReturnUrl, CancellationToken ct = default) + { + ct.ThrowIfCancellationRequested(); + + if (!Uri.TryCreate( + expectedReturnUrl, + UriKind.Absolute, + out var expected) || + !Uri.TryCreate( + redirectUrl, + UriKind.Absolute, + out var target) || + target != expected || + target.Scheme is not ("https" or "http") || + !string.IsNullOrEmpty(target.UserInfo)) + { + throw new UAuthProtocolException("PKCE return URL is invalid or does not match the expected destination."); + } + + var current = new Uri(_navigation.Uri); + + var crossOrigin = + target.Scheme != current.Scheme || + target.Authority != current.Authority; + + _navigation.NavigateTo(target.ToString(), forceLoad: crossOrigin); + + return Task.CompletedTask; + } + + + private string? GetAccessToken() + { + var token = _tokenStore.Read(); + + if (token is null) + return null; + + if (token.IsExpired(DateTimeOffset.UtcNow)) + { + _tokenStore.Clear(); + return null; + } + + return token.Token; + } private string? ResolveTrustedOrigin() { diff --git a/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthResourceRequestClient.cs b/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthResourceRequestClient.cs index 1c47da11..ddb22b6a 100644 --- a/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthResourceRequestClient.cs +++ b/src/client/CodeBeam.UltimateAuth.Client.Blazor/Infrastructure/UAuthResourceRequestClient.cs @@ -1,4 +1,5 @@ -using CodeBeam.UltimateAuth.Client.Contracts; +using CodeBeam.UltimateAuth.Client.Abstractions; +using CodeBeam.UltimateAuth.Client.Contracts; using CodeBeam.UltimateAuth.Client.Errors; using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; @@ -11,12 +12,14 @@ internal sealed class UAuthResourceRequestClient : IUAuthResourceRequestClient { private readonly IJSRuntime _js; private readonly IUAuthClientBootstrapper _bootstrapper; + private readonly IUAuthTokenStore _tokenStore; private readonly UAuthClientOptions _options; - public UAuthResourceRequestClient(IJSRuntime js, IUAuthClientBootstrapper bootstrapper, IOptions options) + public UAuthResourceRequestClient(IJSRuntime js, IUAuthClientBootstrapper bootstrapper, IUAuthTokenStore tokenStore, IOptions options) { _js = js; _bootstrapper = bootstrapper; + _tokenStore = tokenStore; _options = options.Value; } @@ -37,6 +40,14 @@ public async Task SendAsync(string method, string try { + var accessToken = _tokenStore.Read(); + + if (accessToken is not null && accessToken.IsExpired(DateTimeOffset.UtcNow)) + { + _tokenStore.Clear(); + accessToken = null; + } + var result = await _js.InvokeAsync("uauth.resourceRequest", ct, new { @@ -46,6 +57,7 @@ public async Task SendAsync(string method, string payload, applicationProfile = _options.ApplicationProfile.ToString(), credentials = _options.Resource.Credentials.ToString(), + accessToken = accessToken?.Token, requestId }); diff --git a/src/client/CodeBeam.UltimateAuth.Client.Blazor/TScripts/uauth.js b/src/client/CodeBeam.UltimateAuth.Client.Blazor/TScripts/uauth.js index f25fe597..56a8700d 100644 --- a/src/client/CodeBeam.UltimateAuth.Client.Blazor/TScripts/uauth.js +++ b/src/client/CodeBeam.UltimateAuth.Client.Blazor/TScripts/uauth.js @@ -195,7 +195,8 @@ window.uauth.post = async function (options) { mode, data, applicationProfile, - trustedOrigin + trustedOrigin, + accessToken = null } = options; const validatedUrl = window.uauth.validateAuthUrl( @@ -255,6 +256,7 @@ window.uauth.post = async function (options) { allowCrossOriginCredentials: true, antiforgery: true, trustedOrigin, + accessToken, navigateOnSuccess: mode === "logout", headers: isLogout ? { "X-UAuth-Logout-Mode": "observe" } @@ -274,6 +276,7 @@ window.uauth.postJson = function (options) { payload: options.payload, applicationProfile: options.applicationProfile, contentType: "json", + accessToken: options.accessToken ?? null, credentials: "include", allowCrossOriginCredentials: true, antiforgery: true, @@ -291,6 +294,7 @@ window.uauth.request = async function (options) { applicationProfile = "", contentType = "json", credentials = "same-origin", + accessToken = null, headers: customHeaders = {} } = options; @@ -331,6 +335,31 @@ window.uauth.request = async function (options) { "X-Requested-With": "UAuth" }; + if (accessToken !== null) { + if (typeof accessToken !== "string" || + accessToken.length === 0 || + /[\r\n]/.test(accessToken)) { + throw new Error("Invalid authentication access token."); + } + + if (requestUrl.protocol !== "https:" && + !["localhost", "127.0.0.1", "[::1]"].includes(requestUrl.hostname)) { + throw new Error("Bearer access token requests require HTTPS."); + } + + // Only send the credential to the validated authentication origin. + const trustedUrl = window.uauth.validateAuthUrl( + requestUrl.href, + options.trustedOrigin + ); + + if (new URL(trustedUrl).origin !== requestUrl.origin) { + throw new Error("Invalid authentication token destination."); + } + + headers["Authorization"] = `Bearer ${accessToken}`; + } + let body = null; if (payload !== null && payload !== undefined) { @@ -366,7 +395,7 @@ window.uauth.request = async function (options) { throw new Error("UAuth antiforgery token origin differs from request origin."); } - const token = await window.uauth.antiforgery.getToken(options.trustedOrigin); + const token = await window.uauth.antiforgery.getToken(options.trustedOrigin, accessToken, applicationProfile); headers[token.headerName] = token.requestToken; } @@ -425,11 +454,33 @@ window.uauth.request = async function (options) { } } + const accessTokenHeader = response.headers.get("X-UAuth-Access-Header"); + + let responseAccessToken = null; + let accessTokenExpiresAt = null; + let accessTokenFormat = null; + let accessTokenHeaderFormat = null; + + if (response.ok && accessTokenHeader) { + if (!/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/.test(accessTokenHeader)) { + throw new Error("Invalid access token header name."); + } + + responseAccessToken = response.headers.get(accessTokenHeader); + accessTokenExpiresAt = response.headers.get("X-UAuth-Access-Expires"); + accessTokenFormat = response.headers.get("X-UAuth-Access-Format"); + accessTokenHeaderFormat = response.headers.get("X-UAuth-Access-HeaderFormat"); + } + return { retryAfter: response.headers.get("Retry-After"), ok: response.ok, status: response.status, refreshOutcome: response.headers.get("X-UAuth-Refresh"), + accessToken: responseAccessToken, + accessTokenExpiresAt, + accessTokenFormat, + accessTokenHeaderFormat, body: responseBody }; }; @@ -442,6 +493,7 @@ window.uauth.resourceRequest = async function (options) { payload = null, applicationProfile = "", credentials = "Auto", + accessToken = null, requestId } = options; @@ -529,6 +581,21 @@ window.uauth.resourceRequest = async function (options) { "X-Requested-With": "UAuth" }; + if (accessToken !== null) { + if (typeof accessToken !== "string" || + accessToken.length === 0 || + /[\r\n]/.test(accessToken)) { + throw new Error("Invalid Resource API access token."); + } + + if (requestUrl.protocol !== "https:" && + !["localhost", "127.0.0.1", "[::1]"].includes(requestUrl.hostname)) { + throw new Error("Bearer access token requests require HTTPS."); + } + + headers["Authorization"] = `Bearer ${accessToken}`; + } + let body = null; if (payload !== null && payload !== undefined) { @@ -646,6 +713,59 @@ window.uauth.validateAuthUrl = function (url, trustedOrigin = null) { return target.href; }; +window.uauth.commitLoginForm = async function ( + form, + commitUrl, + applicationProfile, + trustedOrigin +) { + const fields = new FormData(form); + const payload = Object.create(null); + + for (const [key, value] of fields.entries()) { + if (typeof value !== "string") { + throw new Error("File values are not supported in login forms."); + } + + if (Object.hasOwn(payload, key)) { + throw new Error(`Duplicate login form field: ${key}.`); + } + + payload[key] = value; + } + + if (Object.hasOwn(payload, "__uauth_response_mode")) { + throw new Error("Reserved UAuth form field."); + } + + payload.__uauth_response_mode = "fetch"; + + return window.uauth.post({ + url: commitUrl, + mode: "fetch", + data: payload, + applicationProfile, + trustedOrigin + }); +}; + +window.uauth.getLoginTransport = function (options) { + const url = window.uauth.validateAuthUrl( + options.url, + options.trustedOrigin + ); + + return window.uauth.request({ + url, + method: "GET", + applicationProfile: options.applicationProfile, + credentials: "include", + allowCrossOriginCredentials: true, + antiforgery: false, + trustedOrigin: options.trustedOrigin + }); +}; + window.uauth.antiforgery = { tokenUrl: null, @@ -660,7 +780,7 @@ window.uauth.antiforgery = { ); }, - getToken: async function (trustedOrigin) { + getToken: async function (trustedOrigin, accessToken = null, applicationProfile = "") { if (!this.tokenUrl) { throw new Error("UAuth antiforgery is not configured."); } @@ -670,18 +790,40 @@ window.uauth.antiforgery = { trustedOrigin ); + const headers = { + "X-UDID": window.uauth.deviceId, + "X-UAuth-ApplicationProfile": applicationProfile + }; + + if (accessToken !== null) { + if (typeof accessToken !== "string" || + accessToken.length === 0 || + /[\r\n]/.test(accessToken)) { + throw new Error("Invalid UAuth access token."); + } + + const target = new URL(url); + + if (target.protocol !== "https:" && + !["localhost", "127.0.0.1", "[::1]"].includes(target.hostname)) { + throw new Error("Bearer access token requests require HTTPS."); + } + + headers["Authorization"] = `Bearer ${accessToken}`; + } + const response = await fetch(url, { method: "GET", credentials: "include", cache: "no-store", redirect: "error", - headers: { - "X-UDID": window.uauth.deviceId - } + headers }); if (!response.ok) { - throw new Error(`Unable to obtain UAuth antiforgery token: HTTP ${response.status}.`); + throw new Error( + `Unable to obtain UAuth antiforgery token: HTTP ${response.status}.` + ); } const token = await response.json(); @@ -723,7 +865,10 @@ window.uauth.submitLoginForm = async function (form, options) { commitUrl, applicationProfile, trustedOrigin, - isPkce + isPkce, + transport = "Auto", + transportUrl, + returnUrl } = options; if (!["TryOnly", "TryAndCommit", "DirectCommit"].includes(mode)) { @@ -795,9 +940,62 @@ window.uauth.submitLoginForm = async function (form, options) { form.action = validatedCommitUrl; } + const commit = async () => { + if (!["Auto", "Fetch", "Navigation"].includes(transport)) { + throw new Error("Unsupported login transport."); + } + + const capabilitiesResponse = await window.uauth.getLoginTransport({ + url: transportUrl, + applicationProfile, + trustedOrigin + }); + + if (!capabilitiesResponse?.ok || + !capabilitiesResponse.body?.supported) { + throw new Error("Login transport is unavailable or unsupported."); + } + + const info = capabilitiesResponse.body; + + const selected = transport === "Auto" + ? info.navigationSupported && Boolean(returnUrl) + ? "Navigation" + : "Fetch" + : transport; + + if (selected === "Navigation") { + if (!info.navigationSupported) { + throw new Error( + "Navigation is incompatible with header-based credential delivery." + ); + } + + await window.uauth.submitForm(form, trustedOrigin); + return null; + } + + const response = await window.uauth.commitLoginForm( + form, + form.action, + applicationProfile, + trustedOrigin + ); + + if (!response?.ok) { + throw new Error( + `Login commit failed: HTTP ${response?.status ?? 0}.` + ); + } + + return { + commit: response, + accessTokenInHeader: info.accessTokenInHeader + }; + }; + if (mode === "DirectCommit") { - await window.uauth.submitForm(form, trustedOrigin); - return null; + return await commit(); } const payload = { @@ -876,7 +1074,14 @@ window.uauth.submitLoginForm = async function (form, options) { receipt.value = result.previewReceipt; } - await window.uauth.submitForm(form, trustedOrigin); + const completion = await commit(); + + if (completion) { + return { + ...result, + ...completion + }; + } } // Only the non-credential authentication result crosses JS interop. diff --git a/src/client/CodeBeam.UltimateAuth.Client.Blazor/wwwroot/uauth.min.js b/src/client/CodeBeam.UltimateAuth.Client.Blazor/wwwroot/uauth.min.js index 145fa18e..4390e819 100644 --- a/src/client/CodeBeam.UltimateAuth.Client.Blazor/wwwroot/uauth.min.js +++ b/src/client/CodeBeam.UltimateAuth.Client.Blazor/wwwroot/uauth.min.js @@ -1 +1 @@ -window.uauth=window.uauth||{};window.uauth.storage={set:function(n,t,i){const r=n==="local"?window.localStorage:window.sessionStorage;r.setItem(t,i)},get:function(n,t){const i=n==="local"?window.localStorage:window.sessionStorage;return i.getItem(t)},remove:function(n,t){const i=n==="local"?window.localStorage:window.sessionStorage;i.removeItem(t)},exists:function(n,t){const i=n==="local"?window.localStorage:window.sessionStorage;return i.getItem(t)!==null}};window.uauth.submitForm=async function(n,t=null){if(!n)return;if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const r=window.uauth.validateAuthUrl(n.action,t);n.action=r;let i=n.querySelector("input[name='__uauth_device']");i||(i=document.createElement("input"),i.type="hidden",i.name="__uauth_device",n.appendChild(i));i.value=window.uauth.deviceId;await window.uauth.antiforgery.appendToForm(n,t);n.submit()};window.uauth.tryAndCommit=async function(n){const{tryUrl:c,commitUrl:l,data:e,applicationProfile:o,trustedOrigin:u}=n,a=window.uauth.validateAuthUrl(c,u),v=window.uauth.validateAuthUrl(l,u),s=window.uauth.deviceId;if(!s)throw new Error("UAuth deviceId is not initialized.");const r=await window.uauth.postJson({url:a,payload:e,applicationProfile:o,trustedOrigin:u});if(!r||!Number.isInteger(r.status))throw new Error("Invalid UAuth transport response.");const i=r.status;if(i===429)return{isSuccess:!1,status:429,errorCode:"rate_limited",retryAfter:r.retryAfter??null};const y=i>=200&&i<300,h=i>=400&&i<500;if(!y&&!h)throw new Error(`Unexpected UAuth try response: HTTP ${i}.`);const t=r.body;if(!t||typeof t!="object"||Array.isArray(t)||typeof t.isSuccess!="boolean")throw new Error("Invalid UAuth try response body.");if(h&&t.isSuccess)throw new Error("Successful authentication result returned with HTTP error.");const f={isSuccess:t.isSuccess,reason:t.reason??null,remainingAttempts:t.remainingAttempts??null,lockoutUntilUtc:t.lockoutUntilUtc??null,requiresMfa:t.requiresMfa??!1,retryWithNewPkce:t.retryWithNewPkce??!1,previewReceipt:t.previewReceipt??null};if(f.isSuccess){const n=document.createElement("form");n.method="POST";n.action=v;for(const t of Object.keys(e)){const i=document.createElement("input");i.type="hidden";i.name=t;i.value=e[t]??"";n.appendChild(i)}if(f.previewReceipt){const t=document.createElement("input");t.type="hidden";t.name="PreviewReceipt";t.value=f.previewReceipt;n.appendChild(t)}const t=document.createElement("input");t.type="hidden";t.name="__uauth_application_profile";t.value=o??"";n.appendChild(t);const i=document.createElement("input");i.type="hidden";i.name="__uauth_device";i.value=s;n.appendChild(i);document.body.appendChild(n);try{await window.uauth.submitForm(n,u)}catch(r){n.remove();throw r;}}return f};window.uauth.post=async function(n){const{url:e,mode:t,data:i,applicationProfile:u,trustedOrigin:r}=n,f=window.uauth.validateAuthUrl(e,r);if(t==="navigate"){const n=document.createElement("form");n.method="POST";n.action=f;const t=document.createElement("input");t.type="hidden";t.name="__uauth_application_profile";t.value=u??"";n.appendChild(t);const e=document.createElement("input");if(e.type="hidden",e.name="__uauth_device",e.value=window.uauth.deviceId,n.appendChild(e),i)for(const t in i){const r=document.createElement("input");r.type="hidden";r.name=t;r.value=i[t];n.appendChild(r)}document.body.appendChild(n);try{await window.uauth.submitForm(n,r)}catch(o){n.remove();throw o;}return null}const o=t==="logout"||t==="logout-observe";return window.uauth.request({url:f,method:"POST",payload:i,applicationProfile:u,contentType:"form",credentials:"include",allowCrossOriginCredentials:!0,antiforgery:!0,trustedOrigin:r,navigateOnSuccess:t==="logout",headers:o?{"X-UAuth-Logout-Mode":"observe"}:{}})};window.uauth.postJson=function(n){const t=window.uauth.validateAuthUrl(n.url,n.trustedOrigin);return window.uauth.request({url:t,method:"POST",payload:n.payload,applicationProfile:n.applicationProfile,contentType:"json",credentials:"include",allowCrossOriginCredentials:!0,antiforgery:!0,trustedOrigin:n.trustedOrigin})};window.uauth.request=async function(n){const{followRedirects:a=!1,navigateOnSuccess:v=!1,url:h,method:y="GET",payload:r=null,applicationProfile:p="",contentType:c="json",credentials:s="same-origin",headers:w={}}=n;if(!h)throw new Error("Request URL is required.");const u=new URL(h,document.baseURI);if(!["http:","https:"].includes(u.protocol))throw new Error("Unsupported request URL protocol.");const i=y.toUpperCase();if(!["GET","POST","PUT","PATCH","DELETE"].includes(i))throw new Error(`Unsupported HTTP method: ${i}`);if(!["same-origin","include","omit"].includes(s))throw new Error("Invalid credentials policy.");if(s==="include"&&u.origin!==window.location.origin&&!n.allowCrossOriginCredentials)throw new Error("Cross-origin credentials require explicit authorization.");if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const f={...w,"X-UDID":window.uauth.deviceId,"X-UAuth-ApplicationProfile":p,"X-Requested-With":"UAuth"};let e=null;if(r!==null&&r!==undefined){if(i==="GET")throw new Error("GET requests cannot contain a body.");if(c==="json")f["Content-Type"]="application/json",e=JSON.stringify(r);else if(c==="form"){f["Content-Type"]="application/x-www-form-urlencoded";e=new URLSearchParams;for(const[n,t]of Object.entries(r))e.append(n,t??"")}else throw new Error("Unsupported content type.");}if(i!=="GET"&&n.antiforgery===!0){const i=window.uauth.validateAuthUrl(window.uauth.antiforgery.tokenUrl,n.trustedOrigin);if(new URL(i).origin!==u.origin)throw new Error("UAuth antiforgery token origin differs from request origin.");const t=await window.uauth.antiforgery.getToken(n.trustedOrigin);f[t.headerName]=t.requestToken}let t;try{t=await fetch(u.href,{method:i,credentials:s,redirect:a?"follow":"error",headers:f,body:e})}catch(l){if(l instanceof TypeError)return{ok:!1,status:0,refreshOutcome:null,body:null};throw l;}let o=null;if(t.status!==204&&t.status!==205){const n=await t.text();if(n)try{o=JSON.parse(n)}catch{o=n}}if(v&&t.ok){const n=o?.redirectUrl;if(typeof n=="string"&&n.length>0){const t=new URL(n,window.location.origin);if(!["http:","https:"].includes(t.protocol))throw new Error("Invalid logout redirect protocol.");window.location.assign(t.href)}}return{retryAfter:t.headers.get("Retry-After"),ok:t.ok,status:t.status,refreshOutcome:t.headers.get("X-UAuth-Refresh"),body:o}};window.uauth.resourceRequest=async function(n){const{url:o,baseAddress:h,method:v="GET",payload:f=null,applicationProfile:y="",credentials:p="Auto",requestId:u}=n;if(!o||typeof o!="string")throw new Error("Resource request URL is required.");const i=h?new URL(h):new URL(window.location.origin+"/");if(!["http:","https:"].includes(i.protocol))throw new Error("Invalid Resource API protocol.");if(i.username||i.password||i.search||i.hash)throw new Error("Invalid Resource API base address.");const t=new URL(o,i);if(t.origin!==i.origin)throw new Error("Resource request target differs from configured API origin.");if(t.username||t.password)throw new Error("Resource URL cannot contain credentials.");if(!["http:","https:"].includes(t.protocol))throw new Error("Unsupported Resource API protocol.");const s=v.toUpperCase();if(!["GET","POST","PUT","PATCH","DELETE"].includes(s))throw new Error("Unsupported Resource API method.");if(s==="GET"&&f!==null)throw new Error("GET requests cannot contain a body.");let r;switch(p.toLowerCase()){case"auto":r=t.origin===window.location.origin?"same-origin":"include";break;case"sameorigin":r="same-origin";break;case"include":r="include";break;case"omit":r="omit";break;default:throw new Error("Invalid Resource credentials mode.");}if(r==="include"&&t.protocol!=="https:"&&!["localhost","127.0.0.1","[::1]"].includes(t.hostname))throw new Error("Cross-origin credential requests require HTTPS.");if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const c={"X-UDID":window.uauth.deviceId,"X-UAuth-ApplicationProfile":y,"X-Requested-With":"UAuth"};let l=null;f!==null&&f!==undefined&&(c["Content-Type"]="application/json",l=JSON.stringify(f));const a=new AbortController;if(u){if(window.uauth.resourceRequests.has(u))throw new Error("Duplicate Resource request ID.");window.uauth.resourceRequests.set(u,a)}try{const n=await fetch(t.href,{method:s,credentials:r,redirect:"error",headers:c,body:l,signal:a.signal});let i=null;if(n.status!==204&&n.status!==205){const t=await n.text();t.length>0&&(i=t)}return{retryAfter:n.headers.get("Retry-After"),ok:n.ok,status:n.status,body:i,contentType:n.headers.get("Content-Type")}}catch(e){if(e?.name==="AbortError")throw e;if(e instanceof TypeError)return{ok:!1,status:0,body:null,contentType:null};throw e;}finally{u&&window.uauth.resourceRequests.delete(u)}};window.uauth.resourceRequests=new Map;window.uauth.cancelResourceRequest=function(n){const t=window.uauth.resourceRequests.get(n);return t?(t.abort(),!0):!1};window.uauth.validateAuthUrl=function(n,t=null){if(!n||typeof n!="string")throw new Error("Authentication URL is required.");const r=t?new URL(t,window.location.origin):new URL(window.location.origin),i=new URL(n,document.baseURI);if(!["http:","https:"].includes(r.protocol))throw new Error("Unsupported trusted origin protocol.");if(!["http:","https:"].includes(i.protocol))throw new Error("Unsupported authentication URL protocol.");if(r.username||r.password)throw new Error("Trusted origin cannot contain credentials.");if(i.username||i.password)throw new Error("Authentication URL cannot contain credentials.");if(i.origin!==r.origin)throw new Error("Authentication request target differs from the trusted UAuthHub origin.");return i.href};window.uauth.antiforgery={tokenUrl:null,configure:function(n){if(!n?.tokenUrl)throw new Error("UAuth antiforgery token URL is required.");this.tokenUrl=window.uauth.validateAuthUrl(n.tokenUrl,n.trustedOrigin)},getToken:async function(n){if(!this.tokenUrl)throw new Error("UAuth antiforgery is not configured.");const r=window.uauth.validateAuthUrl(this.tokenUrl,n),i=await fetch(r,{method:"GET",credentials:"include",cache:"no-store",redirect:"error",headers:{"X-UDID":window.uauth.deviceId}});if(!i.ok)throw new Error(`Unable to obtain UAuth antiforgery token: HTTP ${i.status}.`);const t=await i.json();if(!t?.requestToken||!t?.headerName||!t?.formFieldName)throw new Error("Invalid UAuth antiforgery response.");return t},appendToForm:async function(n,t){const r=await this.getToken(t);let i=Array.from(n.elements).find(n=>n.name===r.formFieldName);i||(i=document.createElement("input"),i.type="hidden",i.name=r.formFieldName,n.appendChild(i));i.value=r.requestToken}};window.uauth.submitLoginForm=async function(n,t){if(!(n instanceof HTMLFormElement))throw new Error("A native HTML form is required.");const{mode:o,tryUrl:p,commitUrl:w,applicationProfile:b,trustedOrigin:e,isPkce:s}=t;if(!["TryOnly","TryAndCommit","DirectCommit"].includes(o))throw new Error("Unsupported UAuth submit mode.");if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const l=window.uauth.validateAuthUrl(w,e),k=o==="DirectCommit"?null:window.uauth.validateAuthUrl(p,e),r=new FormData(n),a=r.getAll("Identifier"),v=r.getAll("Secret");if(a.length!==1||v.length!==1)throw new Error("Login form requires exactly one Identifier and one Secret.");const h=a[0],c=v[0];if(typeof h!="string"||typeof c!="string"||!h.trim()||!c.trim())throw new Error("Identifier and Secret are required.");if(s)for(const n of["authorization_code","code_verifier"]){const t=r.getAll(n);if(t.length!==1||typeof t[0]!="string"||!t[0])throw new Error(`Missing or duplicate PKCE field: ${n}`);}if(s){const t=r.get("hub_session_id");if(typeof t!="string"||!t)throw new Error("Missing PKCE Hub session ID.");const i=new URL(l);i.searchParams.set("uauth_hub",t);n.action=i.href}else n.action=l;if(o==="DirectCommit")return await window.uauth.submitForm(n,e),null;const f={Identifier:h,Secret:c};s?(f.authorization_code=r.get("authorization_code"),f.code_verifier=r.get("code_verifier"),f.__uauth_return_url=r.get("__uauth_return_url")??"",f.hub_session_id=r.get("hub_session_id")??""):f.ReturnUrl=r.get("__uauth_return_url")??"";const i=await window.uauth.postJson({url:k,payload:f,applicationProfile:b,trustedOrigin:e});if(!i||!Number.isInteger(i.status))throw new Error("Invalid UAuth transport response.");if(i.status===429)return{isSuccess:!1,status:429,errorCode:"rate_limited",retryAfter:i.retryAfter??null};const d=i.status>=200&&i.status<300,y=i.status>=400&&i.status<500;if(!d&&!y)throw new Error(`Unexpected UAuth try response: HTTP ${i.status}.`);const u=i.body;if(!u||typeof u!="object"||Array.isArray(u)||typeof u.isSuccess!="boolean")throw new Error("Invalid UAuth try response body.");if(y&&u.isSuccess)throw new Error("Successful authentication result returned with HTTP error.");if(o==="TryAndCommit"&&u.isSuccess){if(u.previewReceipt){let t=Array.from(n.elements).find(n=>n.name==="PreviewReceipt");t||(t=document.createElement("input"),t.type="hidden",t.name="PreviewReceipt",n.appendChild(t));t.value=u.previewReceipt}await window.uauth.submitForm(n,e)}return u};window.uauth.setDeviceId=function(n){window.uauth.deviceId=n};window.uauth.getDeviceInfo=function(){return{userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language}} \ No newline at end of file +window.uauth=window.uauth||{};window.uauth.storage={set:function(n,t,i){const r=n==="local"?window.localStorage:window.sessionStorage;r.setItem(t,i)},get:function(n,t){const i=n==="local"?window.localStorage:window.sessionStorage;return i.getItem(t)},remove:function(n,t){const i=n==="local"?window.localStorage:window.sessionStorage;i.removeItem(t)},exists:function(n,t){const i=n==="local"?window.localStorage:window.sessionStorage;return i.getItem(t)!==null}};window.uauth.submitForm=async function(n,t=null){if(!n)return;if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const r=window.uauth.validateAuthUrl(n.action,t);n.action=r;let i=n.querySelector("input[name='__uauth_device']");i||(i=document.createElement("input"),i.type="hidden",i.name="__uauth_device",n.appendChild(i));i.value=window.uauth.deviceId;await window.uauth.antiforgery.appendToForm(n,t);n.submit()};window.uauth.tryAndCommit=async function(n){const{tryUrl:c,commitUrl:l,data:e,applicationProfile:o,trustedOrigin:u}=n,a=window.uauth.validateAuthUrl(c,u),v=window.uauth.validateAuthUrl(l,u),s=window.uauth.deviceId;if(!s)throw new Error("UAuth deviceId is not initialized.");const r=await window.uauth.postJson({url:a,payload:e,applicationProfile:o,trustedOrigin:u});if(!r||!Number.isInteger(r.status))throw new Error("Invalid UAuth transport response.");const i=r.status;if(i===429)return{isSuccess:!1,status:429,errorCode:"rate_limited",retryAfter:r.retryAfter??null};const y=i>=200&&i<300,h=i>=400&&i<500;if(!y&&!h)throw new Error(`Unexpected UAuth try response: HTTP ${i}.`);const t=r.body;if(!t||typeof t!="object"||Array.isArray(t)||typeof t.isSuccess!="boolean")throw new Error("Invalid UAuth try response body.");if(h&&t.isSuccess)throw new Error("Successful authentication result returned with HTTP error.");const f={isSuccess:t.isSuccess,reason:t.reason??null,remainingAttempts:t.remainingAttempts??null,lockoutUntilUtc:t.lockoutUntilUtc??null,requiresMfa:t.requiresMfa??!1,retryWithNewPkce:t.retryWithNewPkce??!1,previewReceipt:t.previewReceipt??null};if(f.isSuccess){const n=document.createElement("form");n.method="POST";n.action=v;for(const t of Object.keys(e)){const i=document.createElement("input");i.type="hidden";i.name=t;i.value=e[t]??"";n.appendChild(i)}if(f.previewReceipt){const t=document.createElement("input");t.type="hidden";t.name="PreviewReceipt";t.value=f.previewReceipt;n.appendChild(t)}const t=document.createElement("input");t.type="hidden";t.name="__uauth_application_profile";t.value=o??"";n.appendChild(t);const i=document.createElement("input");i.type="hidden";i.name="__uauth_device";i.value=s;n.appendChild(i);document.body.appendChild(n);try{await window.uauth.submitForm(n,u)}catch(r){n.remove();throw r;}}return f};window.uauth.post=async function(n){const{url:e,mode:t,data:i,applicationProfile:u,trustedOrigin:r,accessToken:o=null}=n,f=window.uauth.validateAuthUrl(e,r);if(t==="navigate"){const n=document.createElement("form");n.method="POST";n.action=f;const t=document.createElement("input");t.type="hidden";t.name="__uauth_application_profile";t.value=u??"";n.appendChild(t);const e=document.createElement("input");if(e.type="hidden",e.name="__uauth_device",e.value=window.uauth.deviceId,n.appendChild(e),i)for(const t in i){const r=document.createElement("input");r.type="hidden";r.name=t;r.value=i[t];n.appendChild(r)}document.body.appendChild(n);try{await window.uauth.submitForm(n,r)}catch(o){n.remove();throw o;}return null}const s=t==="logout"||t==="logout-observe";return window.uauth.request({url:f,method:"POST",payload:i,applicationProfile:u,contentType:"form",credentials:"include",allowCrossOriginCredentials:!0,antiforgery:!0,trustedOrigin:r,accessToken:o,navigateOnSuccess:t==="logout",headers:s?{"X-UAuth-Logout-Mode":"observe"}:{}})};window.uauth.postJson=function(n){const t=window.uauth.validateAuthUrl(n.url,n.trustedOrigin);return window.uauth.request({url:t,method:"POST",payload:n.payload,applicationProfile:n.applicationProfile,contentType:"json",accessToken:n.accessToken??null,credentials:"include",allowCrossOriginCredentials:!0,antiforgery:!0,trustedOrigin:n.trustedOrigin})};window.uauth.request=async function(n){const{followRedirects:d=!1,navigateOnSuccess:g=!1,url:l,method:nt="GET",payload:e=null,applicationProfile:a="",contentType:v="json",credentials:h="same-origin",accessToken:r=null,headers:tt={}}=n;if(!l)throw new Error("Request URL is required.");const i=new URL(l,document.baseURI);if(!["http:","https:"].includes(i.protocol))throw new Error("Unsupported request URL protocol.");const u=nt.toUpperCase();if(!["GET","POST","PUT","PATCH","DELETE"].includes(u))throw new Error(`Unsupported HTTP method: ${u}`);if(!["same-origin","include","omit"].includes(h))throw new Error("Invalid credentials policy.");if(h==="include"&&i.origin!==window.location.origin&&!n.allowCrossOriginCredentials)throw new Error("Cross-origin credentials require explicit authorization.");if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const f={...tt,"X-UDID":window.uauth.deviceId,"X-UAuth-ApplicationProfile":a,"X-Requested-With":"UAuth"};if(r!==null){if(typeof r!="string"||r.length===0||/[\r\n]/.test(r))throw new Error("Invalid authentication access token.");if(i.protocol!=="https:"&&!["localhost","127.0.0.1","[::1]"].includes(i.hostname))throw new Error("Bearer access token requests require HTTPS.");const t=window.uauth.validateAuthUrl(i.href,n.trustedOrigin);if(new URL(t).origin!==i.origin)throw new Error("Invalid authentication token destination.");f.Authorization=`Bearer ${r}`}let o=null;if(e!==null&&e!==undefined){if(u==="GET")throw new Error("GET requests cannot contain a body.");if(v==="json")f["Content-Type"]="application/json",o=JSON.stringify(e);else if(v==="form"){f["Content-Type"]="application/x-www-form-urlencoded";o=new URLSearchParams;for(const[n,t]of Object.entries(e))o.append(n,t??"")}else throw new Error("Unsupported content type.");}if(u!=="GET"&&n.antiforgery===!0){const u=window.uauth.validateAuthUrl(window.uauth.antiforgery.tokenUrl,n.trustedOrigin);if(new URL(u).origin!==i.origin)throw new Error("UAuth antiforgery token origin differs from request origin.");const t=await window.uauth.antiforgery.getToken(n.trustedOrigin,r,a);f[t.headerName]=t.requestToken}let t;try{t=await fetch(i.href,{method:u,credentials:h,redirect:d?"follow":"error",headers:f,body:o})}catch(y){if(y instanceof TypeError)return{ok:!1,status:0,refreshOutcome:null,body:null};throw y;}let s=null;if(t.status!==204&&t.status!==205){const n=await t.text();if(n)try{s=JSON.parse(n)}catch{s=n}}if(g&&t.ok){const n=s?.redirectUrl;if(typeof n=="string"&&n.length>0){const t=new URL(n,window.location.origin);if(!["http:","https:"].includes(t.protocol))throw new Error("Invalid logout redirect protocol.");window.location.assign(t.href)}}const c=t.headers.get("X-UAuth-Access-Header");let p=null,w=null,b=null,k=null;if(t.ok&&c){if(!/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/.test(c))throw new Error("Invalid access token header name.");p=t.headers.get(c);w=t.headers.get("X-UAuth-Access-Expires");b=t.headers.get("X-UAuth-Access-Format");k=t.headers.get("X-UAuth-Access-HeaderFormat")}return{retryAfter:t.headers.get("Retry-After"),ok:t.ok,status:t.status,refreshOutcome:t.headers.get("X-UAuth-Refresh"),accessToken:p,accessTokenExpiresAt:w,accessTokenFormat:b,accessTokenHeaderFormat:k,body:s}};window.uauth.resourceRequest=async function(n){const{url:s,baseAddress:l,method:y="GET",payload:e=null,applicationProfile:p="",credentials:w="Auto",accessToken:u=null,requestId:f}=n;if(!s||typeof s!="string")throw new Error("Resource request URL is required.");const i=l?new URL(l):new URL(window.location.origin+"/");if(!["http:","https:"].includes(i.protocol))throw new Error("Invalid Resource API protocol.");if(i.username||i.password||i.search||i.hash)throw new Error("Invalid Resource API base address.");const t=new URL(s,i);if(t.origin!==i.origin)throw new Error("Resource request target differs from configured API origin.");if(t.username||t.password)throw new Error("Resource URL cannot contain credentials.");if(!["http:","https:"].includes(t.protocol))throw new Error("Unsupported Resource API protocol.");const h=y.toUpperCase();if(!["GET","POST","PUT","PATCH","DELETE"].includes(h))throw new Error("Unsupported Resource API method.");if(h==="GET"&&e!==null)throw new Error("GET requests cannot contain a body.");let r;switch(w.toLowerCase()){case"auto":r=t.origin===window.location.origin?"same-origin":"include";break;case"sameorigin":r="same-origin";break;case"include":r="include";break;case"omit":r="omit";break;default:throw new Error("Invalid Resource credentials mode.");}if(r==="include"&&t.protocol!=="https:"&&!["localhost","127.0.0.1","[::1]"].includes(t.hostname))throw new Error("Cross-origin credential requests require HTTPS.");if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const c={"X-UDID":window.uauth.deviceId,"X-UAuth-ApplicationProfile":p,"X-Requested-With":"UAuth"};if(u!==null){if(typeof u!="string"||u.length===0||/[\r\n]/.test(u))throw new Error("Invalid Resource API access token.");if(t.protocol!=="https:"&&!["localhost","127.0.0.1","[::1]"].includes(t.hostname))throw new Error("Bearer access token requests require HTTPS.");c.Authorization=`Bearer ${u}`}let a=null;e!==null&&e!==undefined&&(c["Content-Type"]="application/json",a=JSON.stringify(e));const v=new AbortController;if(f){if(window.uauth.resourceRequests.has(f))throw new Error("Duplicate Resource request ID.");window.uauth.resourceRequests.set(f,v)}try{const n=await fetch(t.href,{method:h,credentials:r,redirect:"error",headers:c,body:a,signal:v.signal});let i=null;if(n.status!==204&&n.status!==205){const t=await n.text();t.length>0&&(i=t)}return{retryAfter:n.headers.get("Retry-After"),ok:n.ok,status:n.status,body:i,contentType:n.headers.get("Content-Type")}}catch(o){if(o?.name==="AbortError")throw o;if(o instanceof TypeError)return{ok:!1,status:0,body:null,contentType:null};throw o;}finally{f&&window.uauth.resourceRequests.delete(f)}};window.uauth.resourceRequests=new Map;window.uauth.cancelResourceRequest=function(n){const t=window.uauth.resourceRequests.get(n);return t?(t.abort(),!0):!1};window.uauth.validateAuthUrl=function(n,t=null){if(!n||typeof n!="string")throw new Error("Authentication URL is required.");const r=t?new URL(t,window.location.origin):new URL(window.location.origin),i=new URL(n,document.baseURI);if(!["http:","https:"].includes(r.protocol))throw new Error("Unsupported trusted origin protocol.");if(!["http:","https:"].includes(i.protocol))throw new Error("Unsupported authentication URL protocol.");if(r.username||r.password)throw new Error("Trusted origin cannot contain credentials.");if(i.username||i.password)throw new Error("Authentication URL cannot contain credentials.");if(i.origin!==r.origin)throw new Error("Authentication request target differs from the trusted UAuthHub origin.");return i.href};window.uauth.commitLoginForm=async function(n,t,i,r){const f=new FormData(n),u=Object.create(null);for(const[n,t]of f.entries()){if(typeof t!="string")throw new Error("File values are not supported in login forms.");if(Object.hasOwn(u,n))throw new Error(`Duplicate login form field: ${n}.`);u[n]=t}if(Object.hasOwn(u,"__uauth_response_mode"))throw new Error("Reserved UAuth form field.");return u.__uauth_response_mode="fetch",window.uauth.post({url:t,mode:"fetch",data:u,applicationProfile:i,trustedOrigin:r})};window.uauth.getLoginTransport=function(n){const t=window.uauth.validateAuthUrl(n.url,n.trustedOrigin);return window.uauth.request({url:t,method:"GET",applicationProfile:n.applicationProfile,credentials:"include",allowCrossOriginCredentials:!0,antiforgery:!1,trustedOrigin:n.trustedOrigin})};window.uauth.antiforgery={tokenUrl:null,configure:function(n){if(!n?.tokenUrl)throw new Error("UAuth antiforgery token URL is required.");this.tokenUrl=window.uauth.validateAuthUrl(n.tokenUrl,n.trustedOrigin)},getToken:async function(n,t=null,i=""){if(!this.tokenUrl)throw new Error("UAuth antiforgery is not configured.");const f=window.uauth.validateAuthUrl(this.tokenUrl,n),e={"X-UDID":window.uauth.deviceId,"X-UAuth-ApplicationProfile":i};if(t!==null){if(typeof t!="string"||t.length===0||/[\r\n]/.test(t))throw new Error("Invalid UAuth access token.");const n=new URL(f);if(n.protocol!=="https:"&&!["localhost","127.0.0.1","[::1]"].includes(n.hostname))throw new Error("Bearer access token requests require HTTPS.");e.Authorization=`Bearer ${t}`}const u=await fetch(f,{method:"GET",credentials:"include",cache:"no-store",redirect:"error",headers:e});if(!u.ok)throw new Error(`Unable to obtain UAuth antiforgery token: HTTP ${u.status}.`);const r=await u.json();if(!r?.requestToken||!r?.headerName||!r?.formFieldName)throw new Error("Invalid UAuth antiforgery response.");return r},appendToForm:async function(n,t){const r=await this.getToken(t);let i=Array.from(n.elements).find(n=>n.name===r.formFieldName);i||(i=document.createElement("input"),i.type="hidden",i.name=r.formFieldName,n.appendChild(i));i.value=r.requestToken}};window.uauth.submitLoginForm=async function(n,t){if(!(n instanceof HTMLFormElement))throw new Error("A native HTML form is required.");const{mode:o,tryUrl:k,commitUrl:d,applicationProfile:s,trustedOrigin:f,isPkce:h,transport:c="Auto",transportUrl:g,returnUrl:nt}=t;if(!["TryOnly","TryAndCommit","DirectCommit"].includes(o))throw new Error("Unsupported UAuth submit mode.");if(!window.uauth.deviceId)throw new Error("UAuth deviceId is not initialized.");const v=window.uauth.validateAuthUrl(d,f),tt=o==="DirectCommit"?null:window.uauth.validateAuthUrl(k,f),u=new FormData(n),y=u.getAll("Identifier"),p=u.getAll("Secret");if(y.length!==1||p.length!==1)throw new Error("Login form requires exactly one Identifier and one Secret.");const l=y[0],a=p[0];if(typeof l!="string"||typeof a!="string"||!l.trim()||!a.trim())throw new Error("Identifier and Secret are required.");if(h)for(const n of["authorization_code","code_verifier"]){const t=u.getAll(n);if(t.length!==1||typeof t[0]!="string"||!t[0])throw new Error(`Missing or duplicate PKCE field: ${n}`);}if(h){const t=u.get("hub_session_id");if(typeof t!="string"||!t)throw new Error("Missing PKCE Hub session ID.");const i=new URL(v);i.searchParams.set("uauth_hub",t);n.action=i.href}else n.action=v;const w=async()=>{if(!["Auto","Fetch","Navigation"].includes(c))throw new Error("Unsupported login transport.");const t=await window.uauth.getLoginTransport({url:g,applicationProfile:s,trustedOrigin:f});if(!t?.ok||!t.body?.supported)throw new Error("Login transport is unavailable or unsupported.");const i=t.body,u=c==="Auto"?i.navigationSupported&&Boolean(nt)?"Navigation":"Fetch":c;if(u==="Navigation"){if(!i.navigationSupported)throw new Error("Navigation is incompatible with header-based credential delivery.");return await window.uauth.submitForm(n,f),null}const r=await window.uauth.commitLoginForm(n,n.action,s,f);if(!r?.ok)throw new Error(`Login commit failed: HTTP ${r?.status??0}.`);return{commit:r,accessTokenInHeader:i.accessTokenInHeader}};if(o==="DirectCommit")return await w();const e={Identifier:l,Secret:a};h?(e.authorization_code=u.get("authorization_code"),e.code_verifier=u.get("code_verifier"),e.__uauth_return_url=u.get("__uauth_return_url")??"",e.hub_session_id=u.get("hub_session_id")??""):e.ReturnUrl=u.get("__uauth_return_url")??"";const i=await window.uauth.postJson({url:tt,payload:e,applicationProfile:s,trustedOrigin:f});if(!i||!Number.isInteger(i.status))throw new Error("Invalid UAuth transport response.");if(i.status===429)return{isSuccess:!1,status:429,errorCode:"rate_limited",retryAfter:i.retryAfter??null};const it=i.status>=200&&i.status<300,b=i.status>=400&&i.status<500;if(!it&&!b)throw new Error(`Unexpected UAuth try response: HTTP ${i.status}.`);const r=i.body;if(!r||typeof r!="object"||Array.isArray(r)||typeof r.isSuccess!="boolean")throw new Error("Invalid UAuth try response body.");if(b&&r.isSuccess)throw new Error("Successful authentication result returned with HTTP error.");if(o==="TryAndCommit"&&r.isSuccess){if(r.previewReceipt){let t=Array.from(n.elements).find(n=>n.name==="PreviewReceipt");t||(t=document.createElement("input"),t.type="hidden",t.name="PreviewReceipt",n.appendChild(t));t.value=r.previewReceipt}const t=await w();if(t)return{...r,...t}}return r};window.uauth.setDeviceId=function(n){window.uauth.deviceId=n};window.uauth.getDeviceInfo=function(){return{userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language}} \ No newline at end of file diff --git a/src/client/CodeBeam.UltimateAuth.Client/Abstractions/IUAuthTokenStore.cs b/src/client/CodeBeam.UltimateAuth.Client/Abstractions/IUAuthTokenStore.cs new file mode 100644 index 00000000..e8ca48b2 --- /dev/null +++ b/src/client/CodeBeam.UltimateAuth.Client/Abstractions/IUAuthTokenStore.cs @@ -0,0 +1,28 @@ +using CodeBeam.UltimateAuth.Core.Contracts; + +namespace CodeBeam.UltimateAuth.Client.Abstractions; + +/// +/// Stores the access credential associated with the current client scope. +/// +/// +/// The store does not determine the authentication mode, application profile, +/// grant delivery mechanism, or transport. +/// +public interface IUAuthTokenStore +{ + /// + /// Returns the currently stored access token, if any. + /// + AccessToken? Read(); + + /// + /// Atomically replaces the current access token. + /// + void Replace(AccessToken token); + + /// + /// Removes the current access token. + /// + void Clear(); +} diff --git a/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateEvent.cs b/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateEvent.cs index 80a995e3..064f080b 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateEvent.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateEvent.cs @@ -53,5 +53,17 @@ public enum UAuthStateEvent /// /// Indicates that a logout operation affecting the authentication state occurred. /// - LogoutVariant + LogoutVariant, + + /// + /// Indicates that an authentication flow completed successfully + /// and the client should synchronize its authentication state. + /// + LoginSucceeded, + + /// + /// Indicates that the current access credential is no longer + /// usable and reauthentication is required. + /// + ReauthenticationRequired, } diff --git a/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateManager.cs b/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateManager.cs index 1b8fd30b..b7fba47c 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateManager.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/AuthState/UAuthStateManager.cs @@ -1,29 +1,46 @@ -using CodeBeam.UltimateAuth.Client.Events; +using CodeBeam.UltimateAuth.Client.Abstractions; using CodeBeam.UltimateAuth.Client.Errors; +using CodeBeam.UltimateAuth.Client.Events; using CodeBeam.UltimateAuth.Client.Infrastructure; -using System.Net; +using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Core.Abstractions; +using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Users.Contracts; +using Microsoft.Extensions.Options; +using System.Net; namespace CodeBeam.UltimateAuth.Client.Authentication; internal sealed class UAuthStateManager : IUAuthStateManager, IDisposable { - private Task? _ensureTask; - private DateTimeOffset _validationNotBefore; - private readonly object _ensureLock = new(); - private readonly IUAuthClient _client; private readonly IUAuthClientEvents _events; private readonly IClock _clock; + private readonly IUAuthTokenStore _tokenStore; + private readonly IUAuthRequestClient _requestClient; + private readonly UAuthClientOptions _options; + + private Task? _ensureTask; + private DateTimeOffset _validationNotBefore; + private readonly object _ensureLock = new(); + private bool _initialRecoveryCompleted; public UAuthState State { get; } = UAuthState.Anonymous(); - public UAuthStateManager(IUAuthClient client, IUAuthClientEvents events, IClock clock) + public UAuthStateManager( + IUAuthClient client, + IUAuthClientEvents events, + IClock clock, + IUAuthTokenStore tokenStore, + IUAuthRequestClient requestClient, + IOptions options) { _client = client; _events = events; _clock = clock; + _tokenStore = tokenStore; + _requestClient = requestClient; + _options = options.Value; _events.StateChanged += HandleStateEvent; } @@ -51,6 +68,22 @@ private async Task EnsureInternalAsync(CancellationToken ct) { var result = await _client.Flows.ValidateAsync(); + if (!_initialRecoveryCompleted) + { + if (result.State == SessionState.NotFound) + { + var recovered = + await TryRecoverAuthenticationAsync(ct); + + if (recovered) + { + result = await _client.Flows.ValidateAsync(); + } + } + + _initialRecoveryCompleted = true; + } + if (!result.IsValid) { State.Clear(); @@ -65,9 +98,12 @@ private async Task EnsureInternalAsync(CancellationToken ct) State.ApplySnapshot(result.Snapshot, _clock.UtcNow); } - catch (UAuthTransportException ex) when (ex.StatusCode == HttpStatusCode.TooManyRequests) + catch (UAuthTransportException ex) + when (ex.StatusCode == HttpStatusCode.TooManyRequests) { - _validationNotBefore = UAuthRateLimit.NotBefore(_clock.UtcNow, ex.RetryAfter); + _validationNotBefore = UAuthRateLimit.NotBefore( + _clock.UtcNow, + ex.RetryAfter); } finally { @@ -80,11 +116,20 @@ private async Task EnsureInternalAsync(CancellationToken ct) private async Task HandleStateEvent(UAuthStateEventArgs args) { - if (args.RefreshMode == UAuthStateEventHandlingMode.None) + switch (args.Type) { - return; + case UAuthStateEvent.LoginSucceeded: + await EnsureAsync(force: true); + return; + + case UAuthStateEvent.ReauthenticationRequired: + State.Clear(); + return; } + if (args.RefreshMode == UAuthStateEventHandlingMode.None) + return; + switch (args.Type) { case UAuthStateEvent.SessionRevoked: @@ -101,15 +146,15 @@ private async Task HandleStateEvent(UAuthStateEventArgs args) State.UpdateProfile(profile.Payload); return; - case UAuthStateEventArgs profile: - State.UpdateUserStatus(profile.Payload); + case UAuthStateEventArgs status: + State.UpdateUserStatus(status.Payload); return; } switch (args.RefreshMode) { case UAuthStateEventHandlingMode.Validate: - await EnsureAsync(true); + await EnsureAsync(force: true); return; case UAuthStateEventHandlingMode.Patch: @@ -118,8 +163,7 @@ private async Task HandleStateEvent(UAuthStateEventArgs args) State.MarkValidated(_clock.UtcNow); return; } - break; - default: + break; } @@ -128,8 +172,7 @@ private async Task HandleStateEvent(UAuthStateEventArgs args) public Task OnLoginAsync() { - State.MarkStale(); - return Task.CompletedTask; + return EnsureAsync(force: true); } public Task OnLogoutAsync() @@ -154,4 +197,42 @@ public void Dispose() } public bool NeedsValidation => !State.IsAuthenticated || State.IsStale; + + private async Task TryRecoverAuthenticationAsync(CancellationToken ct) + { + var existingToken = _tokenStore.Read(); + + if (existingToken is not null && !existingToken.IsExpired(_clock.UtcNow)) + { + return false; + } + + var transportUrl = UAuthUrlBuilder.Build(_options.Endpoints.BasePath, _options.Endpoints.LoginTransport, _options.MultiTenant); + + var transport = await _requestClient.GetLoginTransportAsync(transportUrl, ct); + + if (!transport.Supported || !transport.AccessTokenInHeader) + { + return false; + } + + var refresh = await _client.Flows.RecoverAsync(); + + if (refresh.Status == 429) + { + throw UAuthRateLimit.Exception( + refresh.RetryAfter is { } retryAfter + ? Math.Ceiling(retryAfter.TotalSeconds).ToString(System.Globalization.CultureInfo.InvariantCulture) + : null); + } + + if (!refresh.IsSuccess) + { + return false; + } + + var recoveredToken = _tokenStore.Read(); + + return recoveredToken is not null && !recoveredToken.IsExpired(_clock.UtcNow); + } } diff --git a/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthLoginTransport.cs b/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthLoginTransport.cs new file mode 100644 index 00000000..fd091f41 --- /dev/null +++ b/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthLoginTransport.cs @@ -0,0 +1,8 @@ +namespace CodeBeam.UltimateAuth.Client; + +public enum UAuthLoginTransport +{ + Auto = 0, + Fetch = 10, + Navigation = 20 +} diff --git a/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthLoginTransportInfo.cs b/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthLoginTransportInfo.cs new file mode 100644 index 00000000..fe44411f --- /dev/null +++ b/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthLoginTransportInfo.cs @@ -0,0 +1,8 @@ +namespace CodeBeam.UltimateAuth.Client; + +public sealed class UAuthLoginTransportInfo +{ + public bool Supported { get; init; } + public bool NavigationSupported { get; init; } + public bool AccessTokenInHeader { get; init; } +} diff --git a/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthTransportResult.cs b/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthTransportResult.cs index 4381fd98..f00034de 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthTransportResult.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/Contracts/UAuthTransportResult.cs @@ -34,6 +34,24 @@ public sealed class UAuthTransportResult [JsonPropertyName("refreshOutcome")] public string? RefreshOutcome { get; init; } + /// + /// Raw access credential returned by the transport, when the configured delivery mechanism exposes it. + /// + [JsonPropertyName("accessToken")] + public string? AccessToken { get; init; } + + /// + /// Access token expiration metadata supplied by the issuer. + /// + [JsonPropertyName("accessTokenExpiresAt")] + public string? AccessTokenExpiresAt { get; init; } + + [JsonPropertyName("accessTokenFormat")] + public string? AccessTokenFormat { get; init; } + + [JsonPropertyName("accessTokenHeaderFormat")] + public string? AccessTokenHeaderFormat { get; init; } + /// /// Gets the response body as JSON, when a body is available. /// diff --git a/src/client/CodeBeam.UltimateAuth.Client/Extensions/ServiceCollectionExtensions.cs b/src/client/CodeBeam.UltimateAuth.Client/Extensions/ServiceCollectionExtensions.cs index 906be2aa..503c0c0d 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/Extensions/ServiceCollectionExtensions.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/Extensions/ServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ -using CodeBeam.UltimateAuth.Client.Authentication; +using CodeBeam.UltimateAuth.Client.Abstractions; +using CodeBeam.UltimateAuth.Client.Authentication; using CodeBeam.UltimateAuth.Client.Device; using CodeBeam.UltimateAuth.Client.Devices; using CodeBeam.UltimateAuth.Client.Events; @@ -96,7 +97,7 @@ private static IServiceCollection AddUltimateAuthClientInternal(this IServiceCol services.AddSingleton(); services.AddSingleton, UAuthClientOptionsPostConfigure>(); services.TryAddSingleton(); - services.AddSingleton(); + services.AddScoped(); services.PostConfigure(o => { @@ -122,6 +123,8 @@ private static IServiceCollection AddUltimateAuthClientInternal(this IServiceCol services.TryAddScoped(); services.TryAddScoped(); + services.TryAddScoped(); + return services; } } diff --git a/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/IUAuthRequestClient.cs b/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/IUAuthRequestClient.cs index 521adeae..257c9892 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/IUAuthRequestClient.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/IUAuthRequestClient.cs @@ -32,6 +32,8 @@ public interface IUAuthRequestClient Task SendFormAsync(string endpoint, IDictionary? form, bool navigateOnSuccess, CancellationToken ct = default) => SendFormAsync(endpoint, form, ct); + Task SendFormAsync(string endpoint, IDictionary? form, string? accessToken, CancellationToken ct = default); + /// /// Sends a JSON payload to the specified endpoint and returns the result of the operation. /// @@ -52,4 +54,10 @@ Task SendFormAsync(string endpoint, IDictionary /// Task TryAndCommitAsync(string tryEndpoint, string commitEndpoint, object request, CancellationToken ct = default); + + Task GetLoginTransportAsync(string endpoint, CancellationToken ct = default); + + Task NavigateToUrlAsync(string url, CancellationToken ct = default); + + Task NavigateToPkceReturnUrlAsync(string redirectUrl, string expectedReturnUrl, CancellationToken ct = default); } diff --git a/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/InMemoryUAuthTokenStore.cs b/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/InMemoryUAuthTokenStore.cs new file mode 100644 index 00000000..2c168c02 --- /dev/null +++ b/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/InMemoryUAuthTokenStore.cs @@ -0,0 +1,29 @@ +using System.Threading; +using CodeBeam.UltimateAuth.Client.Abstractions; +using CodeBeam.UltimateAuth.Core.Contracts; + +namespace CodeBeam.UltimateAuth.Client.Infrastructure; + +/// +/// Stores a single access token in managed memory. +/// +/// +/// The instance must be scoped to the current client or user. +/// It does not persist credentials across application restarts. +/// +internal sealed class InMemoryUAuthTokenStore : IUAuthTokenStore +{ + private AccessToken? _token; + + public AccessToken? Read() + => Volatile.Read(ref _token); + + public void Replace(AccessToken token) + { + ArgumentNullException.ThrowIfNull(token); + Volatile.Write(ref _token, token); + } + + public void Clear() + => Volatile.Write(ref _token, null); +} diff --git a/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/UAuthLoginCompletion.cs b/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/UAuthLoginCompletion.cs new file mode 100644 index 00000000..414422b0 --- /dev/null +++ b/src/client/CodeBeam.UltimateAuth.Client/Infrastructure/UAuthLoginCompletion.cs @@ -0,0 +1,110 @@ +using CodeBeam.UltimateAuth.Client.Abstractions; +using CodeBeam.UltimateAuth.Client.Contracts; +using CodeBeam.UltimateAuth.Client.Errors; +using CodeBeam.UltimateAuth.Client.Events; +using CodeBeam.UltimateAuth.Core.Contracts; +using System.Globalization; +using System.Text.Json; + +namespace CodeBeam.UltimateAuth.Client.Infrastructure; + +public static class UAuthLoginCompletion +{ + public static async Task CompleteAsync(UAuthTransportResult response, bool accessTokenRequired, IUAuthTokenStore tokenStore, IUAuthClientEvents events) + { + ArgumentNullException.ThrowIfNull(response); + + if (!response.Ok || response.Status is < 200 or >= 300) + { + throw new UAuthProtocolException("Cannot complete an unsuccessful login."); + } + + var token = ReadAccessToken(response); + + if (accessTokenRequired && token is null) + { + tokenStore.Clear(); + + throw new UAuthProtocolException("Login succeeded but the required access token was not returned."); + } + + if (token is not null && token.IsExpired(DateTimeOffset.UtcNow)) + { + tokenStore.Clear(); + + throw new UAuthProtocolException("Server returned an expired access token."); + } + + // A cookie-only login must not retain a token belonging to a previous authenticated user. + if (token is null) + tokenStore.Clear(); + else + tokenStore.Replace(token); + + await events.PublishAsync(new UAuthStateEventArgsEmpty(UAuthStateEvent.LoginSucceeded, UAuthStateEventHandlingMode.Validate)); + } + + public static string? GetRedirectUrl(UAuthTransportResult response) + { + if (response.Body is not { } body || + body.ValueKind != JsonValueKind.Object || + !body.TryGetProperty("redirectUrl", out var redirect) || + redirect.ValueKind != JsonValueKind.String) + { + return null; + } + + return redirect.GetString(); + } + + public static AccessToken? ReadAccessToken(UAuthTransportResult response) + { + if (string.IsNullOrWhiteSpace(response.AccessToken)) + return null; + + if (string.IsNullOrWhiteSpace(response.AccessTokenExpiresAt) || + !DateTimeOffset.TryParse(response.AccessTokenExpiresAt, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out var expiresAt)) + { + throw new UAuthProtocolException("Access token expiration metadata is invalid."); + } + + var format = response.AccessTokenFormat?.ToLowerInvariant() switch + { + "jwt" => TokenFormat.Jwt, + "opaque" => TokenFormat.Opaque, + _ => throw new UAuthProtocolException("Access token format metadata is invalid.") + }; + + var token = response.AccessToken; + + switch (response.AccessTokenHeaderFormat?.ToLowerInvariant()) + { + case "bearer": + if (!token.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) + { + throw new UAuthProtocolException("Invalid Bearer access token header."); + } + + token = token["Bearer ".Length..]; + break; + + case "raw": + break; + + default: + throw new UAuthProtocolException("Access token header format metadata is invalid."); + } + + if (string.IsNullOrWhiteSpace(token) || token.Contains('\r') || token.Contains('\n')) + { + throw new UAuthProtocolException("Invalid access token value."); + } + + return new AccessToken + { + Token = token, + Format = format, + ExpiresAt = expiresAt + }; + } +} diff --git a/src/client/CodeBeam.UltimateAuth.Client/Options/UAuthClientEndpointOptions.cs b/src/client/CodeBeam.UltimateAuth.Client/Options/UAuthClientEndpointOptions.cs index 00545954..3967b490 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/Options/UAuthClientEndpointOptions.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/Options/UAuthClientEndpointOptions.cs @@ -70,4 +70,9 @@ public sealed class UAuthClientEndpointOptions /// Endpoint used to retrieve the effective public password policy. /// public string PasswordPolicy { get; set; } = "/password-policy"; + + /// + /// Returns the effective login transport capabilities for the current tenant and application profile. + /// + public string LoginTransport { get; set; } = "/login/transport"; } diff --git a/src/client/CodeBeam.UltimateAuth.Client/Options/Validators/UAuthClientEndpointOptionsValidator.cs b/src/client/CodeBeam.UltimateAuth.Client/Options/Validators/UAuthClientEndpointOptionsValidator.cs index 2a18d4b8..80469905 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/Options/Validators/UAuthClientEndpointOptionsValidator.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/Options/Validators/UAuthClientEndpointOptionsValidator.cs @@ -25,7 +25,8 @@ public ValidateOptionsResult Validate(string? name, UAuthClientOptions options) if (string.IsNullOrWhiteSpace(e.Login) || string.IsNullOrWhiteSpace(e.Logout) || string.IsNullOrWhiteSpace(e.Refresh) || - string.IsNullOrWhiteSpace(e.Validate)) + string.IsNullOrWhiteSpace(e.Validate) || + string.IsNullOrWhiteSpace(e.LoginTransport)) { return ValidateOptionsResult.Fail("One or more required endpoint paths are missing in UAuthClientEndpointOptions."); } diff --git a/src/client/CodeBeam.UltimateAuth.Client/Services/Abstractions/IFlowClient.cs b/src/client/CodeBeam.UltimateAuth.Client/Services/Abstractions/IFlowClient.cs index cdbefcf7..25493916 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/Services/Abstractions/IFlowClient.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/Services/Abstractions/IFlowClient.cs @@ -39,12 +39,10 @@ namespace CodeBeam.UltimateAuth.Client.Services; public interface IFlowClient { /// - /// Performs a login operation. + /// Logs in using the effective transport configuration. + /// When a return URL is supplied, successful fetch logins navigate after the authentication state has been updated. /// - /// - /// This method triggers redirects depending on the application profile and configuration. - /// - Task LoginAsync(LoginRequest request, string? returnUrl = null); + Task LoginAsync(LoginRequest request, string? returnUrl = null, UAuthLoginTransport transport = UAuthLoginTransport.Auto); /// /// Attempts to log in and returns a structured result instead of throwing. UltimateAuth suggestion as better UX. @@ -53,7 +51,7 @@ public interface IFlowClient /// Redirects only on successful login if mode is TryAndCommit. In TryOnly mode, it returns the result without redirecting. /// DirectCommit mode behaves same as LoginAsync. /// - Task TryLoginAsync(LoginRequest request, UAuthSubmitMode mode, string? returnUrl = null); + Task TryLoginAsync(LoginRequest request, UAuthSubmitMode mode, string? returnUrl = null, UAuthLoginTransport transport = UAuthLoginTransport.Auto); /// /// Logs out the current user. @@ -137,4 +135,6 @@ public interface IFlowClient /// Logs out all sessions for a user. /// Task LogoutAllUserDevicesAsync(UserKey userKey); + + Task RecoverAsync(); } diff --git a/src/client/CodeBeam.UltimateAuth.Client/Services/UAuthFlowClient.cs b/src/client/CodeBeam.UltimateAuth.Client/Services/UAuthFlowClient.cs index 7f6f21c6..93c6a223 100644 --- a/src/client/CodeBeam.UltimateAuth.Client/Services/UAuthFlowClient.cs +++ b/src/client/CodeBeam.UltimateAuth.Client/Services/UAuthFlowClient.cs @@ -27,10 +27,12 @@ internal class UAuthFlowClient : IFlowClient private readonly IReturnUrlProvider _returnUrlProvider; private readonly UAuthClientOptions _options; private readonly UAuthClientDiagnostics _diagnostics; + private readonly IUAuthTokenStore _tokenStore; + private DateTimeOffset _refreshNotBefore; private RefreshResult? _refreshThrottle; - public UAuthFlowClient(IUAuthRequestClient post, IUAuthClientEvents events, IClientDeviceProvider clientDeviceProvider, IReturnUrlProvider returnUrlProvider, IOptions options, UAuthClientDiagnostics diagnostics) + public UAuthFlowClient(IUAuthRequestClient post, IUAuthClientEvents events, IClientDeviceProvider clientDeviceProvider, IReturnUrlProvider returnUrlProvider, IOptions options, UAuthClientDiagnostics diagnostics, IUAuthTokenStore tokenStore) { _post = post; _events = events; @@ -38,21 +40,101 @@ public UAuthFlowClient(IUAuthRequestClient post, IUAuthClientEvents events, ICli _returnUrlProvider = returnUrlProvider; _options = options.Value; _diagnostics = diagnostics; + _tokenStore = tokenStore; } private string Url(string path) => UAuthUrlBuilder.Build(_options.Endpoints.BasePath, path, _options.MultiTenant); - public async Task LoginAsync(LoginRequest request, string? returnUrl = null) + public async Task LoginAsync(LoginRequest request, string? returnUrl = null, UAuthLoginTransport transport = UAuthLoginTransport.Auto) { + ArgumentNullException.ThrowIfNull(request); + EnsureCanPost(); - var payload = BuildPayload(request, returnUrl); + var resolvedReturnUrl = + returnUrl + ?? _options.Login.ReturnUrl + ?? _options.DefaultReturnUrl; + + var payload = BuildPayload(request, resolvedReturnUrl); + + var info = await _post.GetLoginTransportAsync(Url(_options.Endpoints.LoginTransport)); + + if (!info.Supported) + { + throw new NotSupportedException("The effective credential delivery is not supported by this UltimateAuth client."); + } + + var selected = transport switch + { + UAuthLoginTransport.Auto => + info.NavigationSupported && !string.IsNullOrWhiteSpace(resolvedReturnUrl) + ? UAuthLoginTransport.Navigation + : UAuthLoginTransport.Fetch, + + UAuthLoginTransport.Fetch => + UAuthLoginTransport.Fetch, + + UAuthLoginTransport.Navigation => + UAuthLoginTransport.Navigation, + + _ => throw new ArgumentOutOfRangeException( + nameof(transport)) + }; + + if (selected == UAuthLoginTransport.Navigation) + { + if (!info.NavigationSupported) + { + throw new InvalidOperationException("Navigation transport is incompatible with header-based credential delivery."); + } + + await _post.NavigateAsync(Url(_options.Endpoints.Login), payload); + + // The browser now owns the native POST. + // HTTP authentication success cannot be observed here. + return new UAuthResult + { + IsSuccess = true, + Status = 202 + }; + } + + payload["__uauth_response_mode"] = "fetch"; + + var raw = await _post.SendFormAsync(Url(_options.Endpoints.Login), payload); + + EnsureValidHttpStatus(raw); + + if (!raw.Ok) + { + return new UAuthResult + { + IsSuccess = false, + Status = raw.Status + }; + } + + await UAuthLoginCompletion.CompleteAsync(raw, info.AccessTokenInHeader, _tokenStore, _events); + + if (!string.IsNullOrWhiteSpace(resolvedReturnUrl)) + { + var redirectUrl = UAuthLoginCompletion.GetRedirectUrl(raw); + + if (!string.IsNullOrWhiteSpace(redirectUrl)) + { + await _post.NavigateToUrlAsync(redirectUrl); + } + } - var url = Url(_options.Endpoints.Login); - await _post.NavigateAsync(url, payload); + return new UAuthResult + { + IsSuccess = true, + Status = raw.Status + }; } - public async Task TryLoginAsync(LoginRequest request, UAuthSubmitMode mode, string? returnUrl = null) + public async Task TryLoginAsync(LoginRequest request, UAuthSubmitMode mode, string? returnUrl = null, UAuthLoginTransport transport = UAuthLoginTransport.Auto) { EnsureCanPost(); @@ -98,22 +180,51 @@ public async Task TryLoginAsync(LoginRequest request, UAuthSubmi case UAuthSubmitMode.DirectCommit: { - await _post.NavigateAsync(commitUrl, payload); - return new TryLoginResult { IsSuccess = true }; + var commit = await LoginAsync( + request, + returnUrl, + transport); + + return new TryLoginResult + { + IsSuccess = commit.IsSuccess, + Status = commit.Status + }; } case UAuthSubmitMode.TryAndCommit: default: { - TryLoginResult result; - try { result = await _post.TryAndCommitAsync(tryUrl, commitUrl, payload); } - catch (UAuthTransportException ex) when (ex.StatusCode == HttpStatusCode.TooManyRequests) - { return new TryLoginResult { Status = 429, ErrorCode = "rate_limited", RetryAfter = ex.RetryAfter }; } + var preview = await TryLoginAsync( + request, + UAuthSubmitMode.TryOnly, + returnUrl, + transport); + + if (!preview.IsSuccess) + return preview; - if (result is null) - throw new UAuthProtocolException("Invalid try-login result."); + var commitRequest = request with + { + PreviewReceipt = preview.PreviewReceipt + }; + + var commit = await LoginAsync( + commitRequest, + returnUrl, + transport); + + if (!commit.IsSuccess) + { + return new TryLoginResult + { + IsSuccess = false, + Status = commit.Status, + ErrorCode = "commit_failed" + }; + } - return result; + return preview; } } } @@ -128,93 +239,21 @@ public async Task LogoutAsync(bool navigate = true) if (raw.Status is < 200 or >= 300) throw new UAuthTransportException("Server logout did not succeed.", (HttpStatusCode)raw.Status); + _tokenStore.Clear(); await _events.PublishAsync(new UAuthStateEventArgsEmpty(UAuthStateEvent.LogoutVariant, _options.StateEvents.HandlingMode)); } - public async Task RefreshAsync(bool isAuto = false) + public Task RefreshAsync(bool isAuto = false) { - if (!isAuto) - { - _diagnostics.MarkManualRefresh(); - } - - var now = DateTimeOffset.UtcNow; - if (_refreshThrottle is not null && now < _refreshNotBefore) - return _refreshThrottle with { RetryAfter = _refreshNotBefore - now }; - var raw = await _post.SendFormAsync(Url(_options.Endpoints.Refresh)); - if (raw.Status == 429) - { - _refreshThrottle = new RefreshResult - { - Status = 429, - IsSuccess = false, - Outcome = RefreshOutcome.None, - ErrorCode = "rate_limited", - RetryAfter = UAuthRateLimit.ParseRetryAfter(raw.RetryAfter, DateTimeOffset.UtcNow) - }; - _refreshNotBefore = UAuthRateLimit.NotBefore(DateTimeOffset.UtcNow, _refreshThrottle.RetryAfter); - return _refreshThrottle; - } - _refreshThrottle = null; - - // 401 is a normal authentication outcome for refresh. - if (raw.Status == 401) - { - _diagnostics.MarkRefreshReauthRequired(); - - return new RefreshResult - { - IsSuccess = false, - Status = 401, - Outcome = RefreshOutcome.ReauthRequired - }; - } - - EnsureValidHttpStatus(raw); - - var outcome = RefreshOutcomeParser.Parse(raw.RefreshOutcome); - var isSuccess = raw.Status is >= 200 and < 300 && raw.Ok; - - // Never record a successful refresh outcome - // for a failed HTTP response. - if (isSuccess) - { - switch (outcome) - { - case RefreshOutcome.NoOp: - _diagnostics.MarkRefreshNoOp(); - break; - - case RefreshOutcome.Touched: - _diagnostics.MarkRefreshTouched(); - break; - - case RefreshOutcome.Rotated: - _diagnostics.MarkRefreshRotated(); - break; - - case RefreshOutcome.ReauthRequired: - _diagnostics.MarkRefreshReauthRequired(); - break; - - case RefreshOutcome.Success: - _diagnostics.MarkRefreshSuccess(); - break; - } - } - else if (outcome == RefreshOutcome.ReauthRequired) - { - _diagnostics.MarkRefreshReauthRequired(); - } + return RefreshCoreAsync(isAuto, isRecovery: false); + } - return new RefreshResult - { - IsSuccess = isSuccess, - Status = raw.Status, - Outcome = outcome - }; + public Task RecoverAsync() + { + return RefreshCoreAsync(isAuto: true, isRecovery: true); } + //public async Task ReauthAsync() //{ // var url = Url(_options.Endpoints.Reauth); @@ -224,7 +263,16 @@ public async Task RefreshAsync(bool isAuto = false) public async Task ValidateAsync() { var url = Url(_options.Endpoints.Validate); - var raw = await _post.SendFormAsync(url); + + var accessToken = _tokenStore.Read(); + + if (accessToken is not null && accessToken.IsExpired(DateTimeOffset.UtcNow)) + { + _tokenStore.Clear(); + accessToken = null; + } + + var raw = await _post.SendFormAsync(url, form: null, accessToken: accessToken?.Token); if (raw.Status == 429) throw UAuthRateLimit.Exception(raw.RetryAfter); if (raw.Status == 0) @@ -330,114 +378,140 @@ public async Task BeginPkceAsync(string? returnUrl = null) } } - public async Task TryCompletePkceLoginAsync(PkceCompleteRequest request, UAuthSubmitMode mode) + public async Task TryCompletePkceLoginAsync( + PkceCompleteRequest request, + UAuthSubmitMode mode) { + ArgumentNullException.ThrowIfNull(request); + + if (!_options.Pkce.Enabled) + throw new InvalidOperationException("PKCE login is disabled."); + if (mode == UAuthSubmitMode.DirectCommit) { await CompletePkceLoginAsync(request); - return new TryPkceLoginResult { IsSuccess = true }; + + return new TryPkceLoginResult + { + IsSuccess = true + }; + } + + var raw = await _post.SendJsonAsync( + Url(_options.Endpoints.PkceTryComplete), + request); + + if (raw.Status == 429) + { + return new TryPkceLoginResult + { + Status = 429, + RetryAfter = UAuthRateLimit.ParseRetryAfter( + raw.RetryAfter, + DateTimeOffset.UtcNow), + ErrorCode = "rate_limited" + }; + } + + EnsureValidHttpStatus(raw); + + if (raw.Body is null || + raw.Body.Value.ValueKind is + JsonValueKind.Null or JsonValueKind.Undefined) + { + throw new UAuthProtocolException( + "Empty PKCE try-login response body."); + } + + TryPkceLoginResult preview; + + try + { + preview = raw.Body.Value.Deserialize( + new JsonSerializerOptions(JsonSerializerDefaults.Web)) + ?? throw new UAuthProtocolException( + "Invalid PKCE try-login result."); } + catch (JsonException ex) + { + throw new UAuthProtocolException( + "Invalid PKCE try-login result.", ex); + } + + if (mode == UAuthSubmitMode.TryOnly || !preview.IsSuccess) + return preview; - if (request is null) - throw new ArgumentNullException(nameof(request)); + await CompletePkceLoginAsync(request); + + return preview; + } + + public async Task CompletePkceLoginAsync( + PkceCompleteRequest request) + { + ArgumentNullException.ThrowIfNull(request); if (!_options.Pkce.Enabled) - throw new InvalidOperationException("PKCE login is disabled."); + throw new InvalidOperationException( + "PKCE login is disabled."); - var tryUrl = Url(_options.Endpoints.PkceTryComplete); - var commitUrl = Url(_options.Endpoints.PkceComplete); + var url = Url(_options.Endpoints.PkceComplete); var payload = new Dictionary { ["authorization_code"] = request.AuthorizationCode, ["code_verifier"] = request.CodeVerifier, + [UAuthConstants.Form.ReturnUrl] = + request.ReturnUrl ?? string.Empty, ["Identifier"] = request.Identifier ?? string.Empty, ["Secret"] = request.Secret ?? string.Empty, ["hub_session_id"] = request.HubSessionId ?? string.Empty }; - if (!string.IsNullOrWhiteSpace(request.ReturnUrl)) - { - payload[UAuthConstants.Form.ReturnUrl] = request.ReturnUrl; - } + var info = await _post.GetLoginTransportAsync( + Url(_options.Endpoints.LoginTransport)); - switch (mode) + if (!info.Supported) + throw new NotSupportedException( + "PKCE credential delivery is not supported."); + + if (info.NavigationSupported) { - case UAuthSubmitMode.TryOnly: - { - var raw = await _post.SendJsonAsync(tryUrl, request); - if (raw.Status == 429) return new TryPkceLoginResult { Status = 429, ErrorCode = "rate_limited", RetryAfter = UAuthRateLimit.ParseRetryAfter(raw.RetryAfter, DateTimeOffset.UtcNow) }; + await _post.NavigateAsync(url, payload); + return; + } - EnsureValidHttpStatus(raw); + payload["__uauth_response_mode"] = "fetch"; - if (raw.Status is >= 400 and < 500) - { - throw new UAuthProtocolException($"Unexpected client error during PKCE try-login: {raw.Status}."); - } + var raw = await _post.SendFormAsync(url, payload); - if (raw.Body is null || raw.Body.Value.ValueKind is JsonValueKind.Null or JsonValueKind.Undefined) - { - throw new UAuthProtocolException("Empty PKCE try-login response body."); - } + EnsureValidHttpStatus(raw); - try - { - var parsed = raw.Body.Value.Deserialize( - new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true - }); + if (!raw.Ok) + throw new UAuthProtocolException($"PKCE completion failed: HTTP {raw.Status}."); - return parsed ?? throw new UAuthProtocolException("Invalid PKCE try-login result."); - } - catch (JsonException ex) - { - throw new UAuthProtocolException("Invalid PKCE try-login result.", ex); - } - } + var redirectUrl = UAuthLoginCompletion.GetRedirectUrl(raw); - case UAuthSubmitMode.TryAndCommit: - default: - { - TryPkceLoginResult result; - try { result = await _post.TryAndCommitAsync(tryUrl, commitUrl, payload); } - catch (UAuthTransportException ex) when (ex.StatusCode == HttpStatusCode.TooManyRequests) - { return new TryPkceLoginResult { Status = 429, ErrorCode = "rate_limited", RetryAfter = ex.RetryAfter }; } + if (!string.IsNullOrWhiteSpace(request.HubSessionId)) + { + if (string.IsNullOrWhiteSpace(redirectUrl) || + string.IsNullOrWhiteSpace(request.ReturnUrl)) + { + throw new UAuthProtocolException("Missing PKCE handoff redirect."); + } - if (result is null) - throw new UAuthProtocolException("Invalid PKCE try result."); + // Do not authenticate the Hub using the initiating application's access token. + await _post.NavigateToPkceReturnUrlAsync(redirectUrl, request.ReturnUrl); - return result; - } + return; } - } - public async Task CompletePkceLoginAsync(PkceCompleteRequest request) - { - if (request is null) - throw new ArgumentNullException(nameof(request)); + await UAuthLoginCompletion.CompleteAsync(raw, info.AccessTokenInHeader, _tokenStore, _events); - if (!_options.Pkce.Enabled) + if (!string.IsNullOrWhiteSpace(redirectUrl)) { - throw new InvalidOperationException("PKCE login is disabled by configuration, but a PKCE completion was attempted. " + - "This usually indicates a misconfiguration or an unexpected redirect flow."); + await _post.NavigateToUrlAsync(redirectUrl); } - - var url = Url(_options.Endpoints.PkceComplete); - - var payload = new Dictionary - { - ["authorization_code"] = request.AuthorizationCode, - ["code_verifier"] = request.CodeVerifier, - [UAuthConstants.Form.ReturnUrl] = request.ReturnUrl ?? string.Empty, - - ["Identifier"] = request.Identifier ?? string.Empty, - ["Secret"] = request.Secret ?? string.Empty, - - ["hub_session_id"] = request.HubSessionId ?? string.Empty, - }; - - await _post.NavigateAsync(url, payload); } public async Task> LogoutMyDeviceAsync(LogoutDeviceRequest request) @@ -498,6 +572,115 @@ public async Task LogoutAllUserDevicesAsync(UserKey userKey) } + private async Task RefreshCoreAsync(bool isAuto, bool isRecovery) + { + if (!isAuto) + _diagnostics.MarkManualRefresh(); + + var now = DateTimeOffset.UtcNow; + + if (_refreshThrottle is not null && now < _refreshNotBefore) + return _refreshThrottle with { RetryAfter = _refreshNotBefore - now }; + + var raw = await _post.SendFormAsync(Url(_options.Endpoints.Refresh)); + if (raw.Status == 429) + { + _refreshThrottle = new RefreshResult + { + Status = 429, + IsSuccess = false, + Outcome = RefreshOutcome.None, + ErrorCode = "rate_limited", + RetryAfter = UAuthRateLimit.ParseRetryAfter(raw.RetryAfter, DateTimeOffset.UtcNow) + }; + _refreshNotBefore = UAuthRateLimit.NotBefore(DateTimeOffset.UtcNow, _refreshThrottle.RetryAfter); + return _refreshThrottle; + } + _refreshThrottle = null; + + if (raw.Status == 401) + { + if (!isRecovery) + { + _tokenStore.Clear(); + _diagnostics.MarkRefreshReauthRequired(); + + await _events.PublishAsync( + new UAuthStateEventArgsEmpty( + UAuthStateEvent.ReauthenticationRequired, + UAuthStateEventHandlingMode.Patch)); + } + + return new RefreshResult + { + IsSuccess = false, + Status = 401, + Outcome = RefreshOutcome.ReauthRequired + }; + } + + EnsureValidHttpStatus(raw); + + var outcome = RefreshOutcomeParser.Parse(raw.RefreshOutcome); + var isSuccess = raw.Status is >= 200 and < 300 && raw.Ok; + + if (isSuccess) + { + var accessToken = UAuthLoginCompletion.ReadAccessToken(raw); + + if (accessToken is not null) + { + if (accessToken.IsExpired(DateTimeOffset.UtcNow)) + { + _tokenStore.Clear(); + + throw new UAuthProtocolException("Server returned an expired access token."); + } + + _tokenStore.Replace(accessToken); + } + } + + // Never record a successful refresh outcome + // for a failed HTTP response. + if (isSuccess) + { + switch (outcome) + { + case RefreshOutcome.NoOp: + _diagnostics.MarkRefreshNoOp(); + break; + + case RefreshOutcome.Touched: + _diagnostics.MarkRefreshTouched(); + break; + + case RefreshOutcome.Rotated: + _diagnostics.MarkRefreshRotated(); + break; + + case RefreshOutcome.ReauthRequired: + _diagnostics.MarkRefreshReauthRequired(); + break; + + case RefreshOutcome.Success: + _diagnostics.MarkRefreshSuccess(); + break; + } + } + else if (outcome == RefreshOutcome.ReauthRequired) + { + _diagnostics.MarkRefreshReauthRequired(); + } + + return new RefreshResult + { + IsSuccess = isSuccess, + Status = raw.Status, + Outcome = outcome + }; + } + private void EnsureCanPost() { var canPost = ClientLoginCapabilities.CanPostCredentials(_options.ApplicationProfile); diff --git a/tests/CodeBeam.UltimateAuth.IdentityLab.Tests/Rendering/PageRenderContext.cs b/tests/CodeBeam.UltimateAuth.IdentityLab.Tests/Rendering/PageRenderContext.cs index a46fcd8a..b2d073f1 100644 --- a/tests/CodeBeam.UltimateAuth.IdentityLab.Tests/Rendering/PageRenderContext.cs +++ b/tests/CodeBeam.UltimateAuth.IdentityLab.Tests/Rendering/PageRenderContext.cs @@ -1,10 +1,10 @@ -using System.Reflection; -using System.Security.Claims; using Bunit; using CodeBeam.UltimateAuth.Authorization; using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Abstractions; using CodeBeam.UltimateAuth.Client.Blazor; using CodeBeam.UltimateAuth.Client.Blazor.Extensions; +using CodeBeam.UltimateAuth.Client.Events; using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Client.Services; using CodeBeam.UltimateAuth.Core.Abstractions; @@ -27,6 +27,8 @@ using MudBlazor; using MudBlazor.Services; using MudExtensions.Services; +using System.Reflection; +using System.Security.Claims; namespace CodeBeam.UltimateAuth.IdentityLab.Tests.Rendering; @@ -67,6 +69,8 @@ public PageRenderContext() Services.AddSingleton(Mock.Of()); Services.AddSingleton(Mock.Of()); Services.AddSingleton(Mock.Of()); + Services.AddSingleton(Mock.Of()); + Services.AddSingleton(Mock.Of()); } public IRenderedComponent RenderPage(UAuthState? state = null) where T : IComponent diff --git a/tests/CodeBeam.UltimateAuth.Tests.Integration/AuthorizationManagementTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Integration/AuthorizationManagementTests.cs index 73de9bf3..71e4be75 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Integration/AuthorizationManagementTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Integration/AuthorizationManagementTests.cs @@ -1000,11 +1000,40 @@ private static HttpClient CreateClient(AuthServerFactory factory) return client; } + //private static async Task AuthenticatedClientAsync(AuthServerFactory factory, IntegrationTestUser user) + //{ + // var client = CreateClient(factory); + + // using var response = await CsrfTestClient.PostJsonAsync(client, + // "/auth/login", + // new + // { + // identifier = user.Identifier, + // secret = user.Secret + // }); + + // response.StatusCode.Should().Be(HttpStatusCode.Found); + + // response.Headers.TryGetValues("Set-Cookie", out var values) + // .Should().BeTrue(); + + // var cookie = values! + // .First(x => x.StartsWith( + // "uas=", + // StringComparison.OrdinalIgnoreCase)) + // .Split(';', 2)[0]; + + // client.DefaultRequestHeaders.Add("Cookie", cookie); + + // return client; + //} + private static async Task AuthenticatedClientAsync(AuthServerFactory factory, IntegrationTestUser user) { var client = CreateClient(factory); - using var response = await CsrfTestClient.PostJsonAsync(client, + using var response = await CsrfTestClient.PostJsonAsync( + client, "/auth/login", new { @@ -1012,7 +1041,12 @@ private static async Task AuthenticatedClientAsync(AuthServerFactory secret = user.Secret }); - response.StatusCode.Should().Be(HttpStatusCode.Found); + var body = await response.Content.ReadAsStringAsync( + TestContext.Current.CancellationToken); + + response.StatusCode.Should().Be( + HttpStatusCode.Found, + $"login failed with {(int)response.StatusCode}: {body}"); response.Headers.TryGetValues("Set-Cookie", out var values) .Should().BeTrue(); diff --git a/tests/CodeBeam.UltimateAuth.Tests.Integration/ClientRateLimitingIntegrationTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Integration/ClientRateLimitingIntegrationTests.cs index ccd1e44d..138f2f7d 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Integration/ClientRateLimitingIntegrationTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Integration/ClientRateLimitingIntegrationTests.cs @@ -116,12 +116,40 @@ public async Task SendFormAsync(string endpoint, IDictiona using var response = await CsrfTestClient.PostAsync(http, endpoint, form is null ? null : new FormUrlEncodedContent(form)); return await Read(response, ct); } + public async Task SendFormAsync(string endpoint, IDictionary? form = null, string? accessToken = null, CancellationToken ct = default) + { + Count++; + + using var response = await CsrfTestClient.PostAsync(http, endpoint, form is null ? null : new FormUrlEncodedContent(form)); + return await Read(response, ct); + } public async Task SendJsonAsync(string endpoint, object? payload = null, CancellationToken ct = default) { Count++; using var response = await CsrfTestClient.PostJsonAsync(http, endpoint, payload); return await Read(response, ct); } + + public Task GetLoginTransportAsync(string endpoint, CancellationToken ct = default) + { + return Task.FromResult(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true, + AccessTokenInHeader = false + }); + } + + public Task NavigateToUrlAsync(string url, CancellationToken ct = default) + { + throw new NotSupportedException(); + } + + public Task NavigateToPkceReturnUrlAsync(string redirectUrl, string expectedReturnUrl, CancellationToken ct = default) + { + throw new NotSupportedException(); + } + private static async Task Read(HttpResponseMessage response, CancellationToken ct) { var body = await response.Content.ReadAsStringAsync(ct); diff --git a/tests/CodeBeam.UltimateAuth.Tests.Integration/Infrastructure/AuthServerFactory.cs b/tests/CodeBeam.UltimateAuth.Tests.Integration/Infrastructure/AuthServerFactory.cs index fd1340a4..5dfb4dbd 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Integration/Infrastructure/AuthServerFactory.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Integration/Infrastructure/AuthServerFactory.cs @@ -3,6 +3,7 @@ using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.MultiTenancy; +using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Credentials.Contracts; using CodeBeam.UltimateAuth.Credentials.Reference; using CodeBeam.UltimateAuth.Server.Infrastructure; @@ -64,6 +65,8 @@ protected override void ConfigureWebHost(IWebHostBuilder builder) // Business-flow tests share a host; limiter contracts use isolated hosts. services.PostConfigure(options => { + // TODO: Decouple test projects and remove UAuthHub sample dependency. This is a temporary workaround to avoid UAuthHub sample's default cookie delivery mode from interfering with the tests. + options.GrantDelivery.Default = GrantDeliveryMode.Cookie; options.RateLimiting.Enabled = false; options.Login.IncludeFailureDetails = false; options.DeviceLimits.MaxDevices = null; diff --git a/tests/CodeBeam.UltimateAuth.Tests.Integration/LoginTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Integration/LoginTests.cs index c5415251..586aac5b 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Integration/LoginTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Integration/LoginTests.cs @@ -1,8 +1,10 @@ -using CodeBeam.UltimateAuth.Core.Contracts; +using AwesomeAssertions; +using CodeBeam.UltimateAuth.Core; +using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; +using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Tests.Integration.Infrastructure; using CodeBeam.UltimateAuth.Users.Contracts; -using AwesomeAssertions; using Microsoft.AspNetCore.Mvc.Testing; using System.Net; using System.Net.Http.Json; @@ -1856,6 +1858,85 @@ public async Task ConcurrentLogin_WithSamePreviewReceipt_ShouldNotAllowReceiptTo failureState.LockoutUntilUtc.Should().BeNull(); } + [Fact] + public async Task HybridLogin_WithSessionCookieAndBearerToken_ShouldValidate() + { + using var factory = AuthServerFactory.Create(options => + { + options.AuthMode = UAuthMode.Hybrid; + options.GrantDelivery.Session.Mode = GrantDeliveryMode.Cookie; + options.GrantDelivery.AccessToken.Mode = GrantDeliveryMode.Header; + options.GrantDelivery.RefreshToken.Mode = GrantDeliveryMode.Cookie; + }); + + var ct = TestContext.Current.CancellationToken; + + var user = await factory.CreateLoginUserAsync(ct: ct); + + var deviceId = $"hybrid-regression-{Guid.NewGuid():N}"; + + using var client = CreateClient(factory, deviceId); + + client.DefaultRequestHeaders.Add("X-UDID", deviceId); + + client.DefaultRequestHeaders.Add( + "X-UAuth-ApplicationProfile", "BlazorWasm"); + + client.DefaultRequestHeaders.Add( + "X-Requested-With", "UAuth"); + + using var content = new FormUrlEncodedContent( + new Dictionary + { + ["Identifier"] = user.Identifier, + ["Secret"] = user.Secret, + ["__uauth_response_mode"] = "fetch" + }); + + using var login = await CsrfTestClient.PostAsync( + client, + "/auth/login", + content); + + login.StatusCode.Should().Be(HttpStatusCode.OK); + + login.Headers.GetValues("X-UAuth-Access-Format") + .Single().Should().Be("opaque"); + + var accessToken = login.Headers + .GetValues("uat") + .Single(); + + accessToken.Should().StartWith("Bearer "); + + var sessionCookie = GetSessionCookie(login); + + sessionCookie.Should().NotBeNullOrWhiteSpace(); + + client.DefaultRequestHeaders.Add( + "Cookie", sessionCookie); + + client.DefaultRequestHeaders.Authorization = + System.Net.Http.Headers.AuthenticationHeaderValue + .Parse(accessToken); + + using var validation = await CsrfTestClient.PostAsync( + client, + "/auth/validate"); + + validation.StatusCode.Should().Be(HttpStatusCode.OK); + + var result = await validation.Content + .ReadFromJsonAsync( + cancellationToken: ct); + + result.Should().NotBeNull(); + result!.IsValid.Should().BeTrue(); + result.State.Should().Be(SessionState.Active); + result.Snapshot.Should().NotBeNull(); + result.Snapshot!.Identity.UserKey.Should().Be(user.UserKey); + } + private static AuthServerFactory CreateDetailedFailureFactory() { diff --git a/tests/CodeBeam.UltimateAuth.Tests.Integration/RateLimitingTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Integration/RateLimitingTests.cs index cdd89255..ee0b4740 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Integration/RateLimitingTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Integration/RateLimitingTests.cs @@ -186,12 +186,18 @@ public async Task EveryMappedEndpointHasOneClassification() /auth/antiforgery/token|AntiforgeryToken|Frequent /auth/admin/users/{userKey}/authentication/lockout/get|GetAuthenticationLockoutAdmin|Standard /auth/admin/users/{userKey}/authentication/unlock|UnlockAuthenticationAdmin|Sensitive +/auth/login/transport|LoginTransport|Standard """; var actual = routes.Cast().Select(endpoint => { var metadata = Assert.Single(endpoint.Metadata, m => m.GetType().Name == "UAuthRateLimitMetadata"); var type = metadata.GetType(); - var expectedMethods = endpoint.RoutePattern.RawText == "/auth/antiforgery/token" ? new[] { "GET" } : new[] { "POST" }; + var expectedMethods = endpoint.RoutePattern.RawText switch + { + "/auth/antiforgery/token" => new[] { "GET" }, + "/auth/login/transport" => new[] { "GET" }, + _ => new[] { "POST" } + }; Assert.Equal(expectedMethods, endpoint.Metadata.GetMetadata()!.HttpMethods); return $"{endpoint.RoutePattern.RawText}|{type.GetProperty("Endpoint")!.GetValue(metadata)}|{type.GetProperty("Group")!.GetValue(metadata)}"; diff --git a/tests/CodeBeam.UltimateAuth.Tests.Integration/RefreshTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Integration/RefreshTests.cs index 307b7abe..2f8f0765 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Integration/RefreshTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Integration/RefreshTests.cs @@ -1,9 +1,11 @@ -using CodeBeam.UltimateAuth.Core.Abstractions; +using AwesomeAssertions; +using CodeBeam.UltimateAuth.Core; +using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.MultiTenancy; +using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Tests.Integration.Infrastructure; -using AwesomeAssertions; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.DependencyInjection; using System.Net; @@ -2442,26 +2444,34 @@ await CsrfTestClient.PostAsync(attacker, [Fact] public async Task Refresh_Hybrid_Maui_HeaderCredentials_ShouldSupportConsecutiveRefreshes() { - _factory.Clock.Reset(); + using var factory = AuthServerFactory.Create(options => + { + options.AuthMode = UAuthMode.Hybrid; + options.GrantDelivery.Default = GrantDeliveryMode.Header; + }); - var user = await _factory.CreateLoginUserAsync(ct: TestContext.Current.CancellationToken); + factory.Clock.Reset(); + + var user = await factory.CreateLoginUserAsync( + ct: TestContext.Current.CancellationToken); using var client = CreateClient( + factory, $"maui-refresh-{Guid.NewGuid():N}"); SetApplicationProfile(client, "Maui"); - // Login with CSRF protection. - using var login = await CsrfTestClient.PostJsonAsync( + using var login = await CsrfTestClient.PostAsync( client, "/auth/login", - new + new FormUrlEncodedContent(new Dictionary { - identifier = user.Identifier, - secret = user.Secret - }); + ["Identifier"] = user.Identifier, + ["Secret"] = user.Secret, + ["__uauth_response_mode"] = "fetch" + })); - login.StatusCode.Should().Be(HttpStatusCode.Found); + login.StatusCode.Should().Be(HttpStatusCode.OK); var sessionId = ReadCredential(login, "uas"); var refreshToken = ReadCredential(login, "uar"); diff --git a/tests/CodeBeam.UltimateAuth.Tests.Integration/Server/UAuthServerStatusAuthorizationTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Integration/Server/UAuthServerStatusAuthorizationTests.cs index 7664cbc1..94a75301 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Integration/Server/UAuthServerStatusAuthorizationTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Integration/Server/UAuthServerStatusAuthorizationTests.cs @@ -171,8 +171,11 @@ public async Task ExistingSession_ShouldReflectUserStateChanges() restored.StatusCode.Should().Be(HttpStatusCode.OK); } - [Fact] - public async Task ResourceApi_PureOpaque_WithoutSessionValidation_ShouldForbid() + [Theory] + [InlineData(UAuthMode.PureOpaque)] + [InlineData(UAuthMode.Hybrid)] + [InlineData(UAuthMode.SemiHybrid)] + public async Task ResourceApi_SessionMode_WithoutSessionValidation_ShouldForbid(UAuthMode mode) { var builder = WebApplication.CreateBuilder(); builder.WebHost.UseTestServer(); @@ -182,7 +185,7 @@ public async Task ResourceApi_PureOpaque_WithoutSessionValidation_ShouldForbid() { Auth = new UAuthResourceAuthOptions { - Mode = UAuthMode.PureOpaque + Mode = mode } })); @@ -244,13 +247,18 @@ public async Task ResourceApi_PureOpaque_WithoutSessionValidation_ShouldForbid() } [Fact] - public async Task ResourceApi_DefaultPureJwt_ShouldAuthorizeWithoutSessionValidation() + public async Task ResourceApi_PureJwt_ShouldAuthorizeWithoutSessionValidation() { var builder = WebApplication.CreateBuilder(); builder.WebHost.UseTestServer(); - // Resource API mode is intentionally not explicitly configured. - var resourceOptions = new UAuthResourceApiOptions(); + var resourceOptions = new UAuthResourceApiOptions + { + Auth = new UAuthResourceAuthOptions + { + Mode = UAuthMode.PureJwt + } + }; builder.Services.AddSingleton>( Options.Create(resourceOptions)); diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Bunit/UAuthLoginFormTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Bunit/UAuthLoginFormTests.cs index 9f7540b6..3cb8eb30 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Bunit/UAuthLoginFormTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Bunit/UAuthLoginFormTests.cs @@ -1,7 +1,10 @@ using AwesomeAssertions; using Bunit; using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Abstractions; using CodeBeam.UltimateAuth.Client.Blazor; +using CodeBeam.UltimateAuth.Client.Events; +using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; @@ -28,6 +31,8 @@ public UAuthLoginFormContextTests() Services.AddSingleton(_flows.Object); Services.AddSingleton(_capabilities.Object); Services.AddSingleton>(Options.Create(new UAuthClientOptions())); + Services.AddSingleton(new InMemoryUAuthTokenStore()); + Services.AddSingleton(Mock.Of()); } [Fact] diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormSubmissionTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormSubmissionTests.cs index 6767de08..5f50a1e4 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormSubmissionTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormSubmissionTests.cs @@ -1,7 +1,12 @@ using AwesomeAssertions; using Bunit; using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Abstractions; using CodeBeam.UltimateAuth.Client.Blazor; +using CodeBeam.UltimateAuth.Client.Contracts; +using CodeBeam.UltimateAuth.Client.Errors; +using CodeBeam.UltimateAuth.Client.Events; +using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; @@ -29,6 +34,8 @@ public UAuthLoginFormSubmissionTests() Services.AddSingleton(_flows.Object); Services.AddSingleton(_capabilities.Object); Services.AddSingleton>(Options.Create(new UAuthClientOptions())); + Services.AddSingleton(); + Services.AddSingleton(); } private static JsonElement Json(string value) => JsonDocument.Parse(value).RootElement.Clone(); @@ -253,4 +260,202 @@ await act.Should().ThrowAsync() .WithMessage("Missing PKCE credentials."); JSInterop.Invocations.Should().NotContain(x => x.Identifier == "uauth.submitLoginForm"); } + + [Fact] + public async Task SuccessfulFetchCommit_StoresAccessToken() + { + var response = new + { + commit = new UAuthTransportResult + { + Ok = true, + Status = 200, + AccessToken = "Bearer form-jwt", + AccessTokenFormat = "jwt", + AccessTokenHeaderFormat = "bearer", + AccessTokenExpiresAt = + DateTimeOffset.UtcNow.AddMinutes(10).ToString("O") + }, + accessTokenInHeader = true + }; + + ConfigureResult(JsonSerializer.Serialize(response)); + + var cut = Render(p => p + .Add(x => x.SubmitMode, UAuthSubmitMode.DirectCommit)); + + await cut.InvokeAsync(() => cut.Instance.SubmitAsync()); + + var store = Services.GetRequiredService(); + + store.Read().Should().NotBeNull(); + store.Read()!.Token.Should().Be("form-jwt"); + store.Read()!.Format.Should().Be(TokenFormat.Jwt); + + cut.Instance.IsSubmitting.Should().BeFalse(); + } + + [Fact] + public async Task FetchCommit_WithoutRequiredToken_RejectsCompletion() + { + var response = new + { + commit = new UAuthTransportResult + { + Ok = true, + Status = 200 + }, + accessTokenInHeader = true + }; + + ConfigureResult(JsonSerializer.Serialize(response)); + + var cut = Render(p => p + .Add(x => x.SubmitMode, UAuthSubmitMode.DirectCommit)); + + var act = () => cut.InvokeAsync( + () => cut.Instance.SubmitAsync()); + + await act.Should() + .ThrowAsync() + .WithMessage("*required access token*"); + + Services.GetRequiredService() + .Read().Should().BeNull(); + + cut.Instance.IsSubmitting.Should().BeFalse(); + } + + [Fact] + public async Task PkceHandoff_RejectsDifferentReturnUrl_WithoutStoringToken() + { + var hubId = HubSessionId.New(); + + _capabilities.SetupGet(x => x.SupportsPkce) + .Returns(true); + + _credentials.Setup(x => x.ResolveAsync( + hubId, It.IsAny())) + .ReturnsAsync(new HubCredentials + { + AuthorizationCode = "authorization-code", + CodeVerifier = "verifier" + }); + + _flows.Setup(x => x.GetStateAsync( + hubId, It.IsAny())) + .ReturnsAsync(new HubFlowState + { + HubSessionId = hubId, + ReturnUrl = "https://localhost:6132/home" + }); + + var response = new + { + commit = new UAuthTransportResult + { + Ok = true, + Status = 200, + AccessToken = "Bearer hub-jwt", + AccessTokenFormat = "jwt", + AccessTokenHeaderFormat = "bearer", + AccessTokenExpiresAt = + DateTimeOffset.UtcNow.AddMinutes(10).ToString("O"), + Body = JsonSerializer.SerializeToElement(new + { + redirectUrl = "https://evil.example/home" + }) + }, + accessTokenInHeader = true + }; + + ConfigureResult(JsonSerializer.Serialize(response)); + + var cut = Render(p => p + .Add(x => x.LoginType, UAuthLoginType.Pkce) + .Add(x => x.HubSessionId, hubId) + .Add(x => x.SubmitMode, UAuthSubmitMode.DirectCommit)); + + var act = () => cut.InvokeAsync( + () => cut.Instance.SubmitAsync()); + + await act.Should().ThrowAsync() + .WithMessage("*Invalid PKCE handoff redirect*"); + + Services.GetRequiredService() + .Read().Should().BeNull(); + } + + [Fact] + public async Task PkceHandoff_SuccessfulRedirect_DoesNotStoreTokenOrPublishLogin() + { + var hubId = HubSessionId.New(); + const string returnUrl = "https://localhost:6132/home"; + + _capabilities.SetupGet(x => x.SupportsPkce) + .Returns(true); + + _credentials.Setup(x => x.ResolveAsync( + hubId, It.IsAny())) + .ReturnsAsync(new HubCredentials + { + AuthorizationCode = "auth-code", + CodeVerifier = "verifier" + }); + + _flows.Setup(x => x.GetStateAsync( + hubId, It.IsAny())) + .ReturnsAsync(new HubFlowState + { + HubSessionId = hubId, + ReturnUrl = returnUrl + }); + + var events = Services.GetRequiredService(); + var published = new List(); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + ConfigureResult(JsonSerializer.Serialize(new + { + commit = new UAuthTransportResult + { + Ok = true, + Status = 200, + AccessToken = "Bearer initiating-app-jwt", + AccessTokenFormat = "jwt", + AccessTokenHeaderFormat = "bearer", + AccessTokenExpiresAt = + DateTimeOffset.UtcNow.AddMinutes(10).ToString("O"), + Body = JsonSerializer.SerializeToElement(new + { + redirectUrl = returnUrl + }) + }, + accessTokenInHeader = true + })); + + var cut = Render(p => p + .Add(x => x.LoginType, UAuthLoginType.Pkce) + .Add(x => x.HubSessionId, hubId) + .Add(x => x.SubmitMode, UAuthSubmitMode.DirectCommit)); + + await cut.InvokeAsync(() => cut.Instance.SubmitAsync()); + + var store = Services.GetRequiredService(); + store.Read().Should().BeNull(); + + published.Should().BeEmpty(); + + var navigation = Services.GetRequiredService< + Microsoft.AspNetCore.Components.NavigationManager>(); + + navigation.Uri.Should().Be(returnUrl); + + cut.Instance.IsSubmitting.Should().BeFalse(); + } } diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormTests.cs index 807420e6..28f9a5fe 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthLoginFormTests.cs @@ -1,12 +1,15 @@ -using Bunit; +using AwesomeAssertions; +using Bunit; using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Abstractions; using CodeBeam.UltimateAuth.Client.Blazor; +using CodeBeam.UltimateAuth.Client.Events; +using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Defaults; using CodeBeam.UltimateAuth.Core.Domain; -using AwesomeAssertions; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; @@ -34,6 +37,8 @@ public UAuthLoginFormTests() Services.AddSingleton(_hubCredentialResolver.Object); Services.AddSingleton(_hubFlowReader.Object); Services.AddSingleton(_hubCapabilities.Object); + Services.AddSingleton(); + Services.AddSingleton(); _deviceIdProvider .Setup(x => x.GetOrCreateAsync( diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthRequestClientTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthRequestClientTests.cs index 86c2a05f..fb66e4a8 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthRequestClientTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/Blazor/UAuthRequestClientTests.cs @@ -1,11 +1,14 @@ -using Bunit; +using AwesomeAssertions; +using Bunit; +using Bunit.TestDoubles; using CodeBeam.UltimateAuth.Client.Blazor.Infrastructure; using CodeBeam.UltimateAuth.Client.Contracts; using CodeBeam.UltimateAuth.Client.Errors; using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Core.Options; -using AwesomeAssertions; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Moq; @@ -34,7 +37,9 @@ private UAuthRequestClient CreateSut(UAuthApplicationProfile profile = UAuthAppl if (basePath is not null) options.Endpoints.BasePath = basePath; - return new UAuthRequestClient(JSInterop.JSRuntime, _bootstrapper.Object, Options.Create(options)); + var navigation = Services.GetRequiredService(); + + return new UAuthRequestClient(JSInterop.JSRuntime, _bootstrapper.Object, Options.Create(options), new InMemoryUAuthTokenStore(), navigation); } [Fact] @@ -211,6 +216,244 @@ public async Task SendFormAsync_ResolvesTrustedOriginCorrectly(string basePath, .Should().Be(expectedOrigin); } + + [Theory] + [InlineData(true, "logout")] + [InlineData(false, "logout-observe")] + public async Task LogoutTransport_UsesExpectedJavascriptMode(bool navigate, string expectedMode) + { + var expected = new UAuthTransportResult + { + Ok = true, + Status = 200 + }; + + JSInterop + .Setup("uauth.post", _ => true) + .SetResult(expected); + + var result = await CreateSut().SendFormAsync( + "/auth/logout", + null, + navigateOnSuccess: navigate, Xunit.TestContext.Current.CancellationToken); + + result.Should().BeSameAs(expected); + + var invocation = JSInterop.Invocations + .Single(x => x.Identifier == "uauth.post"); + + GetProperty( + invocation.Arguments.Single()!, "mode") + .Should().Be(expectedMode); + } + + [Fact] + public async Task LogoutTransport_RejectsNullJavascriptResponse() + { + JSInterop + .Setup("uauth.post", _ => true) + .SetResult(null!); + + var act = () => CreateSut().SendFormAsync( + "/auth/logout", + null, + navigateOnSuccess: false); + + await act.Should().ThrowAsync() + .WithMessage("*logout transport response*"); + } + + [Fact] + public async Task LogoutTransport_RejectsUnconfirmedNetworkResult() + { + JSInterop + .Setup("uauth.post", _ => true) + .SetResult(new UAuthTransportResult + { + Status = 0 + }); + + var act = () => CreateSut().SendFormAsync( + "/auth/logout", + null, + navigateOnSuccess: true); + + await act.Should() + .ThrowAsync() + .WithMessage("Could not confirm server logout."); + } + + [Fact] + public async Task GetLoginTransportAsync_DeserializesCapabilities() + { + JSInterop + .Setup("uauth.getLoginTransport", _ => true) + .SetResult(new UAuthTransportResult + { + Ok = true, + Status = 200, + Body = System.Text.Json.JsonSerializer.SerializeToElement( + new + { + supported = true, + navigationSupported = false, + accessTokenInHeader = true + }) + }); + + var result = await CreateSut().GetLoginTransportAsync("/auth/login/transport", Xunit.TestContext.Current.CancellationToken); + + result.Supported.Should().BeTrue(); + result.NavigationSupported.Should().BeFalse(); + result.AccessTokenInHeader.Should().BeTrue(); + + JSInterop.VerifyInvoke("uauth.getLoginTransport", 1); + } + + [Theory] + [InlineData(false, 200)] + [InlineData(true, 401)] + public async Task GetLoginTransportAsync_RejectsFailedResponse(bool ok, int status) + { + JSInterop + .Setup("uauth.getLoginTransport", _ => true) + .SetResult(new UAuthTransportResult + { + Ok = ok, + Status = status + }); + + var act = () => CreateSut().GetLoginTransportAsync( + "/auth/login/transport"); + + await act.Should().ThrowAsync(); + } + + [Theory] + [InlineData("https://evil.example/")] + [InlineData("//evil.example/")] + [InlineData(@"\\evil.example\")] + public async Task NavigateToUrlAsync_RejectsUnsafeDestination( + string destination) + { + var act = () => CreateSut() + .NavigateToUrlAsync(destination); + + await act.Should().ThrowAsync(); + } + + [Fact] + public async Task SendFormAsync_WithExplicitToken_ForwardsTokenToJavascript() + { + JSInterop + .Setup("uauth.post", _ => true) + .SetResult(new UAuthTransportResult + { + Ok = true, + Status = 200 + }); + + await CreateSut().SendFormAsync( + "/auth/validate", + form: null, + accessToken: "jwt-value", Xunit.TestContext.Current.CancellationToken); + + var invocation = JSInterop.Invocations + .Single(x => x.Identifier == "uauth.post"); + + var argument = invocation.Arguments.Single()!; + + GetProperty(argument, "mode") + .Should().Be("fetch"); + + GetProperty(argument, "accessToken") + .Should().Be("jwt-value"); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task NavigateToPkceReturnUrlAsync_UsesExpectedNavigationMode( + bool crossOrigin) + { + var navigation = Services.GetRequiredService(); + + var target = crossOrigin + ? "https://client.example.com/home" + : new Uri(new Uri(navigation.BaseUri), "home").AbsoluteUri; + + var sut = CreateSut(); + + await sut.NavigateToPkceReturnUrlAsync( + target, + target, + Xunit.TestContext.Current.CancellationToken); + + navigation.Uri.Should().Be(target); + + var fakeNavigation = (BunitNavigationManager)navigation; + + var entry = Assert.Single(fakeNavigation.History); + + entry.Options.ForceLoad.Should().Be(crossOrigin); + } + + [Theory] + [InlineData("/home", "/home")] + [InlineData("https://client.example.com/home", "/home")] + [InlineData("/home", "https://client.example.com/home")] + [InlineData("https://evil.example.com/home", "https://client.example.com/home")] + [InlineData("https://client.example.com/other", "https://client.example.com/home")] + [InlineData("https://client.example.com/home?x=1", "https://client.example.com/home")] + [InlineData("http://client.example.com/home", "https://client.example.com/home")] + [InlineData("https://client.example.com:8443/home", "https://client.example.com/home")] + [InlineData("ftp://client.example.com/home", "ftp://client.example.com/home")] + [InlineData("https://user@client.example.com/home", "https://user@client.example.com/home")] + public async Task NavigateToPkceReturnUrlAsync_RejectsInvalidDestination( + string redirectUrl, + string expectedReturnUrl) + { + var navigation = Services.GetRequiredService(); + var originalUri = navigation.Uri; + + var sut = CreateSut(); + + Func act = () => sut.NavigateToPkceReturnUrlAsync( + redirectUrl, + expectedReturnUrl); + + await act.Should() + .ThrowAsync() + .WithMessage( + "PKCE return URL is invalid or does not match the expected destination."); + + navigation.Uri.Should().Be(originalUri); + } + + [Fact] + public async Task NavigateToPkceReturnUrlAsync_WhenCancelled_DoesNotNavigate() + { + using var cts = new CancellationTokenSource(); + cts.Cancel(); + + var navigation = Services.GetRequiredService(); + var originalUri = navigation.Uri; + + const string target = "https://client.example.com/home"; + + var sut = CreateSut(); + + Func act = () => sut.NavigateToPkceReturnUrlAsync( + target, + target, + cts.Token); + + await act.Should().ThrowAsync(); + + navigation.Uri.Should().Be(originalUri); + } + + private sealed class TestTryResult { } diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/ClientRateLimitingTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/ClientRateLimitingTests.cs index 527a1367..8efd62b1 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/ClientRateLimitingTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/ClientRateLimitingTests.cs @@ -1,6 +1,5 @@ -using System.Net; -using System.Text.Json; using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Abstractions; using CodeBeam.UltimateAuth.Client.Authentication; using CodeBeam.UltimateAuth.Client.Blazor; using CodeBeam.UltimateAuth.Client.Blazor.Infrastructure; @@ -11,6 +10,7 @@ using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Client.Services; +using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.MultiTenancy; @@ -18,6 +18,8 @@ using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Options; using Moq; +using System.Net; +using System.Text.Json; namespace CodeBeam.UltimateAuth.Tests.Unit; @@ -52,30 +54,95 @@ public void RetryAfterParsesHttpDateAndPastDate() public async Task ValidationThrottlePreservesStateAndBlazorPrincipal_ThenRevocationStillClears(string? retry) { var clock = new TestClock(); + var snapshot = new AuthStateSnapshot { Identity = new AuthIdentitySnapshot - { UserKey = UserKey.FromString("rate-user"), Tenant = TenantKey.Single }, + { + UserKey = UserKey.FromString("rate-user"), + Tenant = TenantKey.Single + }, Claims = ClaimsSnapshot.Empty }; - Request.SetupSequence(x => x.SendFormAsync("/auth/validate", null, It.IsAny())) - .ReturnsAsync(new UAuthTransportResult { Status = 200, Ok = true, Body = JsonSerializer.SerializeToElement(new AuthValidationResult { State = SessionState.Active, Snapshot = snapshot }) }) - .ReturnsAsync(new UAuthTransportResult { Status = 429, RetryAfter = retry }) - .ReturnsAsync(new UAuthTransportResult { Status = 200, Ok = true, Body = JsonSerializer.SerializeToElement(new AuthValidationResult { State = SessionState.Revoked }) }); - using var manager = new UAuthStateManager(CreateClient(flows: CreateFlowClient()), Events.Object, clock); + + Request.SetupSequence(x => x.SendFormAsync( + "/auth/validate", + null, + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Status = 200, + Ok = true, + Body = JsonSerializer.SerializeToElement( + new AuthValidationResult + { + State = SessionState.Active, + Snapshot = snapshot + }) + }) + .ReturnsAsync(new UAuthTransportResult + { + Status = 429, + RetryAfter = retry + }) + .ReturnsAsync(new UAuthTransportResult + { + Status = 200, + Ok = true, + Body = JsonSerializer.SerializeToElement( + new AuthValidationResult + { + State = SessionState.Revoked + }) + }); + + using var manager = NewManager( + CreateClient(flows: CreateFlowClient()), + Events.Object, + clock); + var provider = new UAuthAuthenticationStateProvider(manager); - await manager.EnsureAsync(ct: TestContext.Current.CancellationToken); + + await manager.EnsureAsync( + ct: TestContext.Current.CancellationToken); + var lastValidated = manager.State.LastValidatedAt; - await manager.EnsureAsync(force: true, ct: TestContext.Current.CancellationToken); - await manager.EnsureAsync(force: true, ct: TestContext.Current.CancellationToken); + + await manager.EnsureAsync( + force: true, + ct: TestContext.Current.CancellationToken); + + await manager.EnsureAsync( + force: true, + ct: TestContext.Current.CancellationToken); + Assert.True(manager.State.IsAuthenticated); - Assert.True((await provider.GetAuthenticationStateAsync()).User.Identity!.IsAuthenticated); + + Assert.True( + (await provider.GetAuthenticationStateAsync()) + .User.Identity!.IsAuthenticated); + Assert.Equal(lastValidated, manager.State.LastValidatedAt); - Request.Verify(x => x.SendFormAsync("/auth/validate", null, It.IsAny()), Times.Exactly(2)); + + Request.Verify(x => x.SendFormAsync( + "/auth/validate", + null, + It.IsAny(), + It.IsAny()), + Times.Exactly(2)); + clock.Advance(TimeSpan.FromMinutes(2)); - await manager.EnsureAsync(force: true, ct: TestContext.Current.CancellationToken); + + await manager.EnsureAsync( + force: true, + ct: TestContext.Current.CancellationToken); + Assert.False(manager.State.IsAuthenticated); - Assert.False((await provider.GetAuthenticationStateAsync()).User.Identity!.IsAuthenticated); + + Assert.False( + (await provider.GetAuthenticationStateAsync()) + .User.Identity!.IsAuthenticated); } [Theory] @@ -178,4 +245,15 @@ public async Task AutomaticRefreshDefersThrottle_ThenHonorsReal401(int? seconds) Assert.True(diagnostics.IsTerminated); flows.Verify(x => x.RefreshAsync(true), Times.Exactly(2)); } + + private static UAuthStateManager NewManager(IUAuthClient client, IUAuthClientEvents events, IClock clock) + { + return new UAuthStateManager( + client, + events, + clock, + new Mock().Object, + new Mock().Object, + Options.Create(new UAuthClientOptions())); + } } diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthFlowClientTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthFlowClientTests.cs index dbae2494..f3b7b7c5 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthFlowClientTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthFlowClientTests.cs @@ -22,7 +22,11 @@ public class UAuthFlowClientTests : UAuthClientTestBase { private readonly Mock _mockRequest = new(); - private UAuthFlowClient CreateClient(Mock? requestMock = null, UAuthClientDiagnostics? diagnostics = null) + private UAuthFlowClient CreateClient( + Mock? requestMock = null, + UAuthClientDiagnostics? diagnostics = null, + IUAuthTokenStore? tokenStore = null, + IUAuthClientEvents? clientEvents = null) { var request = requestMock ?? new Mock(); @@ -56,11 +60,22 @@ private UAuthFlowClient CreateClient(Mock? requestMock = nu return new UAuthFlowClient( request.Object, - events.Object, + clientEvents ?? events.Object, deviceProvider.Object, returnUrlProvider.Object, options, - diagnostics ?? new UAuthClientDiagnostics()); + diagnostics ?? new UAuthClientDiagnostics(), + tokenStore ?? new InMemoryUAuthTokenStore()); + } + + private static AccessToken CreateStoredToken() + { + return new AccessToken + { + Token = "existing-jwt", + Format = TokenFormat.Jwt, + ExpiresAt = DateTimeOffset.UtcNow.AddMinutes(10) + }; } private static UAuthTransportResult TryLoginResponse(bool success, AuthFailureReason? reason = null) @@ -76,6 +91,49 @@ private static UAuthTransportResult TryLoginResponse(bool success, AuthFailureRe }; } + private static Mock CreatePkceFetchRequestMock( + UAuthTransportResult response) + { + var mock = new Mock(); + + mock.Setup(x => x.GetLoginTransportAsync( + "/auth/login/transport", + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = false, + AccessTokenInHeader = true + }); + + mock.Setup(x => x.SendFormAsync( + "/auth/pkce/complete", + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(response); + + return mock; + } + + private static UAuthTransportResult CreatePkceFetchResponse( + string? redirectUrl = null) + { + return new UAuthTransportResult + { + Ok = true, + Status = 200, + AccessToken = "Bearer pkce-jwt", + AccessTokenFormat = "jwt", + AccessTokenHeaderFormat = "bearer", + AccessTokenExpiresAt = + DateTimeOffset.UtcNow.AddMinutes(10).ToString("O"), + Body = JsonSerializer.SerializeToElement(new + { + redirectUrl + }) + }; + } + [Fact] public async Task TryLogin_Should_Call_TryLogin_Endpoint() { @@ -160,6 +218,16 @@ public async Task TryLogin_DirectCommit_Should_Navigate() { var mock = new Mock(); + mock.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true, + AccessTokenInHeader = false + }); + mock.Setup(x => x.NavigateAsync( It.IsAny(), It.IsAny>(), @@ -168,35 +236,75 @@ public async Task TryLogin_DirectCommit_Should_Navigate() var client = CreateClient(mock); - var request = new LoginRequest - { - Identifier = "admin", - Secret = "admin" - }; + var result = await client.TryLoginAsync( + new LoginRequest + { + Identifier = "admin", + Secret = "admin" + }, + UAuthSubmitMode.DirectCommit, + transport: UAuthLoginTransport.Navigation); - var result = await client.TryLoginAsync(request, UAuthSubmitMode.DirectCommit); result.IsSuccess.Should().BeTrue(); - mock.Verify(x => x.NavigateAsync("/auth/login", - It.Is>(d => d["Identifier"] == "admin" && d["Secret"] == "admin"), It.IsAny()), + mock.Verify(x => x.NavigateAsync( + "/auth/login", + It.Is>(d => + d["Identifier"] == "admin" && + d["Secret"] == "admin"), + It.IsAny()), Times.Once); } [Fact] - public async Task TryLogin_TryAndCommit_Should_Call_TryAndCommit() + public async Task TryLogin_TryAndCommit_Should_Try_Then_Commit() { var mock = new Mock(); - mock.Setup(x => x.TryAndCommitAsync( + mock.Setup(x => x.SendJsonAsync( + "/auth/try-login", + It.IsAny(), + It.IsAny())) + .ReturnsAsync(TryLoginResponse(true)); + + mock.Setup(x => x.GetLoginTransportAsync( It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true, + AccessTokenInHeader = false + }); + + mock.Setup(x => x.NavigateAsync( It.IsAny(), - It.IsAny())) - .ReturnsAsync(new TryLoginResult { IsSuccess = true }); + It.IsAny>(), + It.IsAny())) + .Returns(Task.CompletedTask); var client = CreateClient(mock); - var result = await client.TryLoginAsync(new LoginRequest(), UAuthSubmitMode.TryAndCommit); + + var result = await client.TryLoginAsync( + new LoginRequest + { + Identifier = "admin", + Secret = "admin" + }, + UAuthSubmitMode.TryAndCommit, + transport: UAuthLoginTransport.Navigation); result.IsSuccess.Should().BeTrue(); + + mock.Verify(x => x.SendJsonAsync( + "/auth/try-login", + It.IsAny(), + It.IsAny()), Times.Once); + + mock.Verify(x => x.NavigateAsync( + "/auth/login", + It.IsAny>(), + It.IsAny()), Times.Once); } [Fact] @@ -218,7 +326,8 @@ public async Task TryLogin_Should_Throw_When_CredentialPost_Disabled() Mock.Of(), Mock.Of(), options, - new UAuthClientDiagnostics()); + new UAuthClientDiagnostics(), + new InMemoryUAuthTokenStore()); Func act = async () => await client.TryLoginAsync(new LoginRequest(), UAuthSubmitMode.TryOnly); await act.Should().ThrowAsync(); @@ -275,17 +384,19 @@ public async Task Validate_Should_Return_Result() var mock = new Mock(); mock.Setup(x => x.SendFormAsync( - It.IsAny(), - It.IsAny>(), - It.IsAny())) - .ReturnsAsync(new UAuthTransportResult - { - Status = 200, - Body = JsonSerializer.SerializeToElement(new AuthValidationResult + It.IsAny(), + It.IsAny?>(), + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Status = 200, + Body = JsonSerializer.SerializeToElement( + new AuthValidationResult { State = SessionState.Active }) - }); + }); var client = CreateClient(mock); var result = await client.ValidateAsync(); @@ -298,25 +409,41 @@ public async Task Login_Should_Navigate_To_Login_Endpoint() { var mock = new Mock(); + mock.Setup(x => x.GetLoginTransportAsync( + "/auth/login/transport", + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true, + AccessTokenInHeader = false + }); + mock.Setup(x => x.NavigateAsync( - It.IsAny(), - It.IsAny>(), - It.IsAny())) + It.IsAny(), + It.IsAny>(), + It.IsAny())) .Returns(Task.CompletedTask); var client = CreateFlowClient(mock); - await client.LoginAsync(new LoginRequest - { - Identifier = "user", - Secret = "pass" - }); + await client.LoginAsync( + new LoginRequest + { + Identifier = "user", + Secret = "pass" + }, + returnUrl: "/home", + transport: UAuthLoginTransport.Navigation); - mock.Verify(x => x.NavigateAsync("/auth/login", + mock.Verify(x => x.NavigateAsync( + "/auth/login", It.Is>(d => d["Identifier"] == "user" && - d["Secret"] == "pass"), - It.IsAny()), Times.Once); + d["Secret"] == "pass" && + d["__uauth_return_url"] == "/home"), + It.IsAny()), + Times.Once); } [Fact] @@ -392,6 +519,21 @@ public async Task Validate_Should_Publish_Event() var request = new Mock(); var events = new Mock(); + request.Setup(x => x.SendFormAsync( + It.IsAny(), + It.IsAny?>(), + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Status = 200, + Body = JsonSerializer.SerializeToElement( + new AuthValidationResult + { + State = SessionState.Active + }) + }); + request.Setup(x => x.SendFormAsync( It.IsAny(), It.IsAny>(), @@ -417,12 +559,13 @@ public async Task Validate_Should_Throw_On_Status_0() mock.Setup(x => x.SendFormAsync( It.IsAny(), - It.IsAny>(), + It.IsAny?>(), + It.IsAny(), It.IsAny())) - .ReturnsAsync(new UAuthTransportResult - { - Status = 0 - }); + .ReturnsAsync(new UAuthTransportResult + { + Status = 0 + }); var client = CreateFlowClient(mock); Func act = async () => await client.ValidateAsync(); @@ -486,7 +629,8 @@ public async Task BeginPkce_Should_Throw_When_Disabled() Mock.Of(), Mock.Of(), options, - new UAuthClientDiagnostics()); + new UAuthClientDiagnostics(), + new InMemoryUAuthTokenStore()); Func act = async () => await client.BeginPkceAsync(); await act.Should().ThrowAsync(); @@ -592,7 +736,8 @@ public async Task BeginPkce_Should_AutoRedirect_When_Enabled() Mock.Of(), Mock.Of(), options, - new UAuthClientDiagnostics()); + new UAuthClientDiagnostics(), + new InMemoryUAuthTokenStore()); await client.BeginPkceAsync(); mock.Verify(x => x.NavigateAsync("/auth/hub/login", It.IsAny>(), It.IsAny()), Times.Once); @@ -629,15 +774,39 @@ public async Task TryCompletePkce_Should_Call_Try_Endpoint() } [Fact] - public async Task TryCompletePkce_Should_Call_TryAndCommit() + public async Task TryCompletePkce_Should_Try_And_Navigate_When_Supported() { var mock = new Mock(); - mock.Setup(x => x.TryAndCommitAsync( - It.IsAny(), + mock.Setup(x => x.SendJsonAsync( It.IsAny(), It.IsAny())) - .ReturnsAsync(new TryPkceLoginResult { IsSuccess = true }); + .ReturnsAsync(new UAuthTransportResult + { + Status = 200, + Ok = true, + Body = JsonSerializer.SerializeToElement( + new TryPkceLoginResult + { + IsSuccess = true + }) + }); + + mock.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true, + AccessTokenInHeader = false + }); + + mock.Setup(x => x.NavigateAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .Returns(Task.CompletedTask); var client = CreateFlowClient(mock); @@ -652,6 +821,24 @@ public async Task TryCompletePkce_Should_Call_TryAndCommit() UAuthSubmitMode.TryAndCommit); result.IsSuccess.Should().BeTrue(); + + mock.Verify(x => x.SendJsonAsync( + "/auth/pkce/try-complete", + It.IsAny()), + Times.Once); + + mock.Verify(x => x.GetLoginTransportAsync( + "/auth/login/transport", + It.IsAny()), + Times.Once); + + mock.Verify(x => x.NavigateAsync( + "/auth/pkce/complete", + It.Is>(d => + d["authorization_code"] == "code" && + d["code_verifier"] == "verifier"), + It.IsAny()), + Times.Once); } [Fact] @@ -742,7 +929,8 @@ public async Task CompletePkce_Should_Throw_When_Pkce_Disabled() Mock.Of(), Mock.Of(), options, - new UAuthClientDiagnostics()); + new UAuthClientDiagnostics(), + new InMemoryUAuthTokenStore()); Func act = async () => await client.CompletePkceLoginAsync(new PkceCompleteRequest { @@ -980,4 +1168,742 @@ public async Task Refresh_Should_Record_ReauthRequired_On_Failed_Response() diagnostics.RefreshSuccessCount.Should().Be(0); diagnostics.RefreshRotatedCount.Should().Be(0); } + + [Theory] + [InlineData(false, false)] + [InlineData(true, false)] + public async Task Login_Auto_UsesFetch_WhenNavigationIsUnavailableOrNoReturnUrl( + bool navigationSupported, + bool accessTokenRequired) + { + var request = new Mock(); + + request.Setup(x => x.GetLoginTransportAsync( + "/auth/login/transport", + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = navigationSupported, + AccessTokenInHeader = accessTokenRequired + }); + + request.Setup(x => x.SendFormAsync( + "/auth/login", + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = true, + Status = 200 + }); + + var client = CreateClient(request); + + var result = await client.LoginAsync( + new LoginRequest { Identifier = "alice", Secret = "secret" }, + returnUrl: navigationSupported ? null : "/home"); + + result.IsSuccess.Should().BeTrue(); + result.Status.Should().Be(200); + + request.Verify(x => x.SendFormAsync( + "/auth/login", + It.Is>(data => + data["__uauth_response_mode"] == "fetch"), + It.IsAny()), Times.Once); + + request.Verify(x => x.NavigateAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Never); + } + + [Fact] + public async Task Login_Auto_UsesNavigation_WhenSupportedAndReturnUrlExists() + { + var request = new Mock(); + + request.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true + }); + + request.Setup(x => x.NavigateAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .Returns(Task.CompletedTask); + + var result = await CreateClient(request).LoginAsync( + new LoginRequest { Identifier = "alice", Secret = "secret" }, + returnUrl: "/home"); + + result.IsSuccess.Should().BeTrue(); + result.Status.Should().Be(202); + + request.Verify(x => x.NavigateAsync( + "/auth/login", + It.Is>(data => + data["__uauth_return_url"] == "/home"), + It.IsAny()), Times.Once); + + request.Verify(x => x.SendFormAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Never); + } + + [Fact] + public async Task Login_ExplicitNavigation_RejectsHeaderDelivery() + { + var request = new Mock(); + + request.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = false, + AccessTokenInHeader = true + }); + + var client = CreateClient(request); + + var act = () => client.LoginAsync( + new LoginRequest { Identifier = "alice", Secret = "secret" }, + "/home", + UAuthLoginTransport.Navigation); + + await act.Should().ThrowAsync() + .WithMessage("*incompatible*"); + + request.Verify(x => x.NavigateAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Never); + } + + [Fact] + public async Task Login_UnsupportedTransport_DoesNotSubmitCredentials() + { + var request = new Mock(); + + request.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = false + }); + + var client = CreateClient(request); + + var act = () => client.LoginAsync( + new LoginRequest { Identifier = "alice", Secret = "secret" }); + + await act.Should().ThrowAsync(); + + request.Verify(x => x.SendFormAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Never); + } + + [Fact] + public async Task Login_Fetch_RejectsMissingRequiredAccessToken() + { + var request = new Mock(); + + request.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = false, + AccessTokenInHeader = true + }); + + request.Setup(x => x.SendFormAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = true, + Status = 200 + }); + + var client = CreateClient(request); + + var act = () => client.LoginAsync( + new LoginRequest { Identifier = "alice", Secret = "secret" }); + + await act.Should().ThrowAsync() + .WithMessage("*required access token*"); + } + + [Fact] + public async Task Login_Fetch_RejectedResponse_DoesNotNavigate() + { + var request = new Mock(); + + request.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = false + }); + + request.Setup(x => x.SendFormAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = false, + Status = 401 + }); + + var result = await CreateClient(request).LoginAsync( + new LoginRequest { Identifier = "alice", Secret = "wrong" }, + returnUrl: "/home"); + + result.IsSuccess.Should().BeFalse(); + result.Status.Should().Be(401); + + request.Verify(x => x.NavigateToUrlAsync( + It.IsAny(), + It.IsAny()), Times.Never); + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task Logout_Success_ClearsTokenAndPublishesEvent(bool navigate) + { + var request = new Mock(); + var store = new InMemoryUAuthTokenStore(); + var events = new UAuthClientEvents(); + var published = new List(); + + store.Replace(CreateStoredToken()); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + request.Setup(x => x.SendFormAsync( + "/auth/logout", + null, + navigate, + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = true, + Status = 200 + }); + + var client = CreateClient( + request, + tokenStore: store, + clientEvents: events); + + await client.LogoutAsync(navigate); + + store.Read().Should().BeNull(); + published.Should().Equal(UAuthStateEvent.LogoutVariant); + } + + [Theory] + [InlineData(401)] + [InlineData(403)] + [InlineData(500)] + public async Task Logout_Failure_PreservesTokenAndDoesNotPublishLogout(int status) + { + var request = new Mock(); + var store = new InMemoryUAuthTokenStore(); + var events = new UAuthClientEvents(); + var published = new List(); + + var existing = CreateStoredToken(); + store.Replace(existing); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + request.Setup(x => x.SendFormAsync( + "/auth/logout", + null, + false, + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = false, + Status = status + }); + + var client = CreateClient( + request, + tokenStore: store, + clientEvents: events); + + var act = () => client.LogoutAsync(navigate: false); + + await act.Should().ThrowAsync(); + + store.Read().Should().BeSameAs(existing); + published.Should().BeEmpty(); + } + + [Fact] + public async Task Refresh_Success_ReplacesExistingAccessToken() + { + var request = new Mock(); + var store = new InMemoryUAuthTokenStore(); + + var existing = CreateStoredToken(); + store.Replace(existing); + + var expires = DateTimeOffset.UtcNow.AddMinutes(20); + + request.Setup(x => x.SendFormAsync( + "/auth/refresh", + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = true, + Status = 200, + RefreshOutcome = "rotated", + AccessToken = "Bearer rotated-jwt", + AccessTokenFormat = "jwt", + AccessTokenHeaderFormat = "bearer", + AccessTokenExpiresAt = expires.ToString("O") + }); + + var client = CreateClient(request, tokenStore: store); + + var result = await client.RefreshAsync(); + + result.IsSuccess.Should().BeTrue(); + result.Outcome.Should().Be(RefreshOutcome.Rotated); + + var token = store.Read(); + + token.Should().NotBeNull(); + token.Should().NotBeSameAs(existing); + token!.Token.Should().Be("rotated-jwt"); + token.Format.Should().Be(TokenFormat.Jwt); + token.ExpiresAt.Should().Be(expires); + } + + [Fact] + public async Task Refresh_NoOp_WithoutNewToken_PreservesExistingToken() + { + var request = new Mock(); + var store = new InMemoryUAuthTokenStore(); + + var existing = CreateStoredToken(); + store.Replace(existing); + + request.Setup(x => x.SendFormAsync( + "/auth/refresh", + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = true, + Status = 200, + RefreshOutcome = "no-op" + }); + + var client = CreateClient(request, tokenStore: store); + + var result = await client.RefreshAsync(); + + result.IsSuccess.Should().BeTrue(); + result.Outcome.Should().Be(RefreshOutcome.NoOp); + + store.Read().Should().BeSameAs(existing); + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task Refresh_Unauthorized_OnlyRegularRefreshTriggersReauthentication(bool recovery) + { + var request = new Mock(); + var store = new InMemoryUAuthTokenStore(); + var diagnostics = new UAuthClientDiagnostics(); + var events = new UAuthClientEvents(); + var published = new List(); + + var existing = CreateStoredToken(); + store.Replace(existing); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + request.Setup(x => x.SendFormAsync( + "/auth/refresh", + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(new UAuthTransportResult + { + Ok = false, + Status = 401 + }); + + var client = CreateClient( + request, + diagnostics, + store, + events); + + var result = recovery + ? await client.RecoverAsync() + : await client.RefreshAsync(); + + result.IsSuccess.Should().BeFalse(); + result.Status.Should().Be(401); + result.Outcome.Should().Be(RefreshOutcome.ReauthRequired); + + if (recovery) + { + store.Read().Should().BeSameAs(existing); + published.Should().BeEmpty(); + diagnostics.RefreshReauthRequiredCount.Should().Be(0); + } + else + { + store.Read().Should().BeNull(); + + published.Should() + .Equal(UAuthStateEvent.ReauthenticationRequired); + + diagnostics.RefreshReauthRequiredCount.Should().Be(1); + } + } + + [Fact] + public async Task CompletePkce_FetchHandoff_PreservesHubAuthenticationState() + { + const string returnUrl = "https://client.example.com/home"; + + var mock = CreatePkceFetchRequestMock( + CreatePkceFetchResponse(returnUrl)); + + var store = new InMemoryUAuthTokenStore(); + var existing = CreateStoredToken(); + store.Replace(existing); + + var events = new UAuthClientEvents(); + var published = new List(); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + var client = CreateClient( + mock, + tokenStore: store, + clientEvents: events); + + await client.CompletePkceLoginAsync(new PkceCompleteRequest + { + Identifier = "user", + Secret = "pass", + AuthorizationCode = "code", + CodeVerifier = "verifier", + HubSessionId = "hub-session", + ReturnUrl = returnUrl + }); + + mock.Verify(x => x.SendFormAsync( + "/auth/pkce/complete", + It.Is>(d => + d["__uauth_response_mode"] == "fetch" && + d["authorization_code"] == "code" && + d["code_verifier"] == "verifier" && + d["hub_session_id"] == "hub-session"), + It.IsAny()), + Times.Once); + + mock.Verify(x => x.NavigateToPkceReturnUrlAsync( + returnUrl, + returnUrl, + It.IsAny()), + Times.Once); + + mock.Verify(x => x.NavigateToUrlAsync( + It.IsAny(), + It.IsAny()), + Times.Never); + + store.Read().Should().BeSameAs(existing); + published.Should().BeEmpty(); + } + + [Theory] + [InlineData(null, "https://client.example.com/home")] + [InlineData("", "https://client.example.com/home")] + [InlineData(" ", "https://client.example.com/home")] + [InlineData("https://client.example.com/home", null)] + [InlineData("https://client.example.com/home", "")] + [InlineData("https://client.example.com/home", " ")] + public async Task CompletePkce_FetchHandoff_RejectsMissingRedirect( + string? redirectUrl, + string? returnUrl) + { + var mock = CreatePkceFetchRequestMock( + CreatePkceFetchResponse(redirectUrl)); + + var store = new InMemoryUAuthTokenStore(); + + var client = CreateClient(mock, tokenStore: store); + + Func act = () => client.CompletePkceLoginAsync( + new PkceCompleteRequest + { + Identifier = "user", + Secret = "pass", + AuthorizationCode = "code", + CodeVerifier = "verifier", + HubSessionId = "hub-session", + ReturnUrl = returnUrl + }); + + await act.Should() + .ThrowAsync() + .WithMessage("Missing PKCE handoff redirect."); + + store.Read().Should().BeNull(); + + mock.Verify(x => x.NavigateToPkceReturnUrlAsync( + It.IsAny(), + It.IsAny(), + It.IsAny()), + Times.Never); + + mock.Verify(x => x.NavigateToUrlAsync( + It.IsAny(), + It.IsAny()), + Times.Never); + } + + [Theory] + [InlineData(null)] + [InlineData("/home")] + public async Task CompletePkce_FetchWithoutHandoff_StoresTokenAndPublishesLogin( + string? redirectUrl) + { + var mock = CreatePkceFetchRequestMock( + CreatePkceFetchResponse(redirectUrl)); + + var store = new InMemoryUAuthTokenStore(); + var events = new UAuthClientEvents(); + var published = new List(); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + var client = CreateClient( + mock, + tokenStore: store, + clientEvents: events); + + await client.CompletePkceLoginAsync(new PkceCompleteRequest + { + Identifier = "user", + Secret = "pass", + AuthorizationCode = "code", + CodeVerifier = "verifier", + ReturnUrl = redirectUrl + }); + + var token = store.Read(); + + token.Should().NotBeNull(); + token!.Token.Should().Be("pkce-jwt"); + token.Format.Should().Be(TokenFormat.Jwt); + + published.Should().Equal(UAuthStateEvent.LoginSucceeded); + + mock.Verify(x => x.NavigateToUrlAsync( + It.IsAny(), + It.IsAny()), + redirectUrl is null ? Times.Never() : Times.Once()); + + if (redirectUrl is not null) + { + mock.Verify(x => x.NavigateToUrlAsync( + redirectUrl, + It.IsAny()), + Times.Once); + } + + mock.Verify(x => x.NavigateToPkceReturnUrlAsync( + It.IsAny(), + It.IsAny(), + It.IsAny()), + Times.Never); + } + + [Fact] + public async Task CompletePkce_FetchFailure_PreservesExistingToken() + { + var mock = CreatePkceFetchRequestMock( + new UAuthTransportResult + { + Ok = false, + Status = 401 + }); + + var store = new InMemoryUAuthTokenStore(); + var existing = CreateStoredToken(); + store.Replace(existing); + + var events = new UAuthClientEvents(); + var published = new List(); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + var client = CreateClient( + mock, + tokenStore: store, + clientEvents: events); + + Func act = () => client.CompletePkceLoginAsync( + new PkceCompleteRequest + { + Identifier = "user", + Secret = "pass", + AuthorizationCode = "code", + CodeVerifier = "verifier" + }); + + await act.Should() + .ThrowAsync() + .WithMessage("PKCE completion failed: HTTP 401."); + + store.Read().Should().BeSameAs(existing); + published.Should().BeEmpty(); + + mock.Verify(x => x.NavigateToUrlAsync( + It.IsAny(), + It.IsAny()), + Times.Never); + + mock.Verify(x => x.NavigateToPkceReturnUrlAsync( + It.IsAny(), + It.IsAny(), + It.IsAny()), + Times.Never); + } + + [Fact] + public async Task CompletePkce_FetchWithoutRequiredToken_RejectsCompletion() + { + var mock = CreatePkceFetchRequestMock( + new UAuthTransportResult + { + Ok = true, + Status = 200, + Body = JsonSerializer.SerializeToElement(new + { + redirectUrl = "/home" + }) + }); + + var store = new InMemoryUAuthTokenStore(); + + var client = CreateClient(mock, tokenStore: store); + + Func act = () => client.CompletePkceLoginAsync( + new PkceCompleteRequest + { + Identifier = "user", + Secret = "pass", + AuthorizationCode = "code", + CodeVerifier = "verifier" + }); + + await act.Should().ThrowAsync(); + + store.Read().Should().BeNull(); + + mock.Verify(x => x.NavigateToUrlAsync( + It.IsAny(), + It.IsAny()), + Times.Never); + } + + [Fact] + public async Task CompletePkce_UnsupportedTransport_DoesNotSubmitCredentials() + { + var mock = new Mock(); + + mock.Setup(x => x.GetLoginTransportAsync( + "/auth/login/transport", + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = false, + NavigationSupported = false, + AccessTokenInHeader = false + }); + + var client = CreateClient(mock); + + Func act = () => client.CompletePkceLoginAsync( + new PkceCompleteRequest + { + Identifier = "user", + Secret = "pass", + AuthorizationCode = "code", + CodeVerifier = "verifier" + }); + + await act.Should() + .ThrowAsync() + .WithMessage("PKCE credential delivery is not supported."); + + mock.Verify(x => x.SendFormAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny()), + Times.Never); + + mock.Verify(x => x.NavigateAsync( + It.IsAny(), + It.IsAny>(), + It.IsAny()), + Times.Never); + } } diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthLoginCompletionTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthLoginCompletionTests.cs new file mode 100644 index 00000000..671daefe --- /dev/null +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthLoginCompletionTests.cs @@ -0,0 +1,243 @@ +using AwesomeAssertions; +using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Contracts; +using CodeBeam.UltimateAuth.Client.Errors; +using CodeBeam.UltimateAuth.Client.Events; +using CodeBeam.UltimateAuth.Client.Infrastructure; +using CodeBeam.UltimateAuth.Core.Contracts; + +namespace CodeBeam.UltimateAuth.Tests.Unit.Client; + +public sealed class UAuthLoginCompletionTests +{ + private static UAuthTransportResult Response( + string? token = "Bearer jwt-value", + string? format = "jwt", + string? headerFormat = "bearer", + string? expires = null, + bool ok = true, + int status = 200) + => new() + { + Ok = ok, + Status = status, + AccessToken = token, + AccessTokenFormat = format, + AccessTokenHeaderFormat = headerFormat, + AccessTokenExpiresAt = expires ?? + DateTimeOffset.UtcNow.AddMinutes(10).ToString("O") + }; + + private static AccessToken ExistingToken() => new() + { + Token = "existing-token", + Format = TokenFormat.Jwt, + ExpiresAt = DateTimeOffset.UtcNow.AddMinutes(15) + }; + + [Theory] + [InlineData("jwt", "bearer", "Bearer abc", "abc", TokenFormat.Jwt)] + [InlineData("opaque", "bearer", "bearer abc", "abc", TokenFormat.Opaque)] + [InlineData("jwt", "raw", "abc", "abc", TokenFormat.Jwt)] + public void ReadAccessToken_Parses_Supported_Formats( + string format, + string headerFormat, + string value, + string expected, + TokenFormat expectedFormat) + { + var result = UAuthLoginCompletion.ReadAccessToken( + Response(value, format, headerFormat)); + + result.Should().NotBeNull(); + result!.Token.Should().Be(expected); + result.Format.Should().Be(expectedFormat); + } + + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData(" ")] + public void ReadAccessToken_WithoutToken_ReturnsNull(string? token) + { + UAuthLoginCompletion.ReadAccessToken( + Response(token)).Should().BeNull(); + } + + [Theory] + [InlineData("unknown", "bearer", "Bearer abc")] + [InlineData("jwt", "unknown", "abc")] + [InlineData("jwt", "bearer", "abc")] + [InlineData("jwt", "raw", "abc\rdef")] + [InlineData("jwt", "raw", "abc\ndef")] + public void ReadAccessToken_Rejects_InvalidMetadataOrValue(string format, string headerFormat, string value) + { + var act = () => UAuthLoginCompletion.ReadAccessToken(Response(value, format, headerFormat)); + act.Should().Throw(); + } + + [Fact] + public void ReadAccessToken_Rejects_InvalidExpiration() + { + var response = new UAuthTransportResult + { + Ok = true, + Status = 200, + AccessToken = "Bearer abc", + AccessTokenFormat = "jwt", + AccessTokenHeaderFormat = "bearer", + AccessTokenExpiresAt = "not-a-date" + }; + + var act = () => UAuthLoginCompletion.ReadAccessToken(response); + + act.Should().Throw(); + } + + [Fact] + public async Task CompleteAsync_StoresToken_AndPublishesLogin() + { + var store = new InMemoryUAuthTokenStore(); + var events = new UAuthClientEvents(); + var published = new List(); + + events.StateChanged += args => + { + published.Add(args.Type); + return Task.CompletedTask; + }; + + await UAuthLoginCompletion.CompleteAsync( + Response(), + accessTokenRequired: true, + store, + events); + + store.Read()!.Token.Should().Be("jwt-value"); + store.Read()!.Format.Should().Be(TokenFormat.Jwt); + + published.Should().ContainSingle() + .Which.Should().Be(UAuthStateEvent.LoginSucceeded); + } + + [Fact] + public async Task CompleteAsync_CookieOnlyLogin_ClearsPreviousToken() + { + var store = new InMemoryUAuthTokenStore(); + store.Replace(ExistingToken()); + + var events = new UAuthClientEvents(); + + await UAuthLoginCompletion.CompleteAsync( + Response(token: null), + accessTokenRequired: false, + store, + events); + + store.Read().Should().BeNull(); + } + + [Fact] + public async Task CompleteAsync_MissingRequiredToken_FailsClosed() + { + var store = new InMemoryUAuthTokenStore(); + store.Replace(ExistingToken()); + + var events = new UAuthClientEvents(); + var published = 0; + + events.StateChanged += _ => + { + published++; + return Task.CompletedTask; + }; + + var act = () => UAuthLoginCompletion.CompleteAsync( + Response(token: null), + accessTokenRequired: true, + store, + events); + + await act.Should().ThrowAsync() + .WithMessage("*required access token*"); + + store.Read().Should().BeNull(); + published.Should().Be(0); + } + + [Fact] + public async Task CompleteAsync_ExpiredToken_FailsClosed() + { + var store = new InMemoryUAuthTokenStore(); + store.Replace(ExistingToken()); + + var response = new UAuthTransportResult + { + Ok = true, + Status = 200, + AccessToken = "Bearer expired", + AccessTokenFormat = "jwt", + AccessTokenHeaderFormat = "bearer", + AccessTokenExpiresAt = + DateTimeOffset.UtcNow.AddMinutes(-5).ToString("O") + }; + + var act = () => UAuthLoginCompletion.CompleteAsync( + response, true, store, new UAuthClientEvents()); + + await act.Should().ThrowAsync() + .WithMessage("*expired access token*"); + + store.Read().Should().BeNull(); + } + + [Theory] + [InlineData(false, 200)] + [InlineData(true, 401)] + [InlineData(true, 500)] + public async Task CompleteAsync_UnsuccessfulResponse_DoesNotMutateToken( + bool ok, int status) + { + var store = new InMemoryUAuthTokenStore(); + store.Replace(ExistingToken()); + + var act = () => UAuthLoginCompletion.CompleteAsync( + Response(ok: ok, status: status), + true, + store, + new UAuthClientEvents()); + + await act.Should().ThrowAsync(); + + store.Read()!.Token.Should().Be("existing-token"); + } + + [Theory] + [InlineData("""{"redirectUrl":"/home"}""", "/home")] + [InlineData("""{"redirectUrl":null}""", null)] + [InlineData("""{"other":"value"}""", null)] + [InlineData("""{"redirectUrl":123}""", null)] + public void GetRedirectUrl_HandlesResponseBody( + string json, + string? expected) + { + var response = new UAuthTransportResult + { + Ok = true, + Status = 200, + Body = System.Text.Json.JsonSerializer + .Deserialize(json) + }; + + UAuthLoginCompletion.GetRedirectUrl(response) + .Should().Be(expected); + } + + [Fact] + public void GetRedirectUrl_WithoutBody_ReturnsNull() + { + UAuthLoginCompletion.GetRedirectUrl( + new UAuthTransportResult()) + .Should().BeNull(); + } +} diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthResourceRequestClientTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthResourceRequestClientTests.cs index 99c7c126..ad60b22b 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthResourceRequestClientTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthResourceRequestClientTests.cs @@ -5,6 +5,7 @@ using CodeBeam.UltimateAuth.Client.Errors; using CodeBeam.UltimateAuth.Client.Infrastructure; using CodeBeam.UltimateAuth.Client.Options; +using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Options; using Microsoft.JSInterop; using Moq; @@ -33,6 +34,7 @@ private UAuthResourceRequestClient CreateClient( return new UAuthResourceRequestClient( _js.Object, _bootstrapper.Object, + new InMemoryUAuthTokenStore(), options); } diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthStateManagerTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthStateManagerTests.cs index 5e1bc430..ec0f508c 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthStateManagerTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthStateManagerTests.cs @@ -1,13 +1,18 @@ using AwesomeAssertions; using CodeBeam.UltimateAuth.Client; +using CodeBeam.UltimateAuth.Client.Abstractions; using CodeBeam.UltimateAuth.Client.Authentication; +using CodeBeam.UltimateAuth.Client.Contracts; using CodeBeam.UltimateAuth.Client.Events; +using CodeBeam.UltimateAuth.Client.Infrastructure; +using CodeBeam.UltimateAuth.Client.Options; using CodeBeam.UltimateAuth.Client.Services; using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.MultiTenancy; using CodeBeam.UltimateAuth.Users.Contracts; +using Microsoft.Extensions.Options; using Moq; namespace CodeBeam.UltimateAuth.Tests.Unit; @@ -43,7 +48,7 @@ public async Task EnsureAsync_should_not_validate_when_authenticated_and_not_sta var clock = new Mock(); clock.Setup(x => x.UtcNow).Returns(DateTimeOffset.UtcNow); - var manager = new UAuthStateManager(client.Object, events.Object, clock.Object); + var manager = NewManager(client.Object, events.Object, clock.Object); await manager.EnsureAsync(ct: TestContext.Current.CancellationToken); await manager.EnsureAsync(ct: TestContext.Current.CancellationToken); @@ -114,41 +119,59 @@ public async Task EnsureAsync_invalid_should_clear_state() State = SessionState.Invalid }); - var manager = new UAuthStateManager(client.Object, events.Object, clock.Object); + var manager = NewManager(client.Object, events.Object, clock.Object); await manager.EnsureAsync(ct: TestContext.Current.CancellationToken); manager.State.IsAuthenticated.Should().BeFalse(); } [Fact] - public async Task OnLogin_Should_Mark_Authenticated_State_Stale() + public async Task OnLogin_Should_Revalidate_Authenticated_State() { var (manager, flows, _, _) = CreateManager(); + using (manager) { SetupValidSnapshot(flows); - await manager.EnsureAsync(ct: TestContext.Current.CancellationToken); + await manager.EnsureAsync( + ct: TestContext.Current.CancellationToken); manager.State.IsAuthenticated.Should().BeTrue(); manager.State.IsStale.Should().BeFalse(); await manager.OnLoginAsync(); - manager.State.IsStale.Should().BeTrue(); - manager.NeedsValidation.Should().BeTrue(); + manager.State.IsAuthenticated.Should().BeTrue(); + manager.State.IsStale.Should().BeFalse(); + manager.NeedsValidation.Should().BeFalse(); + + flows.Verify( + x => x.ValidateAsync(), + Times.Exactly(2)); } } [Fact] - public async Task OnLogin_When_Anonymous_Should_Still_Require_Validation() + public async Task OnLogin_When_Anonymous_Should_Attempt_Validation() { - var (manager, _, _, _) = CreateManager(); + var (manager, flows, _, _) = CreateManager(); + using (manager) { + flows.Setup(x => x.ValidateAsync()) + .ReturnsAsync(new AuthValidationResult + { + State = SessionState.NotFound + }); + await manager.OnLoginAsync(); manager.State.IsAuthenticated.Should().BeFalse(); manager.NeedsValidation.Should().BeTrue(); + + flows.Verify( + x => x.ValidateAsync(), + Times.Once); } } @@ -537,6 +560,124 @@ public async Task EnsureAsync_When_Active_Result_Has_No_Snapshot_Should_Mark_Sta } } + [Fact] + public async Task InitialValidation_NotFound_RecoversToken_AndRevalidates() + { + var flows = new Mock(); + + flows.SetupSequence(x => x.ValidateAsync()) + .ReturnsAsync(new AuthValidationResult + { + State = SessionState.NotFound + }) + .ReturnsAsync(new AuthValidationResult + { + State = SessionState.Active, + Snapshot = CreateSnapshot() + }); + + var store = new InMemoryUAuthTokenStore(); + + flows.Setup(x => x.RecoverAsync()) + .Callback(() => store.Replace(new AccessToken + { + Token = "recovered-jwt", + Format = TokenFormat.Jwt, + ExpiresAt = DateTimeOffset.UtcNow.AddHours(1) + })) + .ReturnsAsync(new RefreshResult + { + IsSuccess = true, + Status = 200, + Outcome = RefreshOutcome.Success + }); + + var client = new Mock(); + client.SetupGet(x => x.Flows).Returns(flows.Object); + + var transport = new Mock(); + transport.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + AccessTokenInHeader = true + }); + + var clock = new Mock(); + clock.SetupGet(x => x.UtcNow) + .Returns(DateTimeOffset.UtcNow); + + using var manager = new UAuthStateManager( + client.Object, + new UAuthClientEvents(), + clock.Object, + store, + transport.Object, + Options.Create(new UAuthClientOptions())); + + await manager.EnsureAsync( + ct: TestContext.Current.CancellationToken); + + manager.State.IsAuthenticated.Should().BeTrue(); + store.Read()!.Token.Should().Be("recovered-jwt"); + + flows.Verify(x => x.RecoverAsync(), Times.Once); + flows.Verify(x => x.ValidateAsync(), Times.Exactly(2)); + } + + [Fact] + public async Task InitialValidation_WithExistingToken_DoesNotRecover() + { + var flows = new Mock(); + + flows.Setup(x => x.ValidateAsync()) + .ReturnsAsync(new AuthValidationResult + { + State = SessionState.NotFound + }); + + var client = new Mock(); + client.SetupGet(x => x.Flows).Returns(flows.Object); + + var store = new InMemoryUAuthTokenStore(); + + store.Replace(new AccessToken + { + Token = "existing-jwt", + Format = TokenFormat.Jwt, + ExpiresAt = DateTimeOffset.UtcNow.AddHours(1) + }); + + var transport = new Mock(); + transport.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + AccessTokenInHeader = true + }); + + var clock = new Mock(); + clock.SetupGet(x => x.UtcNow) + .Returns(DateTimeOffset.UtcNow); + + using var manager = new UAuthStateManager( + client.Object, + new UAuthClientEvents(), + clock.Object, + store, + transport.Object, + Options.Create(new UAuthClientOptions())); + + await manager.EnsureAsync( + ct: TestContext.Current.CancellationToken); + + flows.Verify(x => x.RecoverAsync(), Times.Never); + + manager.State.IsAuthenticated.Should().BeFalse(); + } + private static AuthStateSnapshot CreateSnapshot(string userKey = "user-1", string displayName = "Original Name") { @@ -552,12 +693,7 @@ private static AuthStateSnapshot CreateSnapshot(string userKey = "user-1", strin }; } - private static ( - UAuthStateManager Manager, - Mock Flows, - UAuthClientEvents Events, - Mock Clock) - CreateManager() + private static (UAuthStateManager Manager, Mock Flows, UAuthClientEvents Events, Mock Clock) CreateManager() { var flows = new Mock(); @@ -570,16 +706,34 @@ private static ( clock.SetupGet(x => x.UtcNow) .Returns(new DateTimeOffset(2026, 10, 26, 12, 0, 0, TimeSpan.Zero)); - return ( - new UAuthStateManager(client.Object, events, clock.Object), - flows, + return (NewManager(client.Object, events, clock.Object), flows, events, clock); + } + + private static UAuthStateManager NewManager(IUAuthClient client, IUAuthClientEvents events, IClock clock) + { + var requestClient = new Mock(); + + requestClient + .Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true, + AccessTokenInHeader = false + }); + + return new UAuthStateManager( + client, events, - clock); + clock, + new InMemoryUAuthTokenStore(), + requestClient.Object, + Options.Create(new UAuthClientOptions())); } - private static void SetupValidSnapshot( - Mock flows, - AuthStateSnapshot? snapshot = null) + private static void SetupValidSnapshot(Mock flows, AuthStateSnapshot? snapshot = null) { flows.Setup(x => x.ValidateAsync()) .ReturnsAsync(new AuthValidationResult diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthTokenStoreTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthTokenStoreTests.cs new file mode 100644 index 00000000..6725b8ed --- /dev/null +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Client/UAuthTokenStoreTests.cs @@ -0,0 +1,81 @@ +using CodeBeam.UltimateAuth.Client.Abstractions; +using CodeBeam.UltimateAuth.Client.Infrastructure; +using CodeBeam.UltimateAuth.Core.Contracts; + +namespace CodeBeam.UltimateAuth.Tests.Unit; + +public sealed class UAuthTokenStoreTests +{ + [Fact] + public void New_store_has_no_token() + { + var store = new InMemoryUAuthTokenStore(); + + Assert.Null(store.Read()); + } + + [Fact] + public void Replace_stores_access_token() + { + var store = new InMemoryUAuthTokenStore(); + var token = CreateToken("first"); + + store.Replace(token); + + Assert.Same(token, store.Read()); + } + + [Fact] + public void Replace_overwrites_previous_token() + { + var store = new InMemoryUAuthTokenStore(); + var first = CreateToken("first"); + var second = CreateToken("second"); + + store.Replace(first); + store.Replace(second); + + Assert.Same(second, store.Read()); + } + + [Fact] + public void Clear_removes_token() + { + var store = new InMemoryUAuthTokenStore(); + + store.Replace(CreateToken("first")); + store.Clear(); + + Assert.Null(store.Read()); + } + + [Fact] + public void Stores_are_isolated() + { + var first = new InMemoryUAuthTokenStore(); + var second = new InMemoryUAuthTokenStore(); + + first.Replace(CreateToken("first")); + + Assert.NotNull(first.Read()); + Assert.Null(second.Read()); + } + + [Fact] + public void Expiration_uses_issuer_metadata() + { + var now = DateTimeOffset.UtcNow; + var token = CreateToken("opaque-access-value"); + + Assert.False(token.IsExpired(now)); + Assert.True(token.IsExpired(now.AddSeconds(601))); + } + + private static AccessToken CreateToken(string value) + => new() + { + Token = value, + Format = TokenFormat.Jwt, + ExpiresAt = DateTimeOffset.UtcNow.AddMinutes(5) + }; +} diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/FakeFlowClient.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/FakeFlowClient.cs index 8333db93..92fb69cd 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/FakeFlowClient.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/FakeFlowClient.cs @@ -42,12 +42,7 @@ public Task GetCurrentPrincipalAsync() throw new NotImplementedException(); } - public Task LoginAsync(LoginRequest request) - { - throw new NotImplementedException(); - } - - public Task LoginAsync(LoginRequest request, string? returnUrl) + public Task LoginAsync(LoginRequest request, string? returnUrl = null, UAuthLoginTransport transport = UAuthLoginTransport.Auto) { throw new NotImplementedException(); } @@ -127,6 +122,11 @@ public Task ReauthAsync() throw new NotImplementedException(); } + public Task RecoverAsync() + { + throw new NotImplementedException(); + } + public Task RefreshAsync(bool isAuto = false) { var outcome = _outcomes.Count > 0 @@ -150,7 +150,7 @@ public Task TryCompletePkceLoginAsync(PkceCompleteRequest re throw new NotImplementedException(); } - public Task TryLoginAsync(LoginRequest request, UAuthSubmitMode mode, string? returnUrl = null) + public Task TryLoginAsync(LoginRequest request, UAuthSubmitMode mode, string? returnUrl = null, UAuthLoginTransport transport = UAuthLoginTransport.Auto) { throw new NotImplementedException(); } diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/FakeNavigationManager.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/TestNavigationManager.cs similarity index 100% rename from tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/FakeNavigationManager.cs rename to tests/CodeBeam.UltimateAuth.Tests.Unit/Fake/TestNavigationManager.cs diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Helpers/UAuthClientTestBase.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Helpers/UAuthClientTestBase.cs index 9d7903ce..e92ef6b8 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Helpers/UAuthClientTestBase.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Helpers/UAuthClientTestBase.cs @@ -60,6 +60,16 @@ protected IFlowClient CreateFlowClient(Mock? requestMock = returnUrlProvider.Setup(x => x.GetCurrentUrl()) .Returns("/home"); + request.Setup(x => x.GetLoginTransportAsync( + It.IsAny(), + It.IsAny())) + .ReturnsAsync(new UAuthLoginTransportInfo + { + Supported = true, + NavigationSupported = true, + AccessTokenInHeader = false + }); + var options = Options.Create(new UAuthClientOptions { Endpoints = new UAuthClientEndpointOptions @@ -89,7 +99,8 @@ protected IFlowClient CreateFlowClient(Mock? requestMock = deviceProvider.Object, returnUrlProvider.Object, options, - diagnostics); + diagnostics, + new InMemoryUAuthTokenStore()); } protected IUAuthClient CreateCredentialClient() diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/RemoteSessionValidatorTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/RemoteSessionValidatorTests.cs index c9ae6c0c..e7a0b078 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/RemoteSessionValidatorTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/RemoteSessionValidatorTests.cs @@ -4,25 +4,23 @@ using CodeBeam.UltimateAuth.Core.Infrastructure; using CodeBeam.UltimateAuth.Core.MultiTenancy; using CodeBeam.UltimateAuth.Core.Options; +using CodeBeam.UltimateAuth.Server.Options; using CodeBeam.UltimateAuth.Server.ResourceApi; using CodeBeam.UltimateAuth.Tests.Unit.Helpers; -using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Options; using System.Net; using System.Net.Http.Json; -using System.Text.Json; namespace CodeBeam.UltimateAuth.Tests.Unit.ResourceApi; public sealed class RemoteSessionValidatorTests { - private const string SessionValue = - "session-00000000000000000000000000000001"; + private const string SessionValue = "session-00000000000000000000000000000001"; - private static readonly TenantKey Tenant = - TenantKey.FromExternal("tenant-a"); + private static readonly TenantKey Tenant = TenantKey.FromExternal("tenant-a"); [Fact] - public async Task ValidateSessionAsync_ShouldPostSessionAndTenantToValidationEndpoint() + public async Task ValidateSessionAsync_ShouldPostSessionCookieToValidationEndpoint() { var handler = new TestHttpMessageHandler { @@ -30,59 +28,54 @@ public async Task ValidateSessionAsync_ShouldPostSessionAndTenantToValidationEnd }; var sut = CreateSut(handler); - var context = CreateValidationContext(); - await sut.ValidateSessionAsync(context, ct: TestContext.Current.CancellationToken); + await sut.ValidateSessionAsync( + context, + ct: TestContext.Current.CancellationToken); handler.Method.Should().Be(HttpMethod.Post); handler.RequestUri.Should() .Be(new Uri("https://uauth.test/auth/validate")); - handler.Body.Should().NotBeNullOrWhiteSpace(); - - using var json = JsonDocument.Parse(handler.Body!); - - json.RootElement - .GetProperty("sessionId") - .GetString() - .Should() - .Be(context.SessionId.Value); + handler.Cookie.Should() + .Be($"uas={context.SessionId.Value}"); - json.RootElement - .GetProperty("tenant") - .GetString() - .Should() - .Be(Tenant.Value); + handler.Body.Should().BeNull(); } [Fact] - public async Task ValidateSessionAsync_WhenIncomingRequestContainsCookie_ShouldForwardCookie() + public async Task ValidateSessionAsync_ShouldUseConfiguredHubSessionCookieName() { var handler = new TestHttpMessageHandler { Response = CreateFailureResponse(HttpStatusCode.Unauthorized) }; - var httpContext = new DefaultHttpContext(); - - httpContext.Request.Headers.Cookie = - "uauth_session=session-cookie; other=value"; + var options = new UAuthResourceApiOptions + { + Hub = new UAuthResourceHubOptions + { + SessionCookieName = "custom-session" + } + }; - var sut = CreateSut( - handler, - httpContext); + var sut = CreateSut(handler, options); + var context = CreateValidationContext(); await sut.ValidateSessionAsync( - CreateValidationContext(), ct: TestContext.Current.CancellationToken); + context, + ct: TestContext.Current.CancellationToken); handler.Cookie.Should() - .Be("uauth_session=session-cookie; other=value"); + .Be($"custom-session={context.SessionId.Value}"); } - [Fact] - public async Task ValidateSessionAsync_WhenIncomingRequestDoesNotContainCookie_ShouldNotAddCookieHeader() + [Theory] + [InlineData("session-00000000000000000000000000000001")] + [InlineData("session-00000000000000000000000000000002")] + public async Task ValidateSessionAsync_ShouldSendExactRequestedSession(string sessionValue) { var handler = new TestHttpMessageHandler { @@ -91,10 +84,14 @@ public async Task ValidateSessionAsync_WhenIncomingRequestDoesNotContainCookie_S var sut = CreateSut(handler); - await sut.ValidateSessionAsync( - CreateValidationContext(), ct: TestContext.Current.CancellationToken); + var context = CreateValidationContext() with + { + SessionId = AuthSessionId.Parse(sessionValue, null) + }; - handler.Cookie.Should().BeNull(); + await sut.ValidateSessionAsync(context, ct: TestContext.Current.CancellationToken); + + handler.Cookie.Should().Be($"uas={sessionValue}"); } [Theory] @@ -127,7 +124,7 @@ public async Task ValidateSessionAsync_WhenHubReturnsNonSuccess_ShouldReturnNotF } [Fact] - public async Task ValidateSessionAsync_WhenHubReturnsJsonNull_ShouldReturnNotFound() + public async Task ValidateSessionAsync_WhenHubReturnsJsonNull_ShouldReturnInvalid() { var handler = new TestHttpMessageHandler { @@ -138,17 +135,15 @@ public async Task ValidateSessionAsync_WhenHubReturnsJsonNull_ShouldReturnNotFou }; var sut = CreateSut(handler); - var context = CreateValidationContext(); - var result = - await sut.ValidateSessionAsync(context, ct: TestContext.Current.CancellationToken); + var result = await sut.ValidateSessionAsync( + context, + ct: TestContext.Current.CancellationToken); result.IsValid.Should().BeFalse(); - result.State.Should().Be(SessionState.NotFound); - - result.SessionId.Should() - .Be(context.SessionId); + result.State.Should().Be(SessionState.Invalid); + result.SessionId.Should().Be(context.SessionId); } [Fact] @@ -449,24 +444,14 @@ public void ToDomain_ShouldPreserveValidatedUserStatus(UserStatus status) } - private static RemoteSessionValidator CreateSut(TestHttpMessageHandler handler, HttpContext? httpContext = null) + private static RemoteSessionValidator CreateSut(TestHttpMessageHandler handler, UAuthResourceApiOptions? options = null) { var httpClient = new HttpClient(handler) { - BaseAddress = - new Uri("https://uauth.test") + BaseAddress = new Uri("https://uauth.test") }; - var accessor = - new HttpContextAccessor - { - HttpContext = - httpContext ?? new DefaultHttpContext() - }; - - return new RemoteSessionValidator( - httpClient, - accessor); + return new RemoteSessionValidator(httpClient, Options.Create(options ?? new UAuthResourceApiOptions())); } private static SessionValidationContext CreateValidationContext() diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/ResourceApiAuthModeTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/ResourceApiAuthModeTests.cs index bb1ccee6..32d36de3 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/ResourceApiAuthModeTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/ResourceApiAuthModeTests.cs @@ -16,7 +16,7 @@ namespace CodeBeam.UltimateAuth.Tests.Unit.Server.ResourceApi; public sealed class ResourceApiAuthModeTests { [Fact] - public void DefaultResolver_UsesPureJwtForResourceApi() + public void DefaultResolver_UsesHybridForResourceApi() { var resolver = new EffectiveAuthModeResolver(); @@ -27,22 +27,23 @@ public void DefaultResolver_UsesPureJwtForResourceApi() Tenant = TenantKey.Single }); - Assert.Equal(UAuthMode.PureJwt, result); + Assert.Equal(UAuthMode.Hybrid, result); } [Fact] - public void ResourceApi_DefaultMode_IsPureJwt() + public void ResourceApi_DefaultMode_IsHybrid() { using var provider = CreateProvider(options => { options.Auth.Jwt = CreateJwtOptions(); + options.Hub.BaseUrl = "https://hub.example.com"; }); var mode = provider .GetRequiredService() .Mode; - Assert.Equal(UAuthMode.PureJwt, mode); + Assert.Equal(UAuthMode.Hybrid, mode); } [Fact] @@ -129,17 +130,17 @@ public void ResourceApi_ExplicitMode_TakesPriorityOverCustomResolver() [Fact] public void ResourceApi_DefaultPureJwt_RequiresJwtOptions() { - using var provider = CreateProvider(); + using var provider = CreateProvider( + options => + { + options.Auth.Mode = UAuthMode.PureJwt; + }); - var act = () => provider - .GetRequiredService>() - .Value; + var act = () => provider.GetRequiredService>().Value; var exception = Assert.Throws(act); - Assert.Contains( - exception.Failures, - x => x.Contains("Auth.Jwt is required")); + Assert.Contains(exception.Failures, x => x.Contains("Auth.Jwt is required")); } [Fact] @@ -151,9 +152,7 @@ public void ResourceApi_ExplicitPureOpaque_DoesNotRequireJwtOptions() options.Hub.BaseUrl = "https://hub.example.com"; }); - var configured = provider - .GetRequiredService>() - .Value; + var configured = provider.GetRequiredService>().Value; Assert.Null(configured.Auth.Jwt); } @@ -164,16 +163,14 @@ public void ResourceApi_JwtOptions_UseNestedAuthConfiguration() using var provider = CreateProvider(options => { options.Auth.Jwt = CreateJwtOptions(); + options.Hub.BaseUrl = "https://hub.example.com"; }); - var jwt = provider - .GetRequiredService>() - .Value; + var jwt = provider.GetRequiredService>().Value; Assert.Equal("https://auth.example.com", jwt.Issuer); Assert.Equal("resource-api", jwt.Audience); - Assert.Contains(SecurityAlgorithms.HmacSha256, - jwt.ValidAlgorithms); + Assert.Contains(SecurityAlgorithms.HmacSha256, jwt.ValidAlgorithms); } private static UAuthJwtValidationOptions CreateJwtOptions() => new() diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsTests.cs index 7fb79b1c..4b4258e1 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsTests.cs @@ -20,25 +20,17 @@ public void Defaults_ShouldBeInitializedCorrectly() Assert.Null(options.Auth.Mode); Assert.Null(options.Auth.Jwt); - Assert.Equal( - GrantDeliveryMode.Header, - options.Auth.Session.DeliveryMode); + Assert.Equal(GrantDeliveryMode.Cookie, options.Auth.Session.DeliveryMode); Assert.Equal("uas", options.Auth.Session.CookieName); - Assert.Equal( - GrantDeliveryMode.Header, - options.Auth.AccessToken.DeliveryMode); + Assert.Equal(GrantDeliveryMode.Header, options.Auth.AccessToken.DeliveryMode); Assert.Equal("uat", options.Auth.AccessToken.CookieName); Assert.Equal("Authorization", options.Auth.AccessToken.HeaderName); - Assert.Equal( - HeaderTokenFormat.Bearer, - options.Auth.AccessToken.HeaderFormat); + Assert.Equal(HeaderTokenFormat.Bearer, options.Auth.AccessToken.HeaderFormat); - Assert.Equal( - DeviceMismatchBehavior.Reject, - options.Auth.Device.MismatchBehavior); + Assert.Equal(DeviceMismatchBehavior.Reject, options.Auth.Device.MismatchBehavior); Assert.Equal(string.Empty, options.Hub.BaseUrl); Assert.Equal("UAuthResource", options.Cors.PolicyName); diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsValidatorTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsValidatorTests.cs index aef16ab1..41b15a02 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsValidatorTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/ResourceApi/UAuthResourceApiOptionsValidatorTests.cs @@ -26,22 +26,24 @@ public void ValidExplicitMode_ShouldSucceed(UAuthMode mode) } [Fact] - public void DefaultResourceProfile_WithJwtConfiguration_ShouldSucceed() + public void DefaultResourceProfile_WithoutJwt_ShouldSucceed() { - var options = ValidOptions(UAuthMode.PureJwt); + var options = ValidOptions(UAuthMode.Hybrid); options.Auth.Mode = null; + options.Auth.Jwt = null; AssertValid(options); } [Fact] - public void DefaultResourceProfile_WithoutJwt_ShouldFail() + public void DefaultResourceProfile_WithoutHubBaseUrl_ShouldFail() { - var options = ValidOptions(UAuthMode.PureJwt); + var options = ValidOptions(UAuthMode.Hybrid); options.Auth.Mode = null; options.Auth.Jwt = null; + options.Hub.BaseUrl = string.Empty; - AssertInvalid(options, "Auth.Jwt is required in PureJwt mode."); + AssertInvalid(options, "Hub.BaseUrl is required for remote session validation."); } [Fact] @@ -576,8 +578,7 @@ public void ResolverException_ShouldBecomeValidationFailure() resolver.Object); } - private static UAuthResourceApiOptions ValidOptions( - UAuthMode mode = UAuthMode.PureOpaque) + private static UAuthResourceApiOptions ValidOptions(UAuthMode mode = UAuthMode.PureOpaque) { return new UAuthResourceApiOptions { diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveAuthModeResolverTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveAuthModeResolverTests.cs index 914f2ce7..6c34f512 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveAuthModeResolverTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveAuthModeResolverTests.cs @@ -13,7 +13,8 @@ public class EffectiveAuthModeResolverTests [InlineData(UAuthApplicationProfile.BlazorServer, UAuthMode.PureOpaque)] [InlineData(UAuthApplicationProfile.BlazorWasm, UAuthMode.Hybrid)] [InlineData(UAuthApplicationProfile.Maui, UAuthMode.Hybrid)] - [InlineData(UAuthApplicationProfile.Api, UAuthMode.PureJwt)] + [InlineData(UAuthApplicationProfile.Api, UAuthMode.Hybrid)] + [InlineData(UAuthApplicationProfile.ResourceApi, UAuthMode.Hybrid)] public void Default_Mode_Is_Derived_From_ApplicationProfile(UAuthApplicationProfile profile, UAuthMode expected) { var context = new AuthModeResolutionContext() { ApplicationProfile = profile, Tenant = TenantKey.Single }; diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveServerOptionsProviderTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveServerOptionsProviderTests.cs index 666178b7..a6942115 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveServerOptionsProviderTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/EffectiveServerOptionsProviderTests.cs @@ -37,7 +37,7 @@ public void EffectiveMode_Is_Determined_By_ModeResolver() var ctx = TestHttpContext.Create(); var effective = provider.GetEffective(ctx, UAuthApplicationProfile.Api); - Assert.Equal(UAuthMode.PureJwt, effective.Mode); + Assert.Equal(UAuthMode.Hybrid, effective.Mode); } [Fact] diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginEndpointHandlerTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginEndpointHandlerTests.cs index b40711e7..bdd4ba3f 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginEndpointHandlerTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginEndpointHandlerTests.cs @@ -1,7 +1,9 @@ -using CodeBeam.UltimateAuth.Core.Abstractions; +using AwesomeAssertions; +using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; using CodeBeam.UltimateAuth.Core.MultiTenancy; +using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Server.Abstractions; using CodeBeam.UltimateAuth.Server.Auth; using CodeBeam.UltimateAuth.Server.Endpoints; @@ -12,7 +14,6 @@ using CodeBeam.UltimateAuth.Server.Stores; using CodeBeam.UltimateAuth.Tests.Unit.Helpers; using CodeBeam.UltimateAuth.Users; -using AwesomeAssertions; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.HttpResults; using Microsoft.Extensions.Options; @@ -725,6 +726,134 @@ public async Task LoginAsync_WhenIdentifierResolvesToDifferentUser_DoesNotSuppre It.IsAny()), Times.Never); } + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task LoginAsync_HeaderDeliveryWithoutFetch_ReturnsBadRequest(bool sessionHeader) + { + var headerDelivery = new EffectiveGrantDelivery( + sessionHeader ? GrantKind.Session : GrantKind.AccessToken, + sessionHeader ? TokenFormat.Opaque : TokenFormat.Jwt, + GrantDeliveryMode.Header, + name: sessionHeader ? "uas" : "uat"); + + var response = new EffectiveAuthResponse( + sessionHeader + ? headerDelivery + : EffectiveGrantDelivery.Disabled(GrantKind.Session), + sessionHeader + ? EffectiveGrantDelivery.Disabled(GrantKind.AccessToken) + : headerDelivery, + EffectiveGrantDelivery.Disabled(GrantKind.RefreshToken), + EffectiveRedirectResponse.Disabled); + + var fixture = CreateFixture( + AuthFlowTestFactory.New(response: response)); + + fixture.HttpContext.Request.ContentType = + "application/x-www-form-urlencoded"; + + fixture.HttpContext.Request.Form = new FormCollection( + new Dictionary + { + ["Identifier"] = "alice", + ["Secret"] = "password" + }); + + var result = await fixture.Sut.LoginAsync(fixture.HttpContext); + + ((IStatusCodeHttpResult)result).StatusCode + .Should().Be(StatusCodes.Status400BadRequest); + + fixture.InternalFlow.VerifyNoOtherCalls(); + fixture.CredentialWriter.VerifyNoOtherCalls(); + } + + [Fact] + public async Task LoginAsync_FetchFailure_ReturnsJson401WithoutRedirect() + { + var fixture = CreateFixture(); + + fixture.HttpContext.Request.ContentType = + "application/x-www-form-urlencoded"; + + fixture.HttpContext.Request.Form = new FormCollection( + new Dictionary + { + ["Identifier"] = "alice", + ["Secret"] = "wrong", + ["__uauth_response_mode"] = "fetch" + }); + + fixture.InternalFlow.Setup(x => x.LoginAsync( + fixture.Flow, + It.IsAny(), + It.IsAny(), + fixture.HttpContext.RequestAborted)) + .ReturnsAsync(LoginResult.Failed( + AuthFailureReason.InvalidCredentials)); + + var result = await fixture.Sut.LoginAsync(fixture.HttpContext); + + ((IStatusCodeHttpResult)result).StatusCode + .Should().Be(StatusCodes.Status401Unauthorized); + + fixture.CredentialWriter.VerifyNoOtherCalls(); + fixture.RedirectResolver.VerifyNoOtherCalls(); + } + + [Fact] + public async Task LoginAsync_SuccessfulFetch_ReturnsRedirectInBody() + { + var fixture = CreateFixture(); + + fixture.HttpContext.Request.ContentType = + "application/x-www-form-urlencoded"; + + fixture.HttpContext.Request.Form = new FormCollection( + new Dictionary + { + ["Identifier"] = "alice", + ["Secret"] = "password", + ["__uauth_response_mode"] = "fetch" + }); + + var sessionId = TestIds.Session("test-session"); + + fixture.InternalFlow.Setup(x => x.LoginAsync( + fixture.Flow, + It.IsAny(), + It.IsAny(), + fixture.HttpContext.RequestAborted)) + .ReturnsAsync(LoginResult.Success(sessionId)); + + fixture.CredentialWriter.Setup(x => x.Write( + fixture.HttpContext, + GrantKind.Session, + sessionId)); + + fixture.RedirectResolver.Setup(x => x.ResolveSuccess( + fixture.Flow, + fixture.HttpContext)) + .Returns(RedirectDecision.To("/home")); + + var result = await fixture.Sut.LoginAsync(fixture.HttpContext); + + ((IStatusCodeHttpResult)result).StatusCode.Should().Be(StatusCodes.Status200OK); + + var json = JsonSerializer.SerializeToElement( + ((IValueHttpResult)result).Value, + new JsonSerializerOptions(JsonSerializerDefaults.Web)); + + json.GetProperty("redirectUrl").GetString() + .Should().Be("/home"); + + fixture.CredentialWriter.Verify(x => x.Write( + fixture.HttpContext, + GrantKind.Session, + sessionId), Times.Once); + } + // ===================================================================== // Helpers // ===================================================================== diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginOrchestratorTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginOrchestratorTests.cs index 097871d4..088d3556 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginOrchestratorTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/LoginOrchestratorTests.cs @@ -800,7 +800,7 @@ await orchestrator.LoginAsync( [Fact] public async Task PureJwt_login_should_issue_jwt_and_refresh_token_without_session() { - var runtime = new TestAuthRuntime(); + var runtime = CreatePureJwtRuntime(); var flow = await CreatePureJwtFlowAsync(runtime); var orchestrator = runtime.GetLoginOrchestrator(); @@ -831,7 +831,7 @@ public async Task PureJwt_login_should_not_use_session_infrastructure() var sessionOrchestrator = new Moq.Mock(Moq.MockBehavior.Strict); - var runtime = new TestAuthRuntime( + var runtime = CreatePureJwtRuntime( configureServices: services => { services.Replace( @@ -861,7 +861,7 @@ public async Task PureJwt_login_should_not_use_session_infrastructure() [Fact] public async Task PureJwt_preview_should_not_issue_credentials() { - var runtime = new TestAuthRuntime(); + var runtime = CreatePureJwtRuntime(); var flow = await CreatePureJwtFlowAsync(runtime); var orchestrator = runtime.Services.GetRequiredService(); @@ -884,7 +884,7 @@ public async Task PureJwt_preview_should_not_issue_credentials() [Fact] public async Task PureJwt_invalid_password_should_not_issue_credentials() { - var runtime = new TestAuthRuntime(); + var runtime = CreatePureJwtRuntime(); var flow = await CreatePureJwtFlowAsync(runtime); var orchestrator = runtime.GetLoginOrchestrator(); @@ -904,7 +904,7 @@ public async Task PureJwt_login_should_dispatch_event_without_session() { UserLoggedInContext? captured = null; - var runtime = new TestAuthRuntime( + var runtime = CreatePureJwtRuntime( configureServer: options => { options.Events.OnUserLoggedIn = context => @@ -931,7 +931,7 @@ public async Task PureJwt_login_should_dispatch_event_without_session() [Fact] public async Task PureJwt_commit_without_token_request_should_reject_early() { - var runtime = new TestAuthRuntime(); + var runtime = CreatePureJwtRuntime(); var flow = await CreatePureJwtFlowAsync(runtime); var orchestrator = runtime.GetLoginOrchestrator(); @@ -1019,6 +1019,18 @@ private static async Task CreatePureJwtFlowAsync(TestAuthRuntim return flow; } + private static TestAuthRuntime CreatePureJwtRuntime(Action? configureServer = null, Action? configureServices = null) + { + return new TestAuthRuntime( + configureServer: options => + { + options.AuthMode = UAuthMode.PureJwt; + + configureServer?.Invoke(options); + }, + configureServices: configureServices); + } + private static LoginRequest PureJwtRequest(string secret = "user", bool requestTokens = true) => new() { diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/PkceEndpointHandlerTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/PkceEndpointHandlerTests.cs index ea739582..88ee7af8 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/PkceEndpointHandlerTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/PkceEndpointHandlerTests.cs @@ -1,8 +1,8 @@ -using System.Text; -using System.Text.Json; +using AwesomeAssertions; using CodeBeam.UltimateAuth.Core.Abstractions; using CodeBeam.UltimateAuth.Core.Contracts; using CodeBeam.UltimateAuth.Core.Domain; +using CodeBeam.UltimateAuth.Core.Options; using CodeBeam.UltimateAuth.Server.Abstractions; using CodeBeam.UltimateAuth.Server.Auth; using CodeBeam.UltimateAuth.Server.Endpoints; @@ -11,10 +11,11 @@ using CodeBeam.UltimateAuth.Server.Services; using CodeBeam.UltimateAuth.Server.Stores; using CodeBeam.UltimateAuth.Tests.Unit.Helpers; -using AwesomeAssertions; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.HttpResults; using Moq; +using System.Text; +using System.Text.Json; namespace CodeBeam.UltimateAuth.Tests.Unit.Server; @@ -777,6 +778,135 @@ public async Task CompleteAsync_WhenDeviceLimitExceeded_PreservesHubFromForm() hub.Error); } + [Fact] + public async Task CompleteAsync_HeaderDeliveryWithoutFetch_ReturnsBadRequest() + { + var response = new EffectiveAuthResponse( + EffectiveGrantDelivery.Disabled(GrantKind.Session), + new EffectiveGrantDelivery( + GrantKind.AccessToken, + TokenFormat.Jwt, + GrantDeliveryMode.Header, + name: "uat"), + EffectiveGrantDelivery.Disabled(GrantKind.RefreshToken), + EffectiveRedirectResponse.Disabled); + + var fixture = CreateFixture( + AuthFlowTestFactory.New(response: response)); + + fixture.HttpContext.Request.ContentType = + "application/x-www-form-urlencoded"; + + fixture.HttpContext.Request.Form = new FormCollection( + new Dictionary + { + ["authorization_code"] = "code", + ["code_verifier"] = "verifier" + }); + + var result = await fixture.Sut.CompleteAsync(fixture.HttpContext); + + ((IStatusCodeHttpResult)result).StatusCode + .Should().Be(StatusCodes.Status400BadRequest); + + fixture.PkceService.VerifyNoOtherCalls(); + fixture.CredentialWriter.VerifyNoOtherCalls(); + } + + [Fact] + public async Task CompleteAsync_FetchFailure_Returns401WithoutRedirect() + { + var fixture = CreateFixture(); + + fixture.HttpContext.Request.ContentType = + "application/x-www-form-urlencoded"; + + fixture.HttpContext.Request.Form = new FormCollection( + new Dictionary + { + ["authorization_code"] = "code", + ["code_verifier"] = "verifier", + ["__uauth_response_mode"] = "fetch" + }); + + fixture.PkceService + .Setup(x => x.CompleteAsync( + fixture.Flow, + It.IsAny(), + fixture.HttpContext.RequestAborted)) + .ReturnsAsync(new PkceCompleteResult + { + IsSuccess = false, + InvalidPkce = false + }); + + var result = await fixture.Sut.CompleteAsync( + fixture.HttpContext); + + ((IStatusCodeHttpResult)result).StatusCode + .Should().Be(StatusCodes.Status401Unauthorized); + + fixture.CredentialWriter.VerifyNoOtherCalls(); + fixture.RedirectResolver.VerifyNoOtherCalls(); + } + + [Fact] + public async Task CompleteAsync_SuccessfulFetch_ReturnsRedirectInBody() + { + var fixture = CreateFixture(); + + fixture.HttpContext.Request.ContentType = + "application/x-www-form-urlencoded"; + + fixture.HttpContext.Request.Form = new FormCollection( + new Dictionary + { + ["authorization_code"] = "code", + ["code_verifier"] = "verifier", + ["__uauth_response_mode"] = "fetch" + }); + + var sessionId = TestIds.Session("pkce-session"); + + fixture.PkceService + .Setup(x => x.CompleteAsync( + fixture.Flow, + It.IsAny(), + fixture.HttpContext.RequestAborted)) + .ReturnsAsync(new PkceCompleteResult + { + IsSuccess = true, + LoginResult = LoginResult.Success(sessionId) + }); + + fixture.CredentialWriter.Setup(x => x.Write( + fixture.HttpContext, + GrantKind.Session, + sessionId)); + + fixture.RedirectResolver.Setup(x => x.ResolveSuccess( + fixture.Flow, + fixture.HttpContext)) + .Returns(RedirectDecision.To("/home")); + + var result = await fixture.Sut.CompleteAsync( + fixture.HttpContext); + + ((IStatusCodeHttpResult)result).StatusCode.Should().Be(StatusCodes.Status200OK); + + var json = JsonSerializer.SerializeToElement( + ((IValueHttpResult)result).Value, + new JsonSerializerOptions(JsonSerializerDefaults.Web)); + + json.GetProperty("redirectUrl") + .GetString().Should().Be("/home"); + + fixture.CredentialWriter.Verify(x => x.Write( + fixture.HttpContext, + GrantKind.Session, + sessionId), Times.Once); + } + // --------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------- diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/RateLimitingPartitionTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/RateLimitingPartitionTests.cs index 321e9f95..3053b04c 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/RateLimitingPartitionTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/RateLimitingPartitionTests.cs @@ -40,9 +40,9 @@ public async Task RejectionForwardsNativeRetryMetadata() public void EveryEndpointHasTheReviewedClassification() { var all = Enum.GetValues().Select(UAuthEndpointClassification.Get).ToArray(); - Assert.Equal(83, all.Length); + Assert.Equal(84, all.Length); Assert.Equal(21, all.Count(x => x.Group == UAuthRateLimitGroup.Sensitive)); - Assert.Equal(57, all.Count(x => x.Group == UAuthRateLimitGroup.Standard)); + Assert.Equal(58, all.Count(x => x.Group == UAuthRateLimitGroup.Standard)); Assert.Equal(5, all.Count(x => x.Group == UAuthRateLimitGroup.Frequent)); Assert.Equal(UAuthRateLimitGroup.Sensitive, UAuthEndpointClassification.Get(UAuthEndpoint.CredentialResetBeginAnonymous).Group); Assert.Equal(UAuthRateLimitGroup.Standard, UAuthEndpointClassification.Get(UAuthEndpoint.VerifyUserIdentifierAdmin).Group); diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/TransportCredentialResolverTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/TransportCredentialResolverTests.cs index f63f6862..990ffca5 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/TransportCredentialResolverTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/TransportCredentialResolverTests.cs @@ -12,7 +12,6 @@ using CodeBeam.UltimateAuth.Tests.Unit.Helpers; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; using Moq; namespace CodeBeam.UltimateAuth.Tests.Unit.Server; @@ -123,14 +122,38 @@ public async Task ResolveAsync_PureJwt_WithRefreshAndAccessCookies_UsesAccessTok credential.Value.Should().Be("valid-jwt"); } + [Theory] + [InlineData(HeaderTokenFormat.Bearer)] + [InlineData(HeaderTokenFormat.Raw)] + public async Task ResolveAsync_PureJwt_UsesAuthorizationBearer_RegardlessOfResponseHeaderFormat(HeaderTokenFormat format) + { + var fixture = CreateFixture("uas=old-session"); + + fixture.Context.Request.Headers["Authorization"] = + "Bearer valid-jwt"; + + var response = CreateResponse( + GrantDeliveryMode.Header, + headerName: "X-UAuth-Access", + headerFormat: format); + + var credential = await fixture.Sut.ResolveAsync( + fixture.Context, + UAuthMode.PureJwt, + response); + + credential.Should().NotBeNull(); + credential!.Kind.Should().Be(TransportCredentialKind.AccessToken); + credential.Value.Should().Be("valid-jwt"); + } + [Theory] [InlineData(HeaderTokenFormat.Bearer, "Bearer valid-jwt")] [InlineData(HeaderTokenFormat.Raw, "valid-jwt")] - public async Task ResolveAsync_PureJwt_UsesConfiguredHeader( - HeaderTokenFormat format, - string value) + public async Task ResolveAsync_PureJwt_DoesNotUseResponseHeaderAsRequestCredential(HeaderTokenFormat format, string value) { var fixture = CreateFixture("uas=old-session"); + fixture.Context.Request.Headers["X-UAuth-Access"] = value; var response = CreateResponse( @@ -143,10 +166,7 @@ public async Task ResolveAsync_PureJwt_UsesConfiguredHeader( UAuthMode.PureJwt, response); - credential.Should().NotBeNull(); - credential!.Kind.Should() - .Be(TransportCredentialKind.AccessToken); - credential.Value.Should().Be("valid-jwt"); + credential.Should().BeNull(); } [Fact] diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/UAuthCorsHubOptionsSetupTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/UAuthCorsHubOptionsSetupTests.cs new file mode 100644 index 00000000..d4dc9bc7 --- /dev/null +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/UAuthCorsHubOptionsSetupTests.cs @@ -0,0 +1,102 @@ +using CodeBeam.UltimateAuth.Server.Options; +using Microsoft.AspNetCore.Cors.Infrastructure; +using Microsoft.Extensions.Options; + +namespace CodeBeam.UltimateAuth.Tests.Unit.Server; + +public class UAuthHubCorsOptionsSetupTests +{ + [Fact] + public void Configure_ExposesJwtTransportHeaders() + { + var server = new UAuthServerOptions(); + + server.Hub.AllowedClientOrigins.Add( + "https://app.example.com"); + + var setup = new UAuthHubCorsOptionsSetup( + Options.Create(server)); + + var cors = new CorsOptions(); + + setup.Configure(cors); + + var policy = cors.GetPolicy("UAuthHub"); + + Assert.NotNull(policy); + + Assert.Contains( + "https://app.example.com", + policy.Origins); + + Assert.True(policy.SupportsCredentials); + + Assert.Contains( + "uat", + policy.ExposedHeaders); + + Assert.Contains( + "X-UAuth-Access-Header", + policy.ExposedHeaders); + + Assert.Contains( + "X-UAuth-Access-Expires", + policy.ExposedHeaders); + + Assert.Contains( + "X-UAuth-Access-Format", + policy.ExposedHeaders); + + Assert.Contains( + "X-UAuth-Access-HeaderFormat", + policy.ExposedHeaders); + + Assert.DoesNotContain( + "*", + policy.Origins); + } + + [Fact] + public void Configure_ExposesConfiguredAccessTokenHeader() + { + var server = new UAuthServerOptions(); + + server.Hub.AllowedClientOrigins.Add( + "https://app.example.com"); + + server.GrantDelivery.AccessToken.HeaderName = + "X-Custom-Access"; + + var setup = new UAuthHubCorsOptionsSetup( + Options.Create(server)); + + var cors = new CorsOptions(); + + setup.Configure(cors); + + var policy = cors.GetPolicy("UAuthHub"); + + Assert.NotNull(policy); + + Assert.Contains( + "X-Custom-Access", + policy.ExposedHeaders); + } + + [Fact] + public void Configure_WithoutAllowedOrigins_DoesNotEnableCredentials() + { + var setup = new UAuthHubCorsOptionsSetup( + Options.Create(new UAuthServerOptions())); + + var cors = new CorsOptions(); + + setup.Configure(cors); + + var policy = cors.GetPolicy("UAuthHub"); + + Assert.NotNull(policy); + Assert.Empty(policy.Origins); + Assert.False(policy.SupportsCredentials); + } +} diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/UAuthLoginTransportEndpointTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/UAuthLoginTransportEndpointTests.cs new file mode 100644 index 00000000..a11ea35f --- /dev/null +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/UAuthLoginTransportEndpointTests.cs @@ -0,0 +1,60 @@ +using System.Text.Json; +using AwesomeAssertions; +using CodeBeam.UltimateAuth.Core.Contracts; +using CodeBeam.UltimateAuth.Core.Domain; +using CodeBeam.UltimateAuth.Core.Options; +using CodeBeam.UltimateAuth.Server.Auth; +using CodeBeam.UltimateAuth.Server.Endpoints; +using CodeBeam.UltimateAuth.Tests.Unit.Helpers; +using Microsoft.AspNetCore.Http; +using Moq; + +namespace CodeBeam.UltimateAuth.Tests.Unit.Server; + +public sealed class UAuthLoginTransportEndpointTests +{ + [Theory] + [InlineData(GrantDeliveryMode.Cookie, GrantDeliveryMode.None, true, true, false)] + [InlineData(GrantDeliveryMode.Cookie, GrantDeliveryMode.Header, true, false, true)] + [InlineData(GrantDeliveryMode.Header, GrantDeliveryMode.None, false, false, false)] + [InlineData(GrantDeliveryMode.Header, GrantDeliveryMode.Header, false, false, true)] + public void Get_ReportsEffectiveTransportCapabilities(GrantDeliveryMode session, GrantDeliveryMode access, bool supported, bool navigationSupported, bool accessTokenInHeader) + { + var response = new EffectiveAuthResponse( + Delivery(GrantKind.Session, session), + Delivery(GrantKind.AccessToken, access), + EffectiveGrantDelivery.Disabled(GrantKind.RefreshToken), + EffectiveRedirectResponse.Disabled); + + var flow = AuthFlowTestFactory.New(response: response); + + var accessor = new Mock(); + accessor.SetupGet(x => x.Current).Returns(flow); + + var context = new DefaultHttpContext(); + + var result = UAuthLoginTransportEndpoint.Get(context, accessor.Object); + + ((IStatusCodeHttpResult)result).StatusCode.Should().Be(StatusCodes.Status200OK); + + context.Response.Headers.CacheControl.ToString().Should().Be("no-store"); + + var json = JsonSerializer.SerializeToElement(((IValueHttpResult)result).Value, new JsonSerializerOptions(JsonSerializerDefaults.Web)); + json.GetProperty("supported").GetBoolean().Should().Be(supported); + json.GetProperty("navigationSupported").GetBoolean().Should().Be(navigationSupported); + json.GetProperty("accessTokenInHeader").GetBoolean().Should().Be(accessTokenInHeader); + } + + private static EffectiveGrantDelivery Delivery(GrantKind kind,GrantDeliveryMode mode) + { + if (mode == GrantDeliveryMode.None) + return EffectiveGrantDelivery.Disabled(kind); + + return new EffectiveGrantDelivery( + kind, + kind == GrantKind.AccessToken + ? TokenFormat.Jwt + : TokenFormat.Opaque, + mode); + } +} diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateCredentialResolverTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateCredentialResolverTests.cs index 2346dfa0..4292c38b 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateCredentialResolverTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateCredentialResolverTests.cs @@ -21,7 +21,7 @@ public async Task Session_cookie_should_resolve_and_trim_value() var context = CreateContext(); context.Request.Headers.Cookie = "uauth-session=%20session-123%20"; - var resolver = CreateResolver(PrimaryTokenKind.Session); + var resolver = CreateResolver(); var response = CreateResponse( session: CookieDelivery(GrantKind.Session, "uauth-session")); @@ -38,13 +38,12 @@ public async Task Session_cookie_should_resolve_and_trim_value() [InlineData(GrantDeliveryMode.None)] [InlineData(GrantDeliveryMode.Header)] [InlineData(GrantDeliveryMode.Body)] - public async Task Session_should_require_cookie_delivery( - GrantDeliveryMode mode) + public async Task Session_should_require_cookie_delivery(GrantDeliveryMode mode) { var context = CreateContext(); context.Request.Headers.Cookie = "uauth-session=session-123"; - var resolver = CreateResolver(PrimaryTokenKind.Session); + var resolver = CreateResolver(); var response = CreateResponse( session: new EffectiveGrantDelivery( GrantKind.Session, @@ -60,7 +59,7 @@ public async Task Session_should_require_cookie_delivery( public async Task Session_should_require_cookie_options() { var context = CreateContext(); - var resolver = CreateResolver(PrimaryTokenKind.Session); + var resolver = CreateResolver(); var response = CreateResponse( session: new EffectiveGrantDelivery( @@ -77,7 +76,7 @@ public async Task Session_should_require_cookie_options() public async Task Session_should_return_null_when_cookie_missing() { var context = CreateContext(); - var resolver = CreateResolver(PrimaryTokenKind.Session); + var resolver = CreateResolver(); var result = await resolver.ResolveAsync( context, @@ -99,7 +98,7 @@ public async Task Session_should_reject_blank_cookie(string value) context.Request.Headers.Cookie = $"uauth-session={Uri.EscapeDataString(value)}"; - var resolver = CreateResolver(PrimaryTokenKind.Session); + var resolver = CreateResolver(); var result = await resolver.ResolveAsync( context, @@ -112,144 +111,46 @@ public async Task Session_should_reject_blank_cookie(string value) } [Fact] - public async Task Access_token_should_resolve_bearer_header() + public async Task Session_cookie_should_take_precedence_over_authorization_header() { var context = CreateContext(); - context.Request.Headers.Authorization = "Bearer access-123"; - var resolver = CreateResolver(PrimaryTokenKind.AccessToken); + context.Request.Headers.Cookie = "uas=session-123"; + context.Request.Headers.Authorization = "Bearer access-jwt"; - var result = await resolver.ResolveAsync( - context, - CreateResponse(access: HeaderDelivery())); - - result.Should().NotBeNull(); - result!.Kind.Should().Be(PrimaryTokenKind.AccessToken); - result.Value.Should().Be("access-123"); - result.Tenant.Should().Be(context.GetTenant()); - result.Device.Should().NotBeNull(); - } - - [Fact] - public async Task Access_token_should_accept_case_insensitive_bearer_prefix() - { - var context = CreateContext(); - context.Request.Headers.Authorization = "bEaReR access-123"; - - var resolver = CreateResolver(PrimaryTokenKind.AccessToken); - - var result = await resolver.ResolveAsync( - context, - CreateResponse(access: HeaderDelivery())); - - result.Should().NotBeNull(); - result!.Value.Should().Be("access-123"); - } - - [Fact] - public async Task Access_token_should_support_custom_header() - { - var context = CreateContext(); - context.Request.Headers["X-Access-Token"] = "access-123"; - - var resolver = CreateResolver(PrimaryTokenKind.AccessToken); - - var result = await resolver.ResolveAsync( - context, - CreateResponse( - access: HeaderDelivery( - "X-Access-Token", - HeaderTokenFormat.Raw))); - - result.Should().NotBeNull(); - result!.Value.Should().Be("access-123"); - } + var resolver = CreateResolver(); - [Fact] - public async Task Raw_header_should_preserve_bearer_text() - { - var context = CreateContext(); - context.Request.Headers.Authorization = "Bearer access-123"; - - var resolver = CreateResolver(PrimaryTokenKind.AccessToken); + var response = CreateResponse( + session: CookieDelivery(GrantKind.Session, "uas"), + access: HeaderDelivery("uat")); - var result = await resolver.ResolveAsync( - context, - CreateResponse( - access: HeaderDelivery( - format: HeaderTokenFormat.Raw))); + var result = await resolver.ResolveAsync(context, response); result.Should().NotBeNull(); - result!.Value.Should().Be("Bearer access-123"); - } - - [Theory] - [InlineData(GrantDeliveryMode.None)] - [InlineData(GrantDeliveryMode.Cookie)] - [InlineData(GrantDeliveryMode.Body)] - public async Task Access_token_should_require_header_delivery( - GrantDeliveryMode mode) - { - var context = CreateContext(); - context.Request.Headers.Authorization = "Bearer access-123"; - - var resolver = CreateResolver(PrimaryTokenKind.AccessToken); - - var result = await resolver.ResolveAsync( - context, - CreateResponse( - access: new EffectiveGrantDelivery( - GrantKind.AccessToken, - TokenFormat.Jwt, - mode))); - - result.Should().BeNull(); + result!.Kind.Should().Be(PrimaryTokenKind.Session); + result.Value.Should().Be("session-123"); + result.Tenant.Should().Be(context.GetTenant()); + result.Device.Should().NotBeNull(); } [Fact] - public async Task Access_token_should_return_null_when_header_missing() + public async Task Authorization_header_without_session_cookie_should_not_resolve() { var context = CreateContext(); - var resolver = CreateResolver(PrimaryTokenKind.AccessToken); - - var result = await resolver.ResolveAsync( - context, - CreateResponse(access: HeaderDelivery())); - result.Should().BeNull(); - } + context.Request.Headers.Authorization = "Bearer access-jwt"; - [Theory] - [InlineData("")] - [InlineData(" ")] - [InlineData("Bearer ")] - [InlineData("Bearer ")] - public async Task Access_token_should_reject_blank_values(string value) - { - var context = CreateContext(); - context.Request.Headers.Authorization = value; + var resolver = CreateResolver(); - var resolver = CreateResolver(PrimaryTokenKind.AccessToken); + var response = CreateResponse( + session: CookieDelivery(GrantKind.Session, "uas"), + access: HeaderDelivery("uat")); - var result = await resolver.ResolveAsync( - context, - CreateResponse(access: HeaderDelivery())); + var result = await resolver.ResolveAsync(context, response); result.Should().BeNull(); } - [Fact] - public async Task Unsupported_primary_token_kind_should_return_null() - { - var context = CreateContext(); - var resolver = CreateResolver((PrimaryTokenKind)999); - - var result = await resolver.ResolveAsync( - context, - CreateResponse()); - - result.Should().BeNull(); - } private static HttpContext CreateContext() { @@ -264,11 +165,9 @@ private static HttpContext CreateContext() return context; } - private static ValidateCredentialResolver CreateResolver( - PrimaryTokenKind kind) + private static ValidateCredentialResolver CreateResolver() { - return new ValidateCredentialResolver( - new FixedPrimaryCredentialResolver(kind)); + return new ValidateCredentialResolver(); } private static EffectiveGrantDelivery CookieDelivery( diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateEndpointHandlerTests.cs b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateEndpointHandlerTests.cs index e579d09c..ea3da215 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateEndpointHandlerTests.cs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/Server/ValidateEndpointHandlerTests.cs @@ -487,12 +487,38 @@ public async Task ValidateAsync_WhenValidationIsActiveButHasNoUserKey_ReturnsUna } + [Fact] + public async Task ValidateAsync_PureJwt_NoCredential_ReturnsUnauthorizedNotFound() + { + var fixture = CreatePureJwtFixture( + AuthenticateResult.NoResult()); + + var result = await fixture.Sut.ValidateAsync( + fixture.HttpContext, + TestContext.Current.CancellationToken); + + var json = result.Should() + .BeOfType>() + .Subject; + + json.StatusCode.Should().Be(StatusCodes.Status401Unauthorized); + json.Value!.State.Should().Be(SessionState.NotFound); + json.Value.Snapshot.Should().BeNull(); + + fixture.CredentialResolver.VerifyNoOtherCalls(); + fixture.SessionValidator.VerifyNoOtherCalls(); + fixture.SnapshotFactory.VerifyNoOtherCalls(); + } + [Fact] public async Task ValidateAsync_PureJwt_AuthenticationFails_ReturnsUnauthorizedInvalid() { - var fixture = CreatePureJwtFixture(AuthenticateResult.NoResult()); + var fixture = CreatePureJwtFixture( + AuthenticateResult.Fail("Invalid access token")); - var result = await fixture.Sut.ValidateAsync(fixture.HttpContext, TestContext.Current.CancellationToken); + var result = await fixture.Sut.ValidateAsync( + fixture.HttpContext, + TestContext.Current.CancellationToken); var json = result.Should() .BeOfType>() diff --git a/tests/CodeBeam.UltimateAuth.Tests.Unit/javascript/uauth.test.cjs b/tests/CodeBeam.UltimateAuth.Tests.Unit/javascript/uauth.test.cjs index 27be7b53..750b0257 100644 --- a/tests/CodeBeam.UltimateAuth.Tests.Unit/javascript/uauth.test.cjs +++ b/tests/CodeBeam.UltimateAuth.Tests.Unit/javascript/uauth.test.cjs @@ -794,12 +794,29 @@ test("submitLoginForm TryAndCommit reuses original form", async () => { } }); + uauth.getLoginTransport = async options => { + assert.equal(options.url, "/auth/login/transport"); + assert.equal(options.applicationProfile, "BlazorServer"); + + return { + ok: true, + status: 200, + body: { + supported: true, + navigationSupported: true, + accessTokenInHeader: false + } + }; + }; + uauth.antiforgery.appendToForm = async () => { }; const result = await uauth.submitLoginForm(form, { mode: "TryAndCommit", tryUrl: "/auth/try-login", commitUrl: "/auth/login", + transportUrl: "/auth/login/transport", + transport: "Navigation", applicationProfile: "BlazorServer", trustedOrigin: null, isPkce: false @@ -807,7 +824,10 @@ test("submitLoginForm TryAndCommit reuses original form", async () => { assert.equal(result.isSuccess, true); assert.equal(form.submitCount, 1); - assert.equal(form.action, "https://localhost:6130/auth/login"); + assert.equal( + form.action, + "https://localhost:6130/auth/login" + ); assert.equal( form.elements.find(x => x.name === "PreviewReceipt")?.value, @@ -819,3 +839,128 @@ test("submitLoginForm TryAndCommit reuses original form", async () => { 1 ); }); + +test("submitLoginForm TryAndCommit uses fetch for header credentials", async () => { + const uauth = createEnvironment(); + + const form = new TestForm([ + { name: "Identifier", value: "alice" }, + { name: "Secret", value: "password123" } + ]); + + uauth.postJson = async () => ({ + status: 200, + body: { + isSuccess: true, + previewReceipt: "receipt-123" + } + }); + + uauth.getLoginTransport = async () => ({ + ok: true, + status: 200, + body: { + supported: true, + navigationSupported: false, + accessTokenInHeader: true + } + }); + + const commitResponse = { + ok: true, + status: 200, + body: { + redirectUrl: null + } + }; + + let commitCount = 0; + + uauth.commitLoginForm = async ( + submittedForm, + url, + applicationProfile, + trustedOrigin + ) => { + commitCount++; + + assert.equal(submittedForm, form); + assert.equal(url, "https://localhost:6130/auth/login"); + assert.equal(applicationProfile, "BlazorServer"); + assert.equal(trustedOrigin, null); + + assert.equal( + submittedForm.elements.find( + x => x.name === "PreviewReceipt" + )?.value, + "receipt-123" + ); + + return commitResponse; + }; + + const result = await uauth.submitLoginForm(form, { + mode: "TryAndCommit", + tryUrl: "/auth/try-login", + commitUrl: "/auth/login", + transportUrl: "/auth/login/transport", + transport: "Auto", + returnUrl: "/home", + applicationProfile: "BlazorServer", + trustedOrigin: null, + isPkce: false + }); + + assert.equal(result.isSuccess, true); + assert.equal(result.accessTokenInHeader, true); + assert.equal(result.commit, commitResponse); + + assert.equal(commitCount, 1); + assert.equal(form.submitCount, 0); + + assert.equal( + form.elements.filter(x => x.name === "Secret").length, + 1 + ); +}); + +test("submitLoginForm rejects navigation for header credentials", async () => { + const uauth = createEnvironment(); + + const form = new TestForm([ + { name: "Identifier", value: "alice" }, + { name: "Secret", value: "password123" } + ]); + + uauth.getLoginTransport = async () => ({ + ok: true, + status: 200, + body: { + supported: true, + navigationSupported: false, + accessTokenInHeader: true + } + }); + + let commitCount = 0; + + uauth.commitLoginForm = async () => { + commitCount++; + }; + + await assert.rejects( + uauth.submitLoginForm(form, { + mode: "DirectCommit", + commitUrl: "/auth/login", + transportUrl: "/auth/login/transport", + transport: "Navigation", + applicationProfile: "BlazorServer", + trustedOrigin: null, + isPkce: false + }), + /Navigation is incompatible with header-based credential delivery/ + ); + + assert.equal(form.submitCount, 0); + assert.equal(commitCount, 0); +});