Adapter
Storage Adapter
Specifies the storage adapter implementation for persisting authorization server state. The default implementation provides a basic in-memory adapter suitable for development and testing purposes only. When this process is restarted, all stored information will be lost. Production deployments MUST provide a custom adapter implementation that persists data to external storage (e.g., database, Redis, etc.).
The adapter constructor will be instantiated for each model type when first accessed.
To prevent concurrent replay, the ReplayDetection adapter’s upsert SHOULD use an atomic insert-if-absent operation and reject when an unexpired entry already exists.
To prevent concurrent reuse, consume SHOULD atomically mark the entry as consumed only if it is not already consumed, and reject otherwise. Returning false is not sufficient because the provider awaits the operation but ignores its return value.
See:
- The expected interface
- Example MongoDB adapter implementation
- Example Redis adapter implementation
- Example Redis w/ JSON Adapter
- Default in-memory adapter implementation
- Community Contributed Adapter Archive
type:
AdapterConstructor | AdapterFactory