When I do ABP upgrade from 8 to 10 (Micro Service template), I noticed that in new ABP code template that created by ABP legacy Cli, in the yarp, it is "AccountAdmin": { "ClusterId": "AuthServer", "Match": { "Path": "/api/account-admin/{**catch-all}" } }, However in our existing code base (Ocelot), it is: { "ServiceKey": "Identity Service", "DownstreamPathTemplate": "/api/account-admin/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44388 } ], "UpstreamPathTemplate": "/api/account-admin/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] },
Since in this upgrade, we also ugrade Ocelot to Yarp, shall we change Yarp per ABP template? Is there any backend code changes need to in Auth Server?
6 Answer(s)
-
0
Yes — when migrating the Microservice template gateway from Ocelot to YARP, you should align your gateway routes with the current ABP template conventions, i.e. use:
"/api/account-admin/{**catch-all}"(YARP catch-all syntax)
Your Ocelot route:
"/api/account-admin/{everything}"is functionally the same intent (a catch-all), just using Ocelot’s placeholder style. In YARP the equivalent is{**catch-all}.
No AuthServer backend code change is required just because of this route change, as long as:
- The AuthServer still exposes its endpoints under the same prefix (i.e.
/api/account-admin/...), and - Your gateway forwards that path to the AuthServer cluster.
- The AuthServer still exposes its endpoints under the same prefix (i.e.
What you need to do is only gateway configuration (YARP) consistency:
- Keep the upstream path as
/api/account-admin/... - Route it to the same cluster you use for AuthServer (as in the ABP template:
ClusterId: "AuthServer")
Example YARP route (as template):
- Keep the upstream path as
"AccountAdmin": { "ClusterId": "AuthServer", "Match": { "Path": "/api/account-admin/{**catch-all}" } }- Practical note during upgrade:
- If your existing clients (Angular/Blazor/etc.) already call
/api/account-admin/..., then switching the gateway from Ocelot to YARP with the route above will be transparent. - If you had any custom upstream path mapping in Ocelot (different upstream vs downstream), then you’d replicate that in YARP with
Match.Path+Transforms(but in what you shared, upstream == downstream, so no transform is needed).
- If your existing clients (Angular/Blazor/etc.) already call
Sources:
- https://abp.io/docs/latest/solution-templates/microservice/api-gateways
- https://abp.io/docs/10.2/solution-templates/microservice/api-gateways
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
Hi,
Yes, you should follow the new template and route
/api/account-admin/{**catch-all}to the AuthServer cluster, not Identity. Starting from ABP 8.0, theaccount-adminendpoints (login/auth related settings such as two-factor, recaptcha, external providers, idle timeout, passkey) were moved fromIdentityServicetoAuthServeras the official architecture, and the gateway templates were updated accordingly when we switched from Ocelot to YARP.So your gateway route should look like this (this is exactly what the latest microservice template ships):
"AccountAdmin": { "ClusterId": "AuthServer", "Match": { "Path": "/api/account-admin/{**catch-all}" } }On the AuthServer backend side, please double-check two places:
MyCompanyName.MyProjectName.AuthServer.csprojreferences both Account Admin packages (use the same version as the rest of your ABP packages):
<PackageReference Include="Volo.Abp.Account.Pro.Admin.HttpApi" Version="10.x.x" /> <PackageReference Include="Volo.Abp.Account.Pro.Admin.Application" Version="10.x.x" />MyProjectNameAuthServerModule.csdeclares the dependency:
[DependsOn( // ... existing modules typeof(AbpAccountPublicWebOpenIddictModule), typeof(AbpAccountPublicApplicationModule), typeof(AbpAccountPublicHttpApiModule), typeof(AbpAccountAdminApplicationModule), typeof(AbpAccountAdminHttpApiModule), // ... )] public class MyProjectNameAuthServerModule : AbpModule { }If you upgraded with the ABP CLI those usually get applied for you, but for an 8 → 10 upgrade where the AuthServer project may have started life on an older template, it's worth verifying. Once those two pieces are in place, no other backend code change is required — the controllers (
AccountSettingsController, route prefixapi/account-admin/settings) come fromVolo.Abp.Account.Pro.Admin.HttpApiand will be exposed by AuthServer automatically.After applying the change, you can confirm by hitting AuthServer's swagger directly and looking for the
/api/account-admin/...endpoints there.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Hi,
Yes, that's expected — both services do register the
AccountSettingscontroller because bothIdentityService.HttpApiandAuthServerdeclare a dependency onAbpAccountAdminHttpApiModule. This is leftover from the older Ocelot template, where the gateway used to route/api/account-admin/...toIdentityService(port 44388). Starting from ABP 8.0 the gateway route was moved toAuthServer, but the dependency on the IdentityService side was kept in the template, so both services still surface the same endpoints in their swagger.Functionally it doesn't cause any issue:
- The gateway only routes
/api/account-admin/{**catch-all}to theAuthServercluster, so the controller copy living insideIdentityServiceis never reached through the gateway. - You can simply ignore the duplicate appearing in
IdentityServiceswagger — no code change needed on your side.
If you really want to clean it up so
IdentityServiceno longer exposes those endpoints, you can remove the Account Admin references from the IdentityService projects (IdentityService.HttpApi.csproj/IdentityService.Application.csprojand the matching[DependsOn(...)]entries in their module files). But this is purely cosmetic — keeping them as-is matches the current ABP template and is perfectly fine.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - The gateway only routes
-
0
thanks.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
