Prerequisites
Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
- What is your product version asp.net zero 7.2?
- What is your product type (Angular or MVC)? Angular
- What is product framework type (.net framework or .net core)? .net core
If issue related with ABP Framework
- What is ABP Framework version?
If issue is about UI
- Which theme are you using?
- What are the theme settings?
We have a deployment on Azure with scaled out enabled with 3 instances for Web API tier.
ARR (Affinity Cookie) configuration is enabled to allow all requiests to be directed to the same instance for a given user (sticky session) .
All the functionality works fine except for Impersonation. When admin user selects one of the other users to impersonate he gets an error:
"Abp.UI.UserFriendlyException: Impersonation token is invalid or expired! at PatientPortal.Authorization.Impersonation.ImpersonationManager.GetImpersonatedUserAndIdentity(String impersonationToken) in D:\a\1\s\src\PatientPortal.Core\Authorization\Impersonation\ImpersonationManager.cs:line 38 at PatientPortal.Web.Controllers.TokenAuthController.ImpersonatedAuthenticate(String impersonationToken) in D:\a\1\s\src\PatientPortal.Web.Core\Controllers\TokenAuthController.cs:line 346 at lambdamethod(Closure , Object ) at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult() at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at System.Threading.Tasks.ValueTask1.getResult() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() UserFriendlyException.Code:0 UserFriendlyException.Details:"
We use AbpMemoryCacheManager, and if every user requests hits the same appservice instance there should not be an issue.
Please share your experience with such issues
Thanks, Sergei
1 Answer(s)
-
0
Hi @MellowoodMedical
Do you use Redis on your app ? If not, this feature is handled with InMemory cache by default and will cause such problem multi instance environment. You can read https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Clustered-Environment for more info.