Open Closed

How to configure/implement inactive session timeout #888


User avatar
0
nhontran created
  • ABP Framework version: v3.3.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi, I have requirement that need to force user to logout and re-login if they are inactive for 30 minutes, is there any configuration/setting to achieve it?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

6 Answer(s)
  • User Avatar
    1
    Moyaoxiang created
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    nhontran created

    Hi @Moyaoxiang, thanks for your prompt reply.

    I have tried but it does not seem work, I set the ExpireTimeSpan = 10 mins and SlidingExpiration = true, then I left the application inactive for 11 mins, it did not force me to re-login, I was still able to using it.

    context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
                    .AddJwtBearer(options =>
                    {
                        options.Authority = configuration["AuthServer:Authority"];
                        options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
                        options.Audience = "TestingApplication";
                    })
                    .AddCookie("Cookies", options =>
                    {
                        options.ExpireTimeSpan = TimeSpan.FromMinutes(10);
                        options.SlidingExpiration = true;
                    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    nhontran created

    Hi @Moyaoxiang, do you have any idea why it does not work?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    nhontran created

    Hi, we still could not make it work, is there anyone can advise on this?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Moyaoxiang created

    Hi nhontran, As Issue 975 said, Angular uses JWT for authentication and cannot actively log out on the front end. Currently JWT is issued through Identity Server 4. Perhaps you can change the LifeTime of AccessToken in Identity Data Seeder. This is the documentation: http://docs.identityserver.io/en/latest/reference/client.html

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.