Finbuckle.MultiTenant icon indicating copy to clipboard operation
Finbuckle.MultiTenant copied to clipboard

Some help with authentication please. No tenant found in authentication properties.

Open phinett opened this issue 3 years ago • 2 comments

Hi,

Just looking to get the basics working at the moment with cookie authentication. I have a static strategy setup which is working fine.

I have my login page, and the user authenticates fine using .net identity (_signInManager.SignInAsync(user, vm.RememberMe);)

I can see a correct cookie has been created, but when i try and view a page which checks if they are authorized my user principle is null.

I am seeing this message in my debug console: No tenant found in authentication properties.

Am i missing a step or configuration somewhere?

this.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie();

       `       
        this.AddMultiTenant<MyTenantInfo>()
              .WithConfigurationStore()
              .WithStaticStrategy("amber")
              .WithPerTenantAuthentication()
              .WithPerTenantOptions<CookieAuthenticationOptions>((o, tenantInfo) =>
              {
                    o.Cookie.Name = "SM_AuthCookie_" + tenantInfo.Id;
              });;`

phinett avatar Dec 02 '22 11:12 phinett

Any luck working around this? If you can link me to a simple repo that recreates the issue I can take a closer look. Also, WithPerTenantOption for cookie name shouldn't be needed and might be the cause of the issue.

AndrewTriesToCode avatar Dec 09 '22 03:12 AndrewTriesToCode