IdentityServer4 automatically logout after 30 minutes

As far as I know this is neither Identity Server 4 nor OpenID Connect issue.

It is the logic of Asp.Net Identity cookies. This should be configurable at the Startup.cs.

You need to add following cookie configuration:

services.ConfigureApplicationCookie(o =>
{
    o.ExpireTimeSpan = TimeSpan.FromHours(24);
    o.SlidingExpiration = true;
});

This answer is inspired from following answers:

  • Why doesn't cookie ExpireTimeSpan setting work?
  • ASP.NET Identity Session Timeout
  • Why does my IdentityServer4 based server timeout in 30 minutes and only support SSO in the first 30 minutes?