Skip to content

Commit af6e18a

Browse files
authored
Merge pull request #25132 from abpframework/auto-merge/rel-10-2/4442
Merge branch dev with rel-10.2
2 parents eca97b2 + 520d506 commit af6e18a

3 files changed

Lines changed: 105 additions & 2 deletions

File tree

docs/en/modules/cms-kit/index.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,56 @@ All features are individually usable. If you disable a feature, it completely di
3838
- CMS Kit uses [distributed cache](../../framework/fundamentals/caching.md) for responding faster.
3939
> Using a distributed cache, such as [Redis](../../framework/fundamentals/redis-cache.md), is highly recommended for data consistency in distributed/clustered deployments.
4040
41+
## Identity Integration for User Lookup
42+
43+
CMS Kit uses `ICmsUserLookupService` when it needs user information for features such as comments, ratings, blog post management and user synchronization.
44+
45+
If the CMS Kit and Identity modules run in the same application, no extra configuration is typically needed.
46+
47+
If the Identity module runs in another application or service (for example, in a tiered or distributed solution), CMS Kit may need to call the Identity integration endpoints remotely to create or update `CmsUser` records.
48+
49+
In that case, the calling application should:
50+
51+
* Depend on `Volo.Abp.Identity.HttpApi.Client`.
52+
* Add `AbpIdentityHttpApiClientModule` and an IdentityModel module (`AbpHttpClientIdentityModelWebModule` for web applications or `AbpHttpClientIdentityModelModule` for non-web hosts).
53+
* Configure `RemoteServices:AbpIdentity` to point to the application that hosts the Identity module.
54+
* Configure `IdentityClients` for client credentials flow so the lookup can use server-to-server authentication.
55+
* Expose integration services on the application that hosts the Identity module.
56+
57+
Example module dependency for a web application:
58+
59+
```csharp
60+
[DependsOn(
61+
typeof(AbpIdentityHttpApiClientModule),
62+
typeof(AbpHttpClientIdentityModelWebModule)
63+
)]
64+
public class MyWebModule : AbpModule
65+
{
66+
}
67+
```
68+
69+
Example `appsettings.json` configuration:
70+
71+
```json
72+
"RemoteServices": {
73+
"AbpIdentity": {
74+
"BaseUrl": "https://localhost:44388/",
75+
"UseCurrentAccessToken": false
76+
}
77+
},
78+
"IdentityClients": {
79+
"Default": {
80+
"GrantType": "client_credentials",
81+
"ClientId": "MyProject_Web",
82+
"ClientSecret": "your-client-secret",
83+
"Authority": "https://localhost:44322/",
84+
"Scope": "your-internal-api-scope"
85+
}
86+
}
87+
```
88+
89+
See the [Identity module's External User Lookup Service section](../identity.md#external-user-lookup-service) and the [Synchronous Interservice Communication guide](../../guides/synchronous-interservice-communication.md) for the complete setup.
90+
4191
## How to Install
4292

4393
[ABP CLI](../../cli) allows installing a module to a solution using the `add-module` command. You can install the CMS Kit module in a command-line terminal with the following command:

docs/en/modules/identity.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,58 @@ Configure<AbpSecurityLogOptions>(options =>
126126
});
127127
```
128128

129+
### External User Lookup Service
130+
131+
`UserLookupService<TUser, TUserRepository>` first queries the local user store. If an `IExternalUserLookupServiceProvider` implementation is available, it can also query an external source, create the local copy of the user and keep the local data synchronized.
132+
133+
The Identity module provides two common implementations:
134+
135+
* `IdentityUserRepositoryExternalUserLookupServiceProvider`: Uses `IIdentityUserRepository` for in-process lookups.
136+
* `HttpClientExternalUserLookupServiceProvider`: Uses `IIdentityUserIntegrationService` to resolve users from a remote Identity application.
137+
138+
This is especially useful for reusable modules, such as CMS Kit, that keep module-specific user records but still need to resolve users from the Identity module.
139+
140+
If your application is monolithic, this typically works without any extra configuration.
141+
142+
If the Identity module runs in another application or service (for example, in a tiered or distributed solution), then the calling application should:
143+
144+
* Depend on `Volo.Abp.Identity.HttpApi.Client`.
145+
* Add `AbpIdentityHttpApiClientModule` and an IdentityModel module (`AbpHttpClientIdentityModelWebModule` for web applications or `AbpHttpClientIdentityModelModule` for non-web hosts).
146+
* Configure the `RemoteServices:AbpIdentity` endpoint.
147+
* Configure an `IdentityClients` entry for server-to-server authentication.
148+
* Expose integration services on the application that hosts the Identity module.
149+
150+
Example configuration for the application that exposes the Identity integration endpoints:
151+
152+
```csharp
153+
Configure<AbpAspNetCoreMvcOptions>(options =>
154+
{
155+
options.ExposeIntegrationServices = true;
156+
});
157+
```
158+
159+
Example configuration for the calling application:
160+
161+
```json
162+
"RemoteServices": {
163+
"AbpIdentity": {
164+
"BaseUrl": "https://localhost:44388/",
165+
"UseCurrentAccessToken": false
166+
}
167+
},
168+
"IdentityClients": {
169+
"Default": {
170+
"GrantType": "client_credentials",
171+
"ClientId": "MyProject_Web",
172+
"ClientSecret": "your-client-secret",
173+
"Authority": "https://localhost:44322/",
174+
"Scope": "your-internal-api-scope"
175+
}
176+
}
177+
```
178+
179+
The exact `ClientId`, `ClientSecret` and `Scope` values depend on the application that hosts the Identity module. See the [Integration Services](../framework/api-development/integration-services.md) and [Synchronous Interservice Communication](../guides/synchronous-interservice-communication.md) documents for the full setup.
180+
129181
## Options
130182

131183
`IdentityOptions` is the standard [options class](../framework/fundamentals/options.md) provided by the Microsoft [Identity library](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity). So, you can set these options in the `ConfigureServices` method of your [module](../framework/architecture/modularity/basics.md) class.
@@ -274,10 +326,11 @@ Following custom repositories are defined for this module:
274326
#### Application Services
275327

276328
* `IdentityUserAppService` (implements `IIdentityUserAppService`): Implements the use cases of the user management UI.
329+
* `IdentityUserIntegrationService` (implements `IIdentityUserIntegrationService`): Used for module-to-module and service-to-service user and role lookup operations.
277330
* `IdentityRoleAppService` (implement `IIdentityRoleAppService`): Implements the use cases of the role management UI.
278331
* `IdentityClaimTypeAppService` (implements `IIdentityClaimTypeAppService`): Implements the use cases of the claim type management UI.
279332
* `IdentitySettingsAppService` (implements `IIdentitySettingsAppService`): Used to get and update settings for the Identity module.
280-
* `IdentityUserLookupAppService` (implements `IIdentityUserLookupAppService`): Used to get information for a user by `id` or `userName`. It is aimed to be used internally by the ABP.
333+
* `IdentityUserLookupAppService` (implements `IIdentityUserLookupAppService`): Kept for backward compatibility and internally delegates to `IIdentityUserIntegrationService`.
281334
* `ProfileAppService` (implements `IProfileAppService`): Used to change a user's profile and the password.
282335
* ```IdentitySecurityLogAppService``` (implements ```IIdentitySecurityLogAppService```): Implements the use cases of the security logs UI.
283336
* ```OrganizationUnitAppService``` (implements ```OrganizationUnitAppService```): Implements the use cases of the organization unit management UI.

npm/ng-packs/packages/core/src/lib/models/dtos.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class LimitedResultRequestDto {
5353
}
5454
}
5555

56-
export class ExtensibleLimitedResultRequestDto extends ExtensibleEntityDto {
56+
export class ExtensibleLimitedResultRequestDto extends ExtensibleObject {
5757
maxResultCount = 10;
5858

5959
constructor(initialValues: Partial<ExtensibleLimitedResultRequestDto> = {}) {

0 commit comments

Comments
 (0)