Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:08:54+00:00 2026-06-13T21:08:54+00:00

I need to develop a custom RoleProvider for a MultiTenant web app. At the

  • 0

I need to develop a custom RoleProvider for a MultiTenant web app.
At the DB level, we have a table that relates Users with Roles with Tenants.

enter image description here

My problem is that RoleProvider gets user roles just passing the User as parameter, and we need to take the Tenant into account.

In RoleProvider implementation we have:

public override string[] GetRolesForUser(string username)
{
    //Code to retrieve roles from repo
}

As the roles are for a user in an specific Tenant, we need:

public override string[] GetRolesForUser(string username, int tenantId)
{
    //Code to retrieve roles from repo
}

The current tenant is stored in the ControllerBase class (the one that all controllers inhereted from).

The Membership and Role Providers are in a separate project, so I don’t see a way to use the current Tenant. I think I could create my custom RoleProvider in the web app project.

Any idea on how to implement the RoleProvider interface taking the Tenant as part of the input ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:08:55+00:00Added an answer on June 13, 2026 at 9:08 pm

    Well, just to inform you what I did in my case:

    As our routes are in the form of http://[tenantName].[domain]/[App]/[Area] we ended up getting the [tenantName] from the Request, since it is unique, and with the Tenant and the UserName that came as a parameter I can do my select on our UsersInTenants' table.

    The very same can be done using cookies as a way to pass aditional information.

    So you can access the request, with the cookies, but for what I research the Session is not yet initialized in most cases.

    Hope it helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to develop an app that runs side by side with a django-app.
I am trying to develop an iPad app in which I need to have
I have a client that runs a small business. They need a custom database
We have been using a web application framework to build apps that need to
I have the need to develop a custom HttpHandler in SharePoint. To start, I
I currently have a web app that uses the google maps API, PHP, and
I need to develop an application on Android platform that enables a client to
I need to develop a service that will perform login through several login providers
I need to develop a Lotus Notes plug-in that adds some UI to Lotus
I need to develop a easy web site, I usually use bootstrap CSS framework,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.