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)
-
0
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
-
0
Thanks it's work Ok