Starts in:
2 DAYS
9 HRS
16 MIN
53 SEC
Starts in:
2 D
9 H
16 M
53 S
Open Closed

User lost credentials after 30min without activity #4677


User avatar
0
david.hurtado created

We use Authorization Service, to validate and enable items for menu. Sometimes if the user remain in the app without make any activity all the permissions return in false, when the user change language all permissions sets agian with the true values.

  • ABP Framework version: v7.0.1
  • UI type: Blazor Server
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • We migrate the app from abp version 4.4.0 to 7.0.1
  • Steps to reproduce the issue:"
  • This is an example of code that we use: AuthorizationService.AuthorizeAsync(TicketsPermissions.Tickets.Default)).Succeeded;

This code return false even the user have the access set.

This is another example:

if ((await AuthorizationService.AuthorizeAsync(TicketsPermissions.Tickets.Default)).Succeeded

{

context.Menu.Items.Insert(MenuIndex++,

new ApplicationMenuItem( TicketsMenus.Tickets, l["Menu:Tickets"], url: "/tickets", icon: "fas fa-headset", order: MenuIndex)

);

}

When we debug this procedure AuthorizationService.AuthorizeAsync(TicketsPermissions.Tickets.Default)).Succeeded return false and the screen user doesn't paint with the respective menu item.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The Blazor server project uses OpenId Connect for authentication, and the default validity period of the token is 30 minutes.

    You can change its lifetime.

    PreConfigure<OpenIddictServerBuilder>(builder =>
    {
        builder.SetAccessTokenLifetime(TimeSpan.FromMinutes(30));
    });
    

    and we add a new feature, you can copy code to your project https://github.com/abpframework/abp/pull/15876

  • User Avatar
    0
    david.hurtado created

    Thanks it's work Ok

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06