Skip to content
New Livestream: How Banks Protect Their Apps with FAPI 2.0. Register Now!

Stores

Stores in IdentityServer are the persistence layer abstractions responsible for managing various types of data needed for the authentication and authorization processes. They provide interfaces to store and retrieve configuration and operational data. All store interfaces live in the Duende.IdentityServer.Stores namespace.

Configuration stores manage the relatively static data that defines how IdentityServer behaves:

StorePurpose
IClientStoreClient application registrations
IResourceStoreAPI resources, API scopes, and identity resources
IIdentityProviderStoreDynamic external identity providers
ICorsPolicyServiceCORS origin validation for clients
IConnectedApplicationStoreRead-only unified access to all registered applications across protocols (OIDC clients and SAML service providers)
ISamlServiceProviderStoreSAML Service Provider configuration retrieval by entity ID (used when SAML is enabled)

Operational stores manage transient, runtime data that supports active authentication flows. Several higher-level interfaces (IAuthorizationCodeStore, IRefreshTokenStore, IReferenceTokenStore, IUserConsentStore) are backed by IPersistedGrantStore by default. Replacing IPersistedGrantStore is usually sufficient, but each can be replaced individually for finer-grained control.

StorePurpose
IPersistedGrantStoreAuthorization codes, refresh tokens, reference tokens, and user consent (the primary operational store)
IAuthorizationCodeStoreAuthorization codes issued during the Authorization Code flow (backed by IPersistedGrantStore by default)
IRefreshTokenStoreRefresh tokens, including rotation/update semantics (backed by IPersistedGrantStore by default)
IReferenceTokenStoreReference tokens used when clients receive opaque handles instead of JWTs (backed by IPersistedGrantStore by default)
IUserConsentStoreRemembered user consent decisions per subject/client pair (backed by IPersistedGrantStore by default)
IDeviceFlowStoreDevice authorization grant data
IBackChannelAuthenticationRequestStoreCIBA authentication requests
IPushedAuthorizationRequestStorePushed Authorization Requests (PAR)
IServerSideSessionStoreServer-side user sessions
ISigningKeyStoreAutomatic key management signing keys

These stores provide signing and validation keys to the runtime:

StorePurpose
ISigningCredentialStoreProvides the active signing credential for token signing
IValidationKeysStoreProvides all public keys for token validation (published via JWKS)

IdentityServer provides default in-memory implementations suitable for development and testing. These are registered via the DI extension methods:

builder.Services.AddIdentityServer()
.AddInMemoryClients(Config.Clients)
.AddInMemoryApiScopes(Config.ApiScopes)
.AddInMemoryIdentityResources(Config.IdentityResources);

For production environments, use the Entity Framework Core integration or implement custom stores using your preferred database technology.