> This page is for version V3 - Beta (default).
> For other versions, use one of these documentation indexes:
> - V3 - Beta (default): https://docs.authlyx.dev/v3/llms.txt
> - V2 - Legacy: https://docs.authlyx.dev/v2/llms.txt
> - V1 - End of support: https://docs.authlyx.dev/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.authlyx.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.authlyx.dev/_mcp/server.

# Offline access

> Server-controlled access when a connection is unavailable.

Offline access lets a previously authenticated customer keep using protected parts of MyApp without reaching AuthlyX for a limited time. It uses a signed permit issued while the customer is online. It is not a way for a brand-new customer to sign in for the first time without internet.

This can help during a service outage, loss of internet or an unreliable connection. A slow connection may cause requests to time out; a valid offline permit can cover the interruption within its deadline. Local verification can be faster than a network round trip, but offline mode is not a replacement for online authorization whenever the server is reachable.

## How permission reaches the device

You enable offline access in the app settings and choose the maximum window. The customer signs in online. While the session is valid, the client obtains a challenge, signs the proof and requests a permit. AuthlyX checks access and signs an expiry that the customer cannot legitimately extend.

```mermaid
flowchart TD
    A[Developer enables offline access and chooses a maximum window] --> B[Customer signs in to MyApp while online]
    B --> C[Client requests an offline challenge]
    C --> D[Client proves possession of its installation private key]
    D --> E[Server checks identity, policy and remaining expiry]
    E --> F[Server signs a permit for this app, identity and installation]
    F --> G[SDK saves permit in protected local storage]
    G --> H[Later: MyApp cannot reach AuthlyX]
    H --> I{Valid signature, matching installation and unexpired permit?}
    I -->|Yes| J[Allow permitted offline use until the signed deadline]
    I -->|No| K[Ask customer to reconnect; keep work safe where possible]
    J --> L[Connection returns]
    L --> M[Check current server access]
    M --> N[Continue online or stop access if revoked]
```

## Example: a 24-hour window

A customer signs in to MyApp on Monday morning and saves a permit. You allow up to 24 hours offline. If their license expires in six hours, the permit must not grant another 24 hours beyond that expiry. The server decides the actual deadline using both the policy and remaining access.

If the customer loses internet that afternoon, MyApp can verify the saved permit locally. No request can reach an offline endpoint while the network is unavailable. The challenge and permit endpoints are for issuing permission before the outage.

## Advantages

* Customers can keep working through temporary internet or service failures.
* Access remains bounded by a signed deadline instead of an editable local date.
* Local checks avoid waiting for an unreachable server on every protected action.

## Limitations

* A ban made while the customer is disconnected cannot be learned immediately. A longer window means a longer potential delay.
* A customer who controls their device can modify their own program. Signatures and protected storage do not make the local machine tamper-proof.
* Missing, corrupted or expired state must not silently create fresh access.
* First-time authentication and obtaining a new permit still require the server.

## Reconnection and expiry

When a verified server response revokes access, stop relying on the old offline permission. When the permit expires during an outage, ask the customer to reconnect. The SDK should not kill the process; your app can lock protected actions while allowing work to be saved.

Check the SDK's offline-access methods for its current persistence behaviour. Do not assume every SDK saves a permit automatically. Protected Windows storage also requires a usable user profile; test it under the same user and deployment conditions as your customers.