I have a custom memebership provider that has served us well for asp.net web forms applications and am now using it in a new asp.net MVC multi-tenancy application.
The membership provider works well in MVC, just as within webforms, but now want to add an additional constraint where we can check if a User is both authenticated and authenticated for a specific "Tenant". We are currently tracking the current "TenantID" based on URLs and detect any changes to URLs and instead of just checking User.Identity.IsAuthenticated, we have something like this in our Controller and View base classes.
public bool UserIsAuthenticated
{
get
{
return (User.Identity.IsAuthenticated && LoggedInUserTenantID == CurrentTenantID);
}
}
How can we override/replace User.Identity.IsAuthenticated so we can use that directly?
Any suggestions or comments on the above welcome...