Customising the .Net Core Identity Login

I have searched for an answer to my question, but I haven’t found anything yet. I am writing a same-database multi-tenanted application. It seems that the Multi-tenancy guidance in ServiceStack is geared towards switching databases at runtime, but this is not valid for me.

I am trying to alter the Authenticate service to also check the Tenant when performing a login. The reason here is that the same username/email could be in the Users table twice, just under different tenants. I just can’t see where the customisation points are for this in the AuthFeature.

I’m not sure if its relevant, but the application is an existing WebAPI and I am slowly testing SS by introducing some services as SS, but obviously Auth needs to come along for the ride.

What’s the actual question? If you’re already using Web API does that mean you’re already using Identity Auth, if that’s the case why can’t you use your existing Auth?

I guess this is where I show my ignorance. All the inbuilt features like the AdminUI seem to want to use the SS authentication bits.

I assumed it would be easier just to switch to the SS way of doing it as it is still very early doors rather than trying to bend it the other way.

In that case I’d recommend going through the last few release notes, at least from v8 where ServiceStack has switched to use ASP .NET Core built-in features:

Which is now the default in all of ServiceStack’s new .NET 8 templates.

Alternatively the ServiceStack Blog may be an easier read to jump directly to the features you’re interested in:

https://servicestack.net/blog

E.g. we also have a built-in Admin Users UI for Identity Auth:

Thanks Demis.

I’ll re-read them as I’ve read them all.

I guess one question would be what is the extension point to get a Tenant property included on a login request?

So when I am logging in, I supply the tenant (presumably through the Meta property) - what do I need to override to get this included in the login process? I thought the AuthRepository, but the Meta property doesn’t seem available.

Whatever you’re doing before you should keep doing. There is no Auth Repository with Identity Auth, you’d have to use its Sign In Manager classes and EF ApplicationUser class directly.