when login to demo tenant, and switch to host website as below:
will get error page:
below is the error details:
System.ArgumentNullException: Value cannot be null. Parameter name: user Module "Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory
1", in CreateAsync
Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess
Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
Module "Abp.Authorization.AbpUserClaimsPrincipalFactory2", in CreateAsync Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Abp.Threading.InternalAsyncHelper+<AwaitTaskWithPostActionAndFinallyAndGetResult>d__5
1", in MoveNext
Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess
Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
File "d:\a\1\s\src\GrowMyCompany.Core\Authorization\Users\UserLinkManager.cs", line 123, col 13, in GetSwitchedUserAndIdentity
Void MoveNext()
Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess
Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
File "d:\a\1\s\src\GrowMyCompany.Web.Mvc\Controllers\AccountController.cs", line 847, col 13, in SwitchToLinkedAccountSignIn
Void MoveNext()
Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess
Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
Module "Abp.Threading.InternalAsyncHelper+<AwaitTaskWithPostActionAndFinallyAndGetResult>d__51", in MoveNext Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "(unknown)", in lambda_method Module "Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable+Awaiter", in GetResult Module "Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", in InvokeActionMethodAsync Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", in InvokeNextActionFilterAsync Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", in Rethrow Module "Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", in Next Module "Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", in InvokeInnerFilterAsync Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in InvokeNextExceptionFilterAsync Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in Rethrow Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in Next Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in InvokeNextResourceFilter Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in Rethrow Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in Next Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in InvokeFilterPipelineAsync Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker", in InvokeAsync Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Builder.RouterMiddleware", in Invoke Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware", in Invoke Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "IdentityServer4.Hosting.IdentityServerMiddleware", in Invoke Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Authentication.AuthenticationMiddleware", in Invoke Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware", in Invoke Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "IdentityServer4.Hosting.BaseUrlMiddleware", in Invoke Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d", in MoveNext Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d", in MoveNext Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Authentication.AuthenticationMiddleware", in Invoke Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification Module "Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware", in Invoke
we have not change the security code for user login and switch to link user, do you know what is the problem?
11 Answer(s)
-
0
hi @banksearch
- What is your zero version?
- What are the steps to reproduce the problem?
-
0
hi, @maliming how to check my zero version?
to produce the problem
- login to tenant website as tenant admin.
- right click on the menu in the topright.
- select the link from linked users, which refer to the host user.
- website try to direct to the host website, and get the error/exception page.
-
0
Please check the version in the
\aspnet-core\src\MyCompanyName.AbpZeroTemplate.Core\AppVersionHelper.cs
file.I can't seem to reproduce your problem with 7.0.
-
0
HI @maliming We have version 5.1 https://docs.aspnetzero.com/documents/common/latest/Change-Logs#v5-1-0-2018-02-05
-
0
Is it convenient to share your project source code? My email: [email protected]
Or set breakpoint debugging in the GetSwitchedUserAndIdentity method to see why user is null
var user = await _userManager.FindByIdAsync(cacheItem.TargetUserId.ToString());
-
0
we try to debug the project in local machine, and add break point to the
GetSwitchedUserAndIdentity
method, it is working when debug it, the user can load without any problem, but when we deploy the code to Azure, the problem happen.PS: we target to the same azure db when we debug in local.
-
0
Is the application using memory caching or Redis?
Can you try to clear the cache?
-
0
HI @maliming we use memory caching, and we have try to clear teh cache, but still have the problem.
-
0
Can you write some messages from the production environment to the log?
Such as the
GetSwitchedUserAndIdentity
methodswitchAccountToken
cacheItem.ToJsonString()
-
0
-
0
Is
cacheItem.TargetUserId
a valid UserId when the application is running at azure?