Skip to content

Conversation

RawanMatar89
Copy link

This PR proposes OEP-68: Multi-Tenant Support in Open edX Mobile Apps.

The OEP introduces a mechanism for users to select their institution (tenant) at runtime, with each tenant providing its own branding, configuration, and API endpoints. This reduces duplication, enables a white-labeling model, and lowers long-term maintenance costs compared to maintaining separate app builds.

Key highlights:
• Tenant selector at login if multiple tenants exist.
• Tenant metadata stored in a JSON config (branding, URLs, auth).
• Separate database per tenant for isolation.
• Push notification manager updated to handle tenant context.
• Backwards compatible: single-tenant configs behave like current app.

Future enhancements may include fetching tenants dynamically from an API and supporting runtime tenant switching.

@openedx-webhooks
Copy link

Thanks for the pull request, @RawanMatar89!

This repository is currently maintained by @sarina.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@OmarIthawi
Copy link
Member

@RawanMatar89 Thanks for opening this OEP draft.

@volodymyr-chekyrta @IvanStepanok @edschema I would love your support to help Rawan get this OEP moving forward.

We have a lot of work that's out of my expertise in mobile. I will be contributing to the work in regards to its server-related and SAML related issues.


Future Work
***********
- Fetch tenant metadata dynamically from an API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a sense of how complex this is? Dynamic addition of tenants feels like the feature that really unlocks the value of a centralized app. It would potentially introduce some bigger questions like "do we need a registry of academies?" However, the technical piece doesn't feel too complicated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a sense of how complex this is?

@e0d it's probably less complex than it looks like.

t would potentially introduce some bigger questions like "do we need a registry of academies?" However, the technical piece doesn't feel too complicated.

I would suggest that we don't have a centralized registry.

I recommend considering the following login flow for the centralized app:

Enter the URL:
Email:
Password:
This is Moodle app workflow and I think it's a good one.

Having a directory in Firebase or any other REST API backend is nice to show an auto-complete on the URL field, but the app should be generic for everyone to include installations of institutions who many not know how to apply i.e. someone who barely speaks English and just wants to try the app on their institute.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the Moodle flow authenticate on the part of the learner? If that's how it works, I would recommend a different approach using OAuth. One would get the URL of the backend, maybe via a QR for ease, and then be directed via the OAuth flow to authorize the mobile app to access the appropriate scopes.

@itsjeyd itsjeyd moved this from Needs Triage to Waiting on Author in Contributions Sep 16, 2025
@edschema
Copy link

edschema commented Sep 17, 2025

Hi @RawanMatar89 and @IvanStepanok. Really excited to see this!
I think it will be helpful to enumerate the tradeoffs of this approach vs others (remote configuration or build time configuration) in more detail to give visibility into the benefits of each. This relates to conversations that were held around implications on push notifications, theming, and offline modes.

Would like to have all the thinking laid out so those in the community can understand the impact of this approach and why the team working on this believes it's still preferable to others.

@edschema
Copy link

Another question: what impact will this shift have on instances that only require a single tenant solution?

@IvanStepanok
Copy link

Two concerns that may block Multi-Tenant adoption

  1. Third-party authentication (Google/Microsoft/Facebook, SAML/OIDC).
    Today the mobile apps ship with a single OAuth client per LMS installation, which makes third-party sign-in effectively app-scoped at build time. In a multi-tenant runtime, this constrains us to the basic username/password flow unless we add a per-tenant web-based login. Pragmatically: drive login via a WebView/deep link to each tenant’s LMS auth (OIDC/SAML) and return to the app via the standard OAuth redirect, so every tenant controls its own IdPs without baking them into the app. 
  2. Theming/branding.
    If we intend to adopt Paragon’s design-token theming, we should land that first and then enable multi-tenant branding. Otherwise we risk building a bespoke theme manager now and re-implementing it to align with Paragon tokens later. I have an MVP that switches themes at runtime by loading CSS from the LMS for web content. Native surfaces can read the same tokens to keep parity. 

https://stepanok.com/test-themes/theme1_light.css

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2025-09-29.at.15.52.31.yafw.balanced.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

7 participants