I am new to IdentityServer4.
In our project we are using IdentityServer4 in Authentication Module (Using IdentityServer4 version 4.0.4).
We are using AD and ADFS as identity provider.
Now we need to deploy the project in a load balanced environment.
As per my reading, I found that we need to use SQLServerDistributedCaching for IdentityServer in Load Balanced environment.
I have added the below reference in the startup class.
using Microsoft.Extensions.Caching.SqlServer; (Installed the required Nuget package)
Added below code in ConfigureServices method
------------------------------------------
services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString =[MY Sql Server Database Connection String];
options.SchemaName = "dbo";
options.TableName = "DistributedCaching";
});
=====================================================
Also, I have created the below table:
----------------------------------------------
CREATE TABLE [dbo].[DistributedCaching](
[ID] nvarchar NOT NULL,
[Value] varbinary NOT NULL,
[ExpiresAtTime] datetimeoffset NOT NULL,
[SlidingExpirationInSeconds] [bigint] NULL,
[AbsoluteExpiration] datetimeoffset NULL,
CONSTRAINT [PK_DistributedCaching] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
==============================================================
I have verified the connection string too.
Now, I log in to the application, navigating to different modules. But couldn't see any value stored in the table.
Not sure if I am missing anything.
Please help me on this. What are the value should be cached from IdentityServer and how I can store those in the table.
What I have tried:
Already mentioned in the question how I have tried.