We are working on the Sitecore 10
version. Recently, we got a requirement where we need to update the logout time
for Sitecore Admin
users, so if they are not using it for more than 2 minutes then they should be logged out from the system.
Initially, we were updating some configuration changes in some configs in our Sitecore site directory but it was not solving the issue.
After investigating it more, we found that we need to update some settings in the configuration settings in the Sitecore Identity server site. And here is the solution that we found to do that. Follow these steps to do it.
- Go to your Identity server website root and open the file called
identityServer.xml
from the below location.
wwwroot<your-identity-server>\sitecore\Sitecore.Plugin.IdentityServer\Config\identityServer.xml
- Update the setting called
IdentityTokenLifetimeInSeconds
in seconds. For example, if I want to log out a user after 2 minutes, the setting will be like this.
120
- There is another setting we found in this file i.e.
CookieLifetime
and added the time for 2 minutes. This setting sets the identity server cookie lifetime and should be used like this.
0.00:02:00
Finally, you need to restart the Sitecore Identity Server by going into IIS so that the updated configuration is consumed on startup.
That’s All. Now if you login into Sitecore and it is ideal for 2 minutes then it will perform the logout session after 2 minutes.
Hope it helps!
Credit: https://sbhatiablogs.wordpress.com/2023/02/23/how-to-change-sitecore-identity-server-logout-time/