-
ABP Framework version: v8.3.4
-
UI Type: Angular
-
Database System: EF Core (SQL Server & PostgreSQL)
-
Tiered (for MVC) or Auth Server Separated (for Angular): yes
-
Steps to reproduce the issue:
I have enabled the Dynamic Claims feature in my application to prevent concurrent logins by adding the following configurations in HttpApiHostModule and AuthServerModule:
context.Services.Configure(options =>
{
options.IsDynamicClaimsEnabled = true;
});
app.UseDynamicClaims();
I placed app.UseDynamicClaims(); before app.UseAuthorization(); as recommended in the documentation.
However, I am facing the following issue:
When logging in as a host admin, the granted permissions are empty in the application configuration. This prevents the admin from seeing menus and accessing certain pages.
5 Answer(s)
-
0
hi
How can I reproduce this problem in a new template project?
Can you share the code and steps?
Thanks
-
0
hi,
This happens even in MVC.
To reproduce as I noticed: you wait (without any actions somtimes) till Token expired but not the cookie, when the Web call HostApi which not accept Web Token. this issue happend.I tried to change cookie and Token configs but still face it.
Most of times Logging out not solve it. Nor clean browser cache.
This happens in development and prodctuion environmentsCurrently The ONLY WORKAROUND FOR THIS : Clean REDIS cache
I think this related to some enryption keys for Token stored in REDIS cache, when clear the cache the system re-generate some keys.
-
0
hi
I tried to change cookie and Token configs but still face it.
Do you mean this?
https://abp.io/docs/latest/modules/openiddict-pro#setting-tokens-lifetime
Can you try to call
CheckTokenExpiration
inAddCookies
?context.Services.AddAuthentication(options => { options.DefaultScheme = "Cookies"; options.DefaultChallengeScheme = "oidc"; }) .AddCookie("Cookies", options => { options.ExpireTimeSpan = TimeSpan.FromDays(365); options.CheckTokenExpiration(); }) .AddAbpOpenIdConnect("oidc", options => { options.Authority = configuration["AuthServer:Authority"]; options.RequireHttpsMetadata = configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata");
-
0
Yes, I did that too, but the problem still persists.
Were you able to reproduce this issue? -
0
hi
To reproduce as I noticed: you wait (without any actions somtimes) till Token expired but not the cookie,
The
CheckTokenExpiration
method will check your access_token. It will log out the cookies if the token is invalid.Can you set a breakpoint on this method to see what happened?
Thanks.