I have abp.io AuthServer and HttpApi.Host services running on my domain. What abp.io NuGet packages should I install in my non-abp.io asp.net core mvc application to make use of AuthServer and HttpApi.Host services? I want to get current user information and permissions. I want to get full advantage of ABP from my third part asp.net core project.
16 Answer(s)
-
0
If your ASP.NET Core MVC app is not an ABP application, there is no ABP NuGet package set that will “plug in” ABP features (like
ICurrentUser, ABP permission checker, dynamic claims, etc.) into that app the same way an ABP-based UI does. Those are ABP infrastructure pieces that assume an ABP startup/module system and ABP’s application-configuration pipeline.The supported/straightforward approach for a non-ABP MVC app is:
- Use standard OpenID Connect to authenticate the user against your ABP AuthServer.
- Call your ABP HttpApi.Host endpoints with the obtained access token (plain
HttpClientor your own typed clients). - For current user info, use the token’s claims and/or call ABP endpoints (commonly the
/api/abp/application-configurationendpoint or your own “profile” endpoint). - For permissions, either:
- Call an ABP endpoint that returns granted permissions (again,
/api/abp/application-configurationcontains auth-related info for ABP clients), or - Put permissions into JWT claims (customize claims on the AuthServer side) and then use standard ASP.NET Core authorization policies in your non-ABP app.
- Call an ABP endpoint that returns granted permissions (again,
If your main goal is to “get full advantage of ABP” from that MVC app, the definitive solution is to convert it to an ABP application (create an ABP MVC UI project and integrate/port your existing UI into it). That’s the only way to use ABP’s built-in concepts (
ICurrentUser, ABP permission system integration, JS auth API, etc.) natively.For client-side permission checks in an ABP MVC/Razor UI, ABP provides a JavaScript Auth API; however, that API assumes ABP UI integration and ABP application-configuration endpoints are available/consumed as ABP expects.
Links (verified):
- https://abp.io/docs/latest/framework/fundamentals/authorization#permission-system
- https://abp.io/docs/latest/framework/ui/mvc-razor-pages/javascript-api/auth
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
I see! I want to convert it to an ABP application, BUT I do not like to use the LeptonX Theme. I have my own HTML5 theme. Thus, how to convert it to ABP application that uses the AuthServer and HttpApi.Host services as well as other ABP features like ICurrentUser and permission management?
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
- Create a new ABP MVC UI project (Web) that is configured as a tiered/separated solution so it can use your existing AuthServer and HttpApi.Host.
- Do not use LeptonX in that UI project:
- Use the Basic theme and then replace the layout/assets with your own HTML5 theme (or build a custom theme module later).
- Once the UI is an ABP app, you automatically get ABP features like
ICurrentUser, permission management, ABP’s authorization infrastructure, JS APIs, etc., while authenticating against your AuthServer and calling your HttpApi.Host.
1) Convert by creating an ABP MVC UI project that connects to your existing backends
- Create an ABP solution with MVC UI (tiered / auth server separated).
- Configure the UI (Web) project to:
- Authenticate via OpenID Connect against your existing AuthServer
- Use ABP’s HTTP API client/proxy approach (or plain HttpClient) to call your existing HttpApi.Host
- Port your existing MVC controllers/views into the ABP Web project.
Once you do this, ABP will provide
ICurrentUserin your UI project (it’s populated from the logged-in principal) and ABP permission checks will work through ABP’s authorization system.2) Use your own HTML5 theme (without LeptonX)
You have two practical options:
Option A (recommended to start): Use Basic theme + override layouts/assets
- Keep the ABP MVC UI running with
AbpAspNetCoreMvcUiBasicThemeModuleand replace the UI look by overriding the theme/layout files and including your own CSS/JS bundles. - ABP supports adding global styles/scripts and theming fundamentals via bundling/theming system (so you can inject your template’s CSS/JS cleanly).
Option B: Create/bring a theme module
- If you want a reusable theme as a module, you can create a theme project (like the AdminLTE community sample) and depend on it from your Web module.
A working example of adding a different MVC theme module (AdminLTE) shows the pattern (add theme module dependency + bring static assets through VFS, etc.). You can apply the same approach with your own theme.
3) Overriding the MVC layout to match your HTML template
If you are on ABP Commercial and your project has LeptonX, you can override LeptonX layouts by copying layout files into the same virtual path structure (ABP will pick yours). Even if you don’t use LeptonX, the same “layout override” concept applies: put your own layout and set
Layout = "...cshtml"in pages when needed.A verified guide specifically explains overriding LeptonX MVC layouts (same technique: copy layout into your web project with the same folder hierarchy, or point a page to a custom layout path):
4) After conversion: using ABP features in UI
- Current user: inject and use
ICurrentUserin your MVC controllers/views/services. - Permissions: use ABP permission checks (server-side) and ABP’s JS Auth API (client-side) where appropriate.
Sources (verified)
- https://docs.abp.io/en/abp/latest/UI/AspNetCore/Theming
- https://abp.io/support/questions/8873
- https://abp.io/community/articles/gssbhb7m
- https://abp.io/docs/latest/ui-themes/lepton-x/mvc
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
I see! Let me re-define the problem. In my existing tiered solution that hosts AuthServer and HttpApi.Host, I have already the *.Web LeptonX themed project that servers back-end administrative purposes. That is complete. But for the Public Facing Website, I want to use my own corporate theme instead. It is totally another solution (the second solution). It is client to the existing ABP based AuthServer and HttpApi.Host (the first solution). Please give me detailed steps on how to build the second solution with ABP Commercial.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
- Build the second solution as an ABP MVC UI app (Public Website) that:
- authenticates users via your existing AuthServer (OIDC),
- calls your existing HttpApi.Host as a remote service,
- uses Basic theme / your own corporate layout (no LeptonX),
- and therefore can use ABP infrastructure (
ICurrentUser, permission checks, localization, bundling, etc.) in a first-class way.
Below is a complete, end-to-end setup that matches your architecture (Solution #1 = existing tiered backend, Solution #2 = separate public website).
1) Create Solution #2 (Public Website) as an ABP MVC app (not LeptonX)
- Create a new ABP Commercial solution with MVC/Razor Pages UI (a “Web” app).
- Select/ensure it uses the Basic theme (or remove LeptonX packages afterward and depend on Basic theme module).
- This new solution’s purpose is “UI only” (no AuthServer, no HttpApi.Host).
Then you will configure it to point to Solution #1’s endpoints.
2) Register a new IdentityServer/OpenIddict Client for the Public Website (in Solution #1)
In your existing AuthServer (Solution #1), add a new client for the public website, e.g.:
- ClientId:
MyCompany_PublicWeb - Grant type: Authorization Code (+ PKCE if applicable)
- Redirect URI(s):
https://public.mycompany.com/signin-oidc(and dev URLs) - Post logout redirect URI(s):
https://public.mycompany.com/signout-callback-oidc - Allowed scopes: include
openid profile email role+ your API scope(s)
This is the same pattern as adding any additional UI client to a tiered ABP solution.
Also ensure Solution #1 allows CORS/redirects for the public domain where necessary (mainly affects API calls and OIDC redirect validation).
3) Configure authentication in Solution #2 to use Solution #1 AuthServer
In Solution #2 (PublicWeb), configure OpenID Connect authority to your AuthServer URL.
Conceptually you will set:
- Authority =
https://auth.mycompany.com - ClientId =
MyCompany_PublicWeb - ResponseType =
code - SaveTokens =
true(so you can call HttpApi.Host with access token)
(ABP MVC templates already have an OIDC setup style; you will replace the URLs/client settings to point to your existing AuthServer.)
This way, after login, the authenticated principal exists in the MVC app and ABP can populate:
ICurrentUserCurrentTenant(if applicable)- permission checks (depending on how you fetch/use granted permissions; see step 5)
4) Configure Solution #2 to call Solution #1 HttpApi.Host as a remote service
In Solution #2, configure a remote service base URL pointing to your existing HttpApi.Host, e.g.:
- RemoteServices:Default:BaseUrl =
https://api.mycompany.com
Then use ABP’s HTTP API client/proxy approach for consuming endpoints from Solution #1:
- Prefer adding the
*.HttpApi.Clientpackage/project (from Solution #1) into Solution #2 and depending on its module (common ABP pattern for “UI consumes remote service”).
This is the same approach described in ABP’s “add microservice UI to an application” guide: add the HttpApi.Client reference and depend on its module from your web module.
Validated reference:
- https://abp.io/docs/latest/guides/add-microservice
- https://abp.io/docs/10.2/guides/add-microservice
5) Getting current user info + permissions in the Public Website
Once Solution #2 is an ABP app and the user authenticates via OIDC:
Current user (
ICurrentUser)- Just inject and use
ICurrentUseranywhere in your PublicWeb solution (controllers, razor pages, application services). - It is populated from the authenticated principal.
Permissions
ABP’s permission system is still the source of truth on the server side (Solution #1). In the Public Website (Solution #2), you typically do:
- Server-side permission checks: call your backend and let it enforce
[Authorize(PermissionName)](best practice). - UI-level permission decisions: obtain granted permissions using ABP’s standard client-side patterns (ABP UI expects the backend “application configuration” info).
ABP permission system documentation (validated):
- https://abp.io/docs/latest/framework/fundamentals/authorization#permission-system
6) Remove/avoid LeptonX and use your corporate theme in Solution #2
Use ABP MVC theming/bundling and replace the layout & static assets:
- Use the Basic theme as the base (so you don’t inherit LeptonX UI).
- Put your corporate HTML5 theme assets under
wwwrootand register them via ABP bundling/theming. - Replace/override the shared layout(s) used by your public pages to match your corporate theme.
ABP theming doc (validated):
- https://abp.io/docs/latest/UI/AspNetCore/Theming
If you need a reference for “overriding the default theme layouts” style behavior, the LeptonX MVC doc explains the MVC theme structure (even if you’re not using it) (validated):
- https://abp.io/docs/latest/ui-themes/lepton-x/mvc
7) Deployment checklist (so it works against the existing backend)
In Solution #1 (existing):
- Add the new OIDC client (
MyCompany_PublicWeb) with correct redirect/logout URLs. - Ensure the AuthServer is reachable from the public site.
- Ensure HttpApi.Host is reachable and configured for the public site origin if you are doing browser-based API calls.
In Solution #2 (public website):
- Configure OIDC Authority/ClientId/ClientSecret (if used) to match what you seeded in Solution #1.
- Configure RemoteServices base URL to Solution #1 HttpApi.Host.
- Ensure HTTPS and correct callback URLs.
Notes about “PublicWeb” templates / dynamic proxies
If you plan to use ABP’s dynamic JavaScript proxies on a public site, be aware of template differences (some “public web” setups don’t generate proxies by default). If you need dynamic proxies, you may need to enable conventional controllers in that UI project (this is a known pattern in support answers). (If you instead use typed C# HttpApi.Client proxies, you avoid that entirely.)
Related (validated) support thread showing “public app” scenario and the fact ABP templates include OIDC client pieces
- https://abp.io/support/questions/6010
If you follow the steps above, Solution #2 becomes a “real ABP UI client” of Solution #1, while using your own corporate HTML theme (Basic theme + custom layout/assets), and you’ll be able to use
ICurrentUser+ ABP authorization/permission infrastructure properly.
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - Build the second solution as an ABP MVC UI app (Public Website) that:
-
0
It should be a tiered UI client (but “UI-only”) in practice:
Tiered (recommended): Create Solution #2 using the tiered application template, so you get a clean separation like:
PublicWeb.HttpApi(controllers that your public MVC pages can call internally if needed, and a place for public endpoints)PublicWeb.Web(the MVC/Razor UI)- plus the usual layered projects (
Domain,Application,EntityFrameworkCore, etc.)
Even though Solution #2 won’t host its own AuthServer or HttpApi.Host, using the tiered template aligns best with “this is a separate UI client app that talks to remote AuthServer + remote HttpApi.Host”.
Single-layer: Not recommended for your scenario if you want “full ABP advantages” and long-term maintainability; it’s intended for simpler apps and doesn’t match well with “separate UI solution consuming a remote ABP backend”.
So, for your architecture: Solution #1 remains your existing tiered backend (AuthServer + HttpApi.Host), and Solution #2 should also be created as a tiered ABP MVC solution, but configured to authenticate against Solution #1 AuthServer and call Solution #1 HttpApi.Host as a remote service, while using your corporate theme (Basic theme + custom layout/assets).
Links (verified):
- https://abp.io/docs/latest/solution-templates/single-layer-web-application/
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
- Yes — in Solution #2 you should add a Public Website application (layer/app) (a separate Web application) that uses your corporate theme.
- Practically, that means Solution #2 will have two UI apps:
*.Web(keep it for admin/backoffice if you want, or remove it if Solution #2 is only public)*.PublicWeb(your public-facing site with your own theme)
Steps (Solution #2)
- Create Solution #2 as a tiered ABP MVC solution (ABP Commercial).
- Add a new Web application for the public site:
- In ABP Studio, add a new Web application (module) and choose MVC UI and Basic theme (so you don’t get LeptonX).
- Name it something like
YourCompany.PublicWeb(orYourSolutionName.PublicWeb).
- In
*.PublicWeb, configure: - Implement your corporate theme by customizing/overriding MVC layouts and bundling in
*.PublicWebusing ABP’s theming system (start from Basic theme and replace layout + bundles).
Important note about “layer”
In ABP terms, Public Website is not a “layer” like Domain/Application; it’s an additional application (a host/UI app) inside the solution.
(verified references)
- https://abp.io/docs/latest/framework/ui/mvc-razor-pages/theming
- https://abp.io/support/questions/8884
- https://abp.io/docs/latest/solution-templates
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
- You replace the Basic Theme layout by overriding its Razor layout files in your Web project (same virtual path), and you replace/extend the Basic Theme bundles by configuring
AbpBundlingOptions(and optionally usingBundleContributorto add/remove/replace files).
1) Replace (override) the Basic Theme layout(s)
ABP resolves theme files via the Virtual File System; if you add a file to your app with the same folder structure, your file overrides the theme’s file.
What to do
Locate Basic Theme’s original layout/component files (for reference):
- Basic theme source:
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
- Basic theme source:
Copy the file(s) you want to override into your
*.Web(PublicWeb) project and keep the same path under the project root, for example:Themes/Basic/Layouts/Application.cshtmlThemes/Basic/Layouts/Account.cshtmlThemes/Basic/Components/MainNavbar/Default.cshtml- etc.
Edit those copied files to match your corporate HTML template.
Critical requirement (don’t remove these)
In your layout, ABP needs its dynamic scripts right after the global script bundle:
<abp-script-bundle name="..." /> <script src="~/Abp/ApplicationConfigurationScript"></script> <script src="~/Abp/ServiceProxyScript"></script>These scripts are mentioned in the theming docs and are required for ABP JS-side features that depend on application configuration / proxies.
2) Replace / customize Basic Theme bundles (CSS/JS)
Basic Theme defines standard bundle names. In your Web module (e.g.,
YourPublicWebModule), configureAbpBundlingOptionsto:- add your theme files,
- replace built-in ones (like Bootstrap),
- remove ones you don’t want.
Add your corporate CSS/JS to global bundles
Put your assets under
wwwroot(or underwwwroot/libs/...) and then:using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; public override void ConfigureServices(ServiceConfigurationContext context) { Configure<AbpBundlingOptions>(options => { options.StyleBundles.Configure( BasicThemeBundles.Styles.Global, bundle => { // Add your theme css bundle.AddFiles("/themes/corporate/css/site.css"); }); options.ScriptBundles.Configure( BasicThemeBundles.Scripts.Global, bundle => { // Add your theme js bundle.AddFiles("/themes/corporate/js/site.js"); }); }); }Replace a file inside an existing bundle (recommended approach)
Use a
BundleContributorandcontext.Files.ReplaceOne(...)(example shown in the Bootswatch article) to replace Bootstrap with your own CSS (or another framework):using Volo.Abp.AspNetCore.Mvc.UI.Bundling; public class CorporateStyleContributor : BundleContributor { public override void ConfigureBundle(BundleConfigurationContext context) { context.Files.ReplaceOne( "/libs/bootstrap/css/bootstrap.css", "/themes/corporate/css/bootstrap-custom.css" ); } }Register the contributor:
Configure<AbpBundlingOptions>(options => { options.StyleBundles.Configure( BasicThemeBundles.Styles.Global, bundle => { bundle.AddContributors(typeof(CorporateStyleContributor)); }); });Remove a JS/CSS from a standard bundle
ABP support-provided approach (example removes jQuery) is also via
BundleContributor:using System; using System.Linq; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; public class RemoveJqueryScriptContributor : BundleContributor { public override void ConfigureBundle(BundleConfigurationContext context) { var jquery = context.Files.FirstOrDefault( x => x.EndsWith("jquery.js", StringComparison.InvariantCultureIgnoreCase)); if (jquery != null) { context.Files.Remove(jquery); } } }And register it on the global scripts bundle.
3) If your corporate theme uses npm libraries
Use ABP’s resource mapping +
abp install-libsworkflow (as shown in the Bootswatch article):- Map
node_modulesfiles towwwroot/libs/...inabp.resourcemapping.js - Run:
abp install-libs - Then reference those files via bundles.
Links (validated)
- https://abp.io/docs/latest/framework/ui/mvc-razor-pages/theming
- https://abp.io/docs/latest/framework/ui/mvc-razor-pages/bundling-minification#bundle-contributors
- https://abp.io/community/articles/4luoqzr0
- https://abp.io/support/questions/184
- https://github.com/abpframework/abp/tree/dev/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - You replace the Basic Theme layout by overriding its Razor layout files in your Web project (same virtual path), and you replace/extend the Basic Theme bundles by configuring
-
0
No — you don’t have to download the Basic Theme module as a project just to replace the layout and bundles.
1) Recommended approach (most common)
- Keep using the NuGet package
Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic. - Override the theme’s
.cshtmlfiles by copying only the files you want to change into your PublicWeb project, preserving the same folder structure (so your files override the embedded ones). - Customize bundles in your PublicWeb module via
AbpBundlingOptions/BundleContributor(no need for theme source code).
2) When you do bring Basic Theme source into your solution
Only do this if you want to heavily modify the theme as a reusable module (change components deeply, maintain a forked theme, etc.). In that case, ABP explicitly supports copying the Basic Theme source code into your solution.
ABP even provides a CLI command to copy Basic Theme source into your solution:
abp add-source-code Volo.Abp.BasicTheme(links verified)
- https://abp.io/docs/latest/framework/ui/mvc-razor-pages/basic-theme
- https://abp.io/docs/10.2/framework/ui/mvc-razor-pages/basic-theme
- https://abp.io/docs/latest/cli
- https://github.com/abpframework/abp/tree/dev/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - Keep using the NuGet package
-
0
They are inside the Basic Theme package’s embedded resources. In the ABP Framework source code, you can see (and copy from) them here:
Basic Theme root project (contains all the
.cshtmlfiles):
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.BasicLayouts (.cshtml):
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts
(e.g.,Themes/Basic/Layouts/Application.cshtml,Themes/Basic/Layouts/Account.cshtml)Theme view components (.cshtml):
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/...
(e.g., navbar, toolbar, brand, etc.)
To override any of these in your app, create the same relative path in your Web project (e.g.,
Themes/Basic/Layouts/Application.cshtml) and your file will override the theme’s embedded one.- https://github.com/abpframework/abp/tree/dev/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
- https://github.com/abpframework/abp/blob/dev/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts
- https://abp.io/docs/latest/framework/ui/mvc-razor-pages/customization-user-interface
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)