- What is your product version? v11.0.1
- What is your product type (Angular or MVC)? Angular
- What is product framework type (.net framework or .net core)? .Net Core 6
I've been trying to implement E-mail based tenant login, and have used the code in these articles below:
https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Core-Angular-Sign-In-Without-Specifying-Tenant https://support.aspnetzero.com/QA/Questions/10855/remove-tenant-from-the-login-screen---You-are-not-logged-in-as-a-host-user
When trying this out, I get past the code which Logs in the user, but an exception is raised further down:
TokenAuthController.cs CreateJwtClaims():
await _userManager.AddTokenValidityKeyAsync( user, tokenValidityKey, expirationDate );
System.InvalidOperationException: The navigation 'User.Tokens' cannot be loaded because the entity is not being tracked. Navigations can only be loaded for tracked entities.
at Microsoft.EntityFrameworkCore.Internal.EntityFinder1.<LoadAsync>d__11.MoveNext() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase
3.<EnsureCollectionLoadedAsync>d__451.MoveNext() at Abp.Domain.Repositories.RepositoryExtensions.<EnsureCollectionLoadedAsync>d__0
3.MoveNext()
at Abp.Authorization.Users.AbpUserStore2.<>c__DisplayClass170_0.<<AddTokenValidityKeyAsync>b__0>d.MoveNext() at Abp.Domain.Uow.UnitOfWorkManagerExtensions.<WithUnitOfWorkAsync>d__1.MoveNext() at Abp.Authorization.Users.AbpUserStore
2.<AddTokenValidityKeyAsync>d__170.MoveNext()
at Abp.Authorization.Users.AbpUserManager`2.
Any ideas on what could be causing this?
10 Answer(s)
-
0
@elecosoftseservice we will try to reproduce it and inform you.
-
0
Hi @elecosoftseservice
I followed this tutorial in fresh solution and same version but I couldn't reproduce it. May you have disabled the entity framework core tracking?
-
0
Hi, many thanks for checking this through so quickly.
I haven't changed EF tracking from the default in the solution.
I'm unsure of the inner workings of the Authentication framework to know what the exception message is telling me is going on, or where to look to debug this further. Can you suggest maybe where to look or what this code is trying to do please?
-
0
Hi @elecosoftseservice
Is it possible to share your projetc via email with [email protected] ? We can find the problem faster by looking at your project.
-
0
Hi,
Unfortunately I'm unable to send across the project code as it's the companies IP and would likely have to go through Legal to get an NDA drawn up.
If you're able to give some pointers though, that would be very helpful.
I'm unsure of the inner workings of the Authentication framework to know what the exception message is telling me is going on, or where to look to debug this further. Can you suggest maybe where to look or what this code is trying to do please?
-
0
Hi,
It is hard to detect the problem without looking at the code because we don't get any error when we make same implementation on a not modified project. Would it be possible to arrange an online meeting and check the problem ?
-
0
Hi,
Yes, if we could arrange that please it would be a great help.
-
0
Hi,
Could you send an email to [email protected] including your timezone ?
-
0
Thankyou, Email sent.
-
0
Thanks, we will arrange the meeting via email.