Hi,
We are trying to override pages on our multi-tenanted solution with Angular as a frontend. We are following the documentation here by creating the same file on the Pages/Account folder. This worked. https://abp.io/docs/latest/framework/ui/mvc-razor-pages/customization-user-interface
However, in the multi-tenanted original ABP login page, there is a requirement for users to key in the Tenant first, then key in their username + password for the login. Our clarifications are as follows:
Can we please get the reference for the login .cshtml and .cs page, we cannot see how Tenant is being derived in the pages. We have been scanning through the github repo below but could not find the page. Our intention is for the user not to key in their target tenant at login, and to have the application derive the tenant instead. https://github.com/abpframework/abp/tree/dev
Where can we get the full source code for application modules? Was there a commercial repo that we can be invited to?
Looking at the table design for a multil-tenanted solution, was the original intention/assumption for 1 user to exclusively be in 1 tenant? Because with the table 'AbpUsers' with userId as a PK and tenant as a property, users can only be in one tenant exclusively.
Thank you
Regards, Daniel
2 Answer(s)
-
0
The login page in ABP is provided by the Account Module, and its source code is not included directly in your solution by default. To customize it, you typically create a new PageModel and .cshtml file under Pages/Account in your own project, which overrides the default. The reference implementation for the login page can be found here:
- Login PageModel (.cs):
https://github.com/abpframework/abp/blob/dev/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs - Login Page (.cshtml):
https://github.com/abpframework/abp/blob/dev/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml
In a multi-tenant setup, the tenant is typically resolved before login using tenant resolvers (domain, query string, or cookie). If you want to derive the tenant automatically (e.g., from username or email), you need to customize the login logic to resolve the tenant before authenticating the user. This is not the default behavior; by default, the user must specify the tenant.
- Login PageModel (.cs):
The full source code for open-source ABP modules is available on GitHub:
https://github.com/abpframework/abp/tree/dev/modules
For commercial modules, access is provided to customers with a valid commercial license. You can request access by contacting Volosoft through the official channels after purchasing a commercial license:
https://commercial.abp.io/The default ABP table design assumes that a user belongs to a single tenant (the AbpUsers table has a TenantId column). This means a user is exclusive to one tenant. If you need users to belong to multiple tenants, you would need to implement a custom solution, as this is not supported out-of-the-box.
Sources:
- https://abp.io/docs/latest/framework/ui/mvc-razor-pages/customization-user-interface
- https://github.com/abpframework/abp/tree/dev/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml
- https://github.com/abpframework/abp/tree/dev/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs
- https://commercial.abp.io/
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
hi
Can we please get the reference for the login .cshtml and .cs page, we cannot see how Tenant is being derived in the pages. We have been scanning through the github repo below but could not find the page. Our intention is for the user not to key in their target tenant at login, and to have the application derive the tenant instead.
The tenant selection is from the Account layout page.
eg: https://github.com/abpframework/abp/blob/dev/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml#L70-L98
What is your current MVC theme?
Where can we get the full source code for application modules? Was there a commercial repo that we can be invited to?
You can download the module source code, There is no git repos, see https://abp.io/docs/latest/suite/source-code
Thanks.