You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/modules/cms-kit/index.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,56 @@ All features are individually usable. If you disable a feature, it completely di
38
38
- CMS Kit uses [distributed cache](../../framework/fundamentals/caching.md) for responding faster.
39
39
> Using a distributed cache, such as [Redis](../../framework/fundamentals/redis-cache.md), is highly recommended for data consistency in distributed/clustered deployments.
40
40
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
+
publicclassMyWebModule : 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
+
41
91
## How to Install
42
92
43
93
[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:
`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
+
129
181
## Options
130
182
131
183
`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:
274
326
#### Application Services
275
327
276
328
*`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.
277
330
*`IdentityRoleAppService` (implement `IIdentityRoleAppService`): Implements the use cases of the role management UI.
278
331
*`IdentityClaimTypeAppService` (implements `IIdentityClaimTypeAppService`): Implements the use cases of the claim type management UI.
279
332
*`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`.
281
334
*`ProfileAppService` (implements `IProfileAppService`): Used to change a user's profile and the password.
282
335
*```IdentitySecurityLogAppService``` (implements ```IIdentitySecurityLogAppService```): Implements the use cases of the security logs UI.
283
336
*```OrganizationUnitAppService``` (implements ```OrganizationUnitAppService```): Implements the use cases of the organization unit management UI.
0 commit comments