فتح مغلق

How to configure/implement inactive session timeout #888


User avatar
0
nhontran خلقت
  • 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?


6 إجابة (إجابات)
  • User Avatar
    1
    Moyaoxiang خلقت
  • User Avatar
    0
    nhontran خلقت

    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;
                    });
    
  • User Avatar
    0
    nhontran خلقت

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

  • User Avatar
    0
    nhontran خلقت

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

  • User Avatar
    0
    Moyaoxiang خلقت

    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

  • User Avatar
    0
    ServiceBot خلقت
    فريق الدعم Automatic process manager

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

Made with ❤️ on ABP v8.2.0-preview Updated on مارس 25, 2024, 15:11