Your identity server is just a standard ASP.NET Core application including the IdentityServer middleware. Read the official Microsoft documentation on publishing and deployment first (and especially the section about load balancers and proxies).
Typically you will design your IdentityServer deployment for high availability:
IdentityServer itself is stateless and does not require server affinity - but there is data that needs to be shared between the instances.
This typically includes:
- startup configuration, e.g. key material, external provider settings etc…
The way you store that data depends on your environment. In situations where configuration data rarely changes we recommend using the in-memory stores and code or configuration files.
In highly dynamic environments (e.g. Saas) we recommend using a database or configuration service to load configuration dynamically.
You can also build your own configuration stores by implementing
Another important piece of startup configuration is your key material, see here for more details on key material and cryptography.
For certain operations, IdentityServer needs a persistence store to keep state, this includes:
- issuing authorization codes
- issuing reference and refresh tokens
- storing consent
You can either use a traditional database for storing operational data, or use a cache with persistence features like Redis. The EF Core implementation mentioned above has also support for operational data.
You can also implement support for your own custom storage mechanism by implementing
IPersistedGrantStore - by default IdentityServer injects an in-memory version.