keycloak-api-manager 6.0.1 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Handlers/attackDetectionHandler.js +12 -8
- package/Handlers/clientPoliciesHandler.js +4 -2
- package/Handlers/clientScopesHandler.js +9 -9
- package/Handlers/clientsHandler.js +1 -13
- package/Handlers/groupsHandler.js +3 -2
- package/Handlers/organizationsHandler.js +2 -1
- package/Handlers/realmsHandler.js +0 -1
- package/Handlers/rolesHandler.js +14 -12
- package/Handlers/userProfileHandler.js +2 -2
- package/OIDC_MIGRATION_PLAN.md +5 -15
- package/README.md +4 -4
- package/docs/api/attack-detection.md +82 -16
- package/docs/api/authentication-management.md +356 -70
- package/docs/api/client-policies.md +103 -16
- package/docs/api/client-scopes.md +52 -4
- package/docs/api/components.md +107 -19
- package/docs/api/configuration.md +39 -386
- package/docs/api/groups.md +46 -5
- package/docs/api/identity-providers.md +50 -5
- package/docs/api/roles.md +37 -7
- package/docs/api/server-info.md +42 -17
- package/docs/api/user-profile.md +55 -10
- package/docs/api-reference.md +7 -7
- package/docs/guides/PKCE-Login-Flow.md +13 -659
- package/docs/test-configuration.md +19 -1
- package/docs/testing.md +86 -0
- package/index.js +131 -0
- package/package.json +1 -1
- package/test/config/secrets.json.example +1 -1
- package/test/helpers/config.js +15 -9
package/docs/api/groups.md
CHANGED
|
@@ -2,38 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
Group CRUD, subgroup tree navigation, role mappings, and fine-grained group permissions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Namespace: KeycloakManager.groups
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This handler supports:
|
|
10
|
+
|
|
11
|
+
- Group CRUD and hierarchy.
|
|
12
|
+
- Realm/client role mappings on groups.
|
|
13
|
+
- Fine-grained group permissions APIs.
|
|
14
|
+
|
|
15
|
+
The wrapper supports creating child groups in a single call by passing parentId to create().
|
|
6
16
|
|
|
7
17
|
## CRUD and Structure
|
|
8
18
|
|
|
9
19
|
### create(groupRepresentation)
|
|
10
20
|
- **Required**: `groupRepresentation.name` (string)
|
|
11
|
-
- **Optional**: `path`, `attributes`, `subGroups`, `realmRoles`, `clientRoles`
|
|
21
|
+
- **Optional**: `parentId`, `path`, `attributes`, `subGroups`, `realmRoles`, `clientRoles`
|
|
12
22
|
- **Returns**: Promise<object>
|
|
13
23
|
|
|
24
|
+
Notes:
|
|
25
|
+
|
|
26
|
+
- If parentId is provided, the wrapper calls child-group creation endpoint.
|
|
27
|
+
|
|
14
28
|
### find(filter)
|
|
15
|
-
- **Optional**: `search`, `first`, `max`, `briefRepresentation`, `exact`, `populateHierarchy`
|
|
29
|
+
- **Optional**: `search`, `first`, `max`, `briefRepresentation`, `exact`, `populateHierarchy`, `realm`
|
|
16
30
|
- **Returns**: Promise<Array<GroupRepresentation>>
|
|
17
31
|
|
|
18
32
|
### findOne(filter)
|
|
19
33
|
- **Required**: `filter.id` (string, group id)
|
|
34
|
+
- **Optional**: `filter.realm`
|
|
20
35
|
- **Returns**: Promise<GroupRepresentation>
|
|
21
36
|
|
|
22
37
|
### update(filter, groupRepresentation)
|
|
23
38
|
- **Required**: `filter.id` (string)
|
|
39
|
+
- **Optional**: `filter.realm`
|
|
24
40
|
- **Required**: `groupRepresentation` (partial)
|
|
25
41
|
- **Returns**: Promise<void>
|
|
26
42
|
|
|
27
43
|
### del(filter)
|
|
28
44
|
- **Required**: `filter.id` (string)
|
|
45
|
+
- **Optional**: `filter.realm`
|
|
29
46
|
- **Returns**: Promise<void>
|
|
30
47
|
|
|
31
48
|
### count(filter)
|
|
32
|
-
- **Optional**: `search`, `top`
|
|
49
|
+
- **Optional**: `search`, `top`, `realm`
|
|
33
50
|
- **Returns**: Promise<number>
|
|
34
51
|
|
|
35
52
|
### listSubGroups(filter)
|
|
36
|
-
- **Required**: `filter.id` (
|
|
53
|
+
- **Required**: one of `filter.parentId` or `filter.id` (parent group id)
|
|
37
54
|
- **Optional**: `search`, `first`, `max`, `briefRepresentation`
|
|
38
55
|
- **Returns**: Promise<Array<GroupRepresentation>>
|
|
39
56
|
|
|
@@ -42,27 +59,33 @@ Group CRUD, subgroup tree navigation, role mappings, and fine-grained group perm
|
|
|
42
59
|
### addRealmRoleMappings(role_mapping)
|
|
43
60
|
- **Required**: `role_mapping.id` (group id)
|
|
44
61
|
- **Required**: `role_mapping.roles` (Array<{id,name}>)
|
|
62
|
+
- **Optional**: `role_mapping.realm`
|
|
45
63
|
- **Returns**: Promise<void>
|
|
46
64
|
|
|
47
65
|
### delRealmRoleMappings(filters)
|
|
48
66
|
- **Required**: `filters.id` (group id)
|
|
49
67
|
- **Required**: `filters.roles` (Array<{id,name}>)
|
|
68
|
+
- **Optional**: `filters.realm`
|
|
50
69
|
- **Returns**: Promise<void>
|
|
51
70
|
|
|
52
71
|
### listRoleMappings(filters)
|
|
53
72
|
- **Required**: `filters.id` (group id)
|
|
73
|
+
- **Optional**: `filters.realm`
|
|
54
74
|
- **Returns**: Promise<object>
|
|
55
75
|
|
|
56
76
|
### listRealmRoleMappings(filters)
|
|
57
77
|
- **Required**: `filters.id` (group id)
|
|
78
|
+
- **Optional**: `filters.realm`
|
|
58
79
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
59
80
|
|
|
60
81
|
### listAvailableRealmRoleMappings(filters)
|
|
61
82
|
- **Required**: `filters.id` (group id)
|
|
83
|
+
- **Optional**: `filters.realm`
|
|
62
84
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
63
85
|
|
|
64
86
|
### listCompositeRealmRoleMappings(filters)
|
|
65
87
|
- **Required**: `filters.id` (group id)
|
|
88
|
+
- **Optional**: `filters.realm`
|
|
66
89
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
67
90
|
|
|
68
91
|
## Client Role Mappings
|
|
@@ -71,27 +94,32 @@ Group CRUD, subgroup tree navigation, role mappings, and fine-grained group perm
|
|
|
71
94
|
- **Required**: `filters.id` (group id)
|
|
72
95
|
- **Required**: `filters.clientUniqueId` (client UUID)
|
|
73
96
|
- **Required**: `filters.roles` (Array<{id,name}>)
|
|
97
|
+
- **Optional**: `filters.realm`
|
|
74
98
|
- **Returns**: Promise<void>
|
|
75
99
|
|
|
76
100
|
### delClientRoleMappings(filters)
|
|
77
101
|
- **Required**: `filters.id` (group id)
|
|
78
102
|
- **Required**: `filters.clientUniqueId` (client UUID)
|
|
79
103
|
- **Required**: `filters.roles` (Array<{id,name}>)
|
|
104
|
+
- **Optional**: `filters.realm`
|
|
80
105
|
- **Returns**: Promise<void>
|
|
81
106
|
|
|
82
107
|
### listClientRoleMappings(filters)
|
|
83
108
|
- **Required**: `filters.id` (group id)
|
|
84
109
|
- **Required**: `filters.clientUniqueId` (client UUID)
|
|
110
|
+
- **Optional**: `filters.realm`
|
|
85
111
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
86
112
|
|
|
87
113
|
### listAvailableClientRoleMappings(filters)
|
|
88
114
|
- **Required**: `filters.id` (group id)
|
|
89
115
|
- **Required**: `filters.clientUniqueId` (client UUID)
|
|
116
|
+
- **Optional**: `filters.realm`
|
|
90
117
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
91
118
|
|
|
92
119
|
### listCompositeClientRoleMappings(filters)
|
|
93
120
|
- **Required**: `filters.id` (group id)
|
|
94
121
|
- **Required**: `filters.clientUniqueId` (client UUID)
|
|
122
|
+
- **Optional**: `filters.realm`
|
|
95
123
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
96
124
|
|
|
97
125
|
## Fine-Grained Group Permissions (Wrapper Enhancement)
|
|
@@ -101,11 +129,13 @@ These methods wrap Keycloak management-permission endpoints used for group admin
|
|
|
101
129
|
### setPermissions(filters, permissionRepresentation)
|
|
102
130
|
- **Required**: `filters.id` (group id)
|
|
103
131
|
- **Required**: `permissionRepresentation.enabled` (boolean)
|
|
132
|
+
- **Optional**: `filters.realm`
|
|
104
133
|
- **Optional**: additional permission fields returned by Keycloak
|
|
105
134
|
- **Returns**: Promise<object>
|
|
106
135
|
|
|
107
136
|
### listPermissions(filters)
|
|
108
137
|
- **Required**: `filters.id` (group id)
|
|
138
|
+
- **Optional**: `filters.realm`
|
|
109
139
|
- **Returns**: Promise<object>
|
|
110
140
|
|
|
111
141
|
### Feature Requirement
|
|
@@ -119,6 +149,17 @@ Use Keycloak with:
|
|
|
119
149
|
|
|
120
150
|
```js
|
|
121
151
|
const group = await KeycloakManager.groups.create({ name: 'engineering' });
|
|
152
|
+
|
|
153
|
+
const child = await KeycloakManager.groups.create({
|
|
154
|
+
name: 'engineering-platform',
|
|
155
|
+
parentId: group.id,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
await KeycloakManager.groups.addRealmRoleMappings({
|
|
159
|
+
id: group.id,
|
|
160
|
+
roles: [{ id: realmRole.id, name: realmRole.name }],
|
|
161
|
+
});
|
|
162
|
+
|
|
122
163
|
await KeycloakManager.groups.setPermissions({ id: group.id }, { enabled: true });
|
|
123
164
|
const permissions = await KeycloakManager.groups.listPermissions({ id: group.id });
|
|
124
165
|
```
|
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Manage identity providers (OIDC/SAML/social), mappers, import, and permissions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Namespace: KeycloakManager.identityProviders
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This handler covers:
|
|
10
|
+
|
|
11
|
+
- Provider CRUD.
|
|
12
|
+
- Provider factory discovery and metadata import.
|
|
13
|
+
- Mapper CRUD.
|
|
14
|
+
- Fine-grained permissions on provider resources.
|
|
6
15
|
|
|
7
16
|
## Provider CRUD
|
|
8
17
|
|
|
@@ -17,15 +26,18 @@ Manage identity providers (OIDC/SAML/social), mappers, import, and permissions.
|
|
|
17
26
|
|
|
18
27
|
### findOne(filter)
|
|
19
28
|
- **Required**: `filter.alias`
|
|
29
|
+
- **Optional**: `filter.realm`
|
|
20
30
|
- **Returns**: Promise<IdentityProviderRepresentation>
|
|
21
31
|
|
|
22
32
|
### update(filter, identityProviderRepresentation)
|
|
23
33
|
- **Required**: `filter.alias`
|
|
34
|
+
- **Optional**: `filter.realm`
|
|
24
35
|
- **Required**: updated representation
|
|
25
36
|
- **Returns**: Promise<void>
|
|
26
37
|
|
|
27
38
|
### del(filter)
|
|
28
39
|
- **Required**: `filter.alias`
|
|
40
|
+
- **Optional**: `filter.realm`
|
|
29
41
|
- **Returns**: Promise<void>
|
|
30
42
|
|
|
31
43
|
## Factory and Discovery
|
|
@@ -35,35 +47,47 @@ Manage identity providers (OIDC/SAML/social), mappers, import, and permissions.
|
|
|
35
47
|
- **Returns**: Promise<object>
|
|
36
48
|
|
|
37
49
|
### importFromUrl(filter)
|
|
38
|
-
- **Required**:
|
|
50
|
+
- **Required**: `filter.fromUrl`
|
|
51
|
+
- **Required**: `filter.providerId`
|
|
52
|
+
- **Optional**: `filter.alias`, `filter.trustEmail`, other provider-specific fields
|
|
39
53
|
- **Returns**: Promise<object>
|
|
40
54
|
|
|
41
55
|
## Mappers
|
|
42
56
|
|
|
43
57
|
### createMapper(mapperParams)
|
|
44
|
-
- **Required**: `mapperParams.
|
|
45
|
-
- **Required**: `mapperParams.
|
|
46
|
-
- **Optional**: `mapperParams.config`
|
|
58
|
+
- **Required**: `mapperParams.alias` (identity provider alias)
|
|
59
|
+
- **Required**: `mapperParams.identityProviderMapper` (mapper representation object)
|
|
47
60
|
- **Returns**: Promise<object>
|
|
48
61
|
|
|
62
|
+
Typical mapper representation fields:
|
|
63
|
+
|
|
64
|
+
- name (string, required)
|
|
65
|
+
- identityProviderAlias (string, required)
|
|
66
|
+
- identityProviderMapper (string, required)
|
|
67
|
+
- config (object, optional)
|
|
68
|
+
|
|
49
69
|
### findMappers(filter)
|
|
50
70
|
- **Required**: `filter.alias` (identity provider alias)
|
|
71
|
+
- **Optional**: `filter.realm`
|
|
51
72
|
- **Returns**: Promise<Array<object>>
|
|
52
73
|
|
|
53
74
|
### findOneMapper(filter)
|
|
54
75
|
- **Required**: `filter.alias`
|
|
55
76
|
- **Required**: `filter.id` (mapper id)
|
|
77
|
+
- **Optional**: `filter.realm`
|
|
56
78
|
- **Returns**: Promise<object>
|
|
57
79
|
|
|
58
80
|
### updateMapper(filter, mapperRepresentation)
|
|
59
81
|
- **Required**: `filter.alias`
|
|
60
82
|
- **Required**: `filter.id`
|
|
83
|
+
- **Optional**: `filter.realm`
|
|
61
84
|
- **Required**: mapper representation
|
|
62
85
|
- **Returns**: Promise<void>
|
|
63
86
|
|
|
64
87
|
### delMapper(filter)
|
|
65
88
|
- **Required**: `filter.alias`
|
|
66
89
|
- **Required**: `filter.id`
|
|
90
|
+
- **Optional**: `filter.realm`
|
|
67
91
|
- **Returns**: Promise<void>
|
|
68
92
|
|
|
69
93
|
## Permissions
|
|
@@ -71,10 +95,12 @@ Manage identity providers (OIDC/SAML/social), mappers, import, and permissions.
|
|
|
71
95
|
### updatePermission(filter, permissionRepresentation)
|
|
72
96
|
- **Required**: `filter.alias`
|
|
73
97
|
- **Required**: `permissionRepresentation.enabled` (boolean)
|
|
98
|
+
- **Optional**: `filter.realm`
|
|
74
99
|
- **Returns**: Promise<object>
|
|
75
100
|
|
|
76
101
|
### listPermissions(filter)
|
|
77
102
|
- **Required**: `filter.alias`
|
|
103
|
+
- **Optional**: `filter.realm`
|
|
78
104
|
- **Returns**: Promise<object>
|
|
79
105
|
|
|
80
106
|
## Example
|
|
@@ -91,6 +117,25 @@ await KeycloakManager.identityProviders.create({
|
|
|
91
117
|
});
|
|
92
118
|
|
|
93
119
|
const mappers = await KeycloakManager.identityProviders.findMappers({ alias: 'google' });
|
|
120
|
+
|
|
121
|
+
const createdMapper = await KeycloakManager.identityProviders.createMapper({
|
|
122
|
+
alias: 'google',
|
|
123
|
+
identityProviderMapper: {
|
|
124
|
+
name: 'email-claim-mapper',
|
|
125
|
+
identityProviderAlias: 'google',
|
|
126
|
+
identityProviderMapper: 'oidc-user-attribute-idp-mapper',
|
|
127
|
+
config: {
|
|
128
|
+
claim: 'email',
|
|
129
|
+
'user.attribute': 'email',
|
|
130
|
+
syncMode: 'INHERIT',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
await KeycloakManager.identityProviders.updatePermission(
|
|
136
|
+
{ alias: 'google' },
|
|
137
|
+
{ enabled: true }
|
|
138
|
+
);
|
|
94
139
|
```
|
|
95
140
|
|
|
96
141
|
## See Also
|
package/docs/api/roles.md
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Realm and client role management, including composite roles.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Namespace: KeycloakManager.roles
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This handler manages realm roles and composite relationships.
|
|
10
|
+
It covers CRUD, user-role lookup, and composite role operations for realm and client roles.
|
|
6
11
|
|
|
7
12
|
## Role CRUD
|
|
8
13
|
|
|
@@ -16,25 +21,28 @@ Create a realm role.
|
|
|
16
21
|
### find(filters)
|
|
17
22
|
List realm roles.
|
|
18
23
|
|
|
19
|
-
- **Optional**: `first`, `max`, `search`, `briefRepresentation`
|
|
24
|
+
- **Optional**: `first`, `max`, `search`, `briefRepresentation`, `realm`
|
|
20
25
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
21
26
|
|
|
22
27
|
### findOneByName(filters)
|
|
23
28
|
Get role by name.
|
|
24
29
|
|
|
25
30
|
- **Required**: `filters.name` (string)
|
|
31
|
+
- **Optional**: `filters.realm` (string)
|
|
26
32
|
- **Returns**: Promise<RoleRepresentation>
|
|
27
33
|
|
|
28
34
|
### findOneById(filters)
|
|
29
35
|
Get role by id.
|
|
30
36
|
|
|
31
37
|
- **Required**: `filters.id` (string)
|
|
38
|
+
- **Optional**: `filters.realm` (string)
|
|
32
39
|
- **Returns**: Promise<RoleRepresentation>
|
|
33
40
|
|
|
34
41
|
### updateByName(filters, role_dictionary)
|
|
35
42
|
Update role by name.
|
|
36
43
|
|
|
37
44
|
- **Required**: `filters.name` (string)
|
|
45
|
+
- **Optional**: `filters.realm` (string)
|
|
38
46
|
- **Required**: `role_dictionary` (partial role)
|
|
39
47
|
- **Returns**: Promise<void>
|
|
40
48
|
|
|
@@ -42,6 +50,7 @@ Update role by name.
|
|
|
42
50
|
Update role by id.
|
|
43
51
|
|
|
44
52
|
- **Required**: `filters.id` (string)
|
|
53
|
+
- **Optional**: `filters.realm` (string)
|
|
45
54
|
- **Required**: `role_dictionary` (partial role)
|
|
46
55
|
- **Returns**: Promise<void>
|
|
47
56
|
|
|
@@ -49,6 +58,7 @@ Update role by id.
|
|
|
49
58
|
Delete role by name.
|
|
50
59
|
|
|
51
60
|
- **Required**: `filters.name` (string)
|
|
61
|
+
- **Optional**: `filters.realm` (string)
|
|
52
62
|
- **Returns**: Promise<void>
|
|
53
63
|
|
|
54
64
|
## Composite Roles
|
|
@@ -56,27 +66,31 @@ Delete role by name.
|
|
|
56
66
|
### createComposite(filters, roles)
|
|
57
67
|
Add composites to a realm role.
|
|
58
68
|
|
|
59
|
-
- **Required**: `filters.
|
|
69
|
+
- **Required**: `filters.roleId` (string)
|
|
70
|
+
- **Optional**: `filters.realm` (string)
|
|
60
71
|
- **Required**: `roles` (Array<{id,name}>), realm or client roles
|
|
61
72
|
- **Returns**: Promise<void>
|
|
62
73
|
|
|
63
74
|
### getCompositeRoles(filters)
|
|
64
75
|
Get all composites for a role.
|
|
65
76
|
|
|
66
|
-
- **Required**: `filters.
|
|
77
|
+
- **Required**: `filters.id` (string)
|
|
78
|
+
- **Optional**: `filters.realm` (string)
|
|
67
79
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
68
80
|
|
|
69
81
|
### getCompositeRolesForRealm(filters)
|
|
70
82
|
Get realm-level composites.
|
|
71
83
|
|
|
72
|
-
- **Required**: `filters.
|
|
84
|
+
- **Required**: `filters.id` (string)
|
|
85
|
+
- **Optional**: `filters.realm` (string)
|
|
73
86
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
74
87
|
|
|
75
88
|
### getCompositeRolesForClient(filters)
|
|
76
89
|
Get client-level composites.
|
|
77
90
|
|
|
78
|
-
- **Required**: `filters.
|
|
79
|
-
- **Required**: `filters.
|
|
91
|
+
- **Required**: `filters.id` (string)
|
|
92
|
+
- **Required**: `filters.clientId` (string, client UUID)
|
|
93
|
+
- **Optional**: `filters.realm` (string)
|
|
80
94
|
- **Returns**: Promise<Array<RoleRepresentation>>
|
|
81
95
|
|
|
82
96
|
## Users with Role
|
|
@@ -85,6 +99,7 @@ Get client-level composites.
|
|
|
85
99
|
List users that have a specific realm role.
|
|
86
100
|
|
|
87
101
|
- **Required**: `filters.name` (role name)
|
|
102
|
+
- **Optional**: `filters.realm` (string)
|
|
88
103
|
- **Optional**: `first`, `max`
|
|
89
104
|
- **Returns**: Promise<Array<UserRepresentation>>
|
|
90
105
|
|
|
@@ -94,6 +109,21 @@ List users that have a specific realm role.
|
|
|
94
109
|
await KeycloakManager.roles.create({ name: 'realm-admin' });
|
|
95
110
|
const role = await KeycloakManager.roles.findOneByName({ name: 'realm-admin' });
|
|
96
111
|
const users = await KeycloakManager.roles.findUsersWithRole({ name: 'realm-admin' });
|
|
112
|
+
|
|
113
|
+
// Composite role with one realm role and one client role
|
|
114
|
+
await KeycloakManager.roles.createComposite(
|
|
115
|
+
{ roleId: compositeRoleId },
|
|
116
|
+
[
|
|
117
|
+
{ id: realmRoleId, name: 'test-role-1' },
|
|
118
|
+
{ id: clientRoleId, name: 'client-role-a', clientRole: true, containerId: clientUuid }
|
|
119
|
+
]
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const realmComposites = await KeycloakManager.roles.getCompositeRolesForRealm({ id: compositeRoleId });
|
|
123
|
+
const clientComposites = await KeycloakManager.roles.getCompositeRolesForClient({
|
|
124
|
+
id: compositeRoleId,
|
|
125
|
+
clientId: clientUuid,
|
|
126
|
+
});
|
|
97
127
|
```
|
|
98
128
|
|
|
99
129
|
## See Also
|
package/docs/api/server-info.md
CHANGED
|
@@ -2,37 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
Read Keycloak server capabilities and runtime metadata.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Namespace: KeycloakManager.serverInfo
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Use this handler to inspect server capabilities before enabling advanced features in automation.
|
|
10
|
+
It is useful for diagnostics and compatibility checks in CI pipelines.
|
|
6
11
|
|
|
7
12
|
## Methods
|
|
8
13
|
|
|
9
14
|
### getInfo()
|
|
10
|
-
Get full server-info payload.
|
|
11
15
|
|
|
12
|
-
-
|
|
13
|
-
|
|
16
|
+
Fetch the full server-info payload from the configured realm context.
|
|
17
|
+
|
|
18
|
+
Parameters:
|
|
19
|
+
|
|
20
|
+
- none
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
|
|
24
|
+
- Promise<object>: full server info payload.
|
|
25
|
+
|
|
26
|
+
Common top-level sections returned by Keycloak include:
|
|
14
27
|
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- `enums`
|
|
28
|
+
- systemInfo
|
|
29
|
+
- memoryInfo
|
|
30
|
+
- profileInfo
|
|
31
|
+
- themes
|
|
32
|
+
- providers
|
|
33
|
+
- componentTypes
|
|
34
|
+
- passwordPolicies
|
|
35
|
+
- protocolMapperTypes
|
|
36
|
+
- clientInstallations
|
|
37
|
+
- enums
|
|
26
38
|
|
|
27
|
-
|
|
39
|
+
Example: basic inspection
|
|
28
40
|
|
|
29
41
|
```js
|
|
30
42
|
const info = await KeycloakManager.serverInfo.getInfo();
|
|
31
43
|
|
|
32
44
|
console.log('Keycloak version:', info.systemInfo?.version);
|
|
33
45
|
console.log('Available themes:', Object.keys(info.themes || {}));
|
|
34
|
-
console.log('
|
|
46
|
+
console.log('Provider categories:', Object.keys(info.providers || {}));
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Example: feature guard before workflow
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
const info = await KeycloakManager.serverInfo.getInfo();
|
|
53
|
+
const hasOrganizationFeature = Boolean(info.profileInfo?.features?.organization);
|
|
54
|
+
|
|
55
|
+
if (!hasOrganizationFeature) {
|
|
56
|
+
throw new Error('Organization feature is not enabled on this Keycloak server.');
|
|
57
|
+
}
|
|
35
58
|
```
|
|
36
59
|
|
|
37
60
|
## See Also
|
|
61
|
+
|
|
38
62
|
- [API Reference](../api-reference.md)
|
|
63
|
+
- [Keycloak Setup and Feature Flags](../keycloak-setup.md)
|
package/docs/api/user-profile.md
CHANGED
|
@@ -2,28 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
Manage realm user-profile configuration and metadata.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Namespace: KeycloakManager.userProfile
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This handler manages declarative user-profile schema in a realm.
|
|
10
|
+
It allows you to inspect current schema, update it, and read resolved metadata (validators, capabilities, attribute model).
|
|
11
|
+
|
|
12
|
+
Note: endpoints are accessed through direct REST calls in the handler for compatibility across admin-client versions.
|
|
6
13
|
|
|
7
14
|
## Methods
|
|
8
15
|
|
|
9
16
|
### getConfiguration(filter)
|
|
10
|
-
Get user-profile configuration for realm.
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
Get the current declarative user-profile configuration.
|
|
19
|
+
|
|
20
|
+
Parameters:
|
|
21
|
+
|
|
22
|
+
- filter (object, optional):
|
|
23
|
+
- realm (string, optional): override target realm.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
|
|
27
|
+
- Promise<object>: current profile configuration.
|
|
14
28
|
|
|
15
29
|
### updateConfiguration(filter, userProfileConfig)
|
|
30
|
+
|
|
16
31
|
Update user-profile configuration.
|
|
17
32
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
33
|
+
Parameters:
|
|
34
|
+
|
|
35
|
+
- filter (object, optional):
|
|
36
|
+
- realm (string, optional): override target realm.
|
|
37
|
+
- userProfileConfig (object, required): full or partial schema payload.
|
|
38
|
+
|
|
39
|
+
Common top-level fields:
|
|
40
|
+
|
|
41
|
+
- attributes (array): attribute definitions.
|
|
42
|
+
- groups (array, optional): grouped attributes.
|
|
43
|
+
- unmanagedAttributePolicy (string, optional)
|
|
44
|
+
|
|
45
|
+
Common attribute fields:
|
|
46
|
+
|
|
47
|
+
- name (string, required): attribute key.
|
|
48
|
+
- displayName (string, optional)
|
|
49
|
+
- required (object, optional): required rules.
|
|
50
|
+
- permissions (object, optional): view/edit permissions.
|
|
51
|
+
- validations (object, optional): validation rules.
|
|
52
|
+
- annotations (object, optional): UI/metadata annotations.
|
|
53
|
+
- multivalued (boolean, optional): enable list values.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
|
|
57
|
+
- Promise<void|object>: usually no content (204), or response payload if provided by server.
|
|
21
58
|
|
|
22
59
|
### getMetadata(filter)
|
|
23
|
-
Get resolved user-profile metadata.
|
|
24
60
|
|
|
25
|
-
-
|
|
26
|
-
|
|
61
|
+
Get user-profile metadata resolved by the server.
|
|
62
|
+
|
|
63
|
+
Parameters:
|
|
64
|
+
|
|
65
|
+
- filter (object, optional):
|
|
66
|
+
- realm (string, optional): override target realm.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
|
|
70
|
+
- Promise<object>: metadata payload (validators, resolved attributes, capabilities).
|
|
27
71
|
|
|
28
72
|
## Common User Profile Structure
|
|
29
73
|
|
|
@@ -56,6 +100,7 @@ await KeycloakManager.userProfile.updateConfiguration({}, {
|
|
|
56
100
|
});
|
|
57
101
|
|
|
58
102
|
const metadata = await KeycloakManager.userProfile.getMetadata();
|
|
103
|
+
console.log('Available validators:', Object.keys(metadata.validators || {}));
|
|
59
104
|
```
|
|
60
105
|
|
|
61
106
|
## See Also
|
package/docs/api-reference.md
CHANGED
|
@@ -4,8 +4,8 @@ Complete API documentation for keycloak-api-manager.
|
|
|
4
4
|
|
|
5
5
|
## Table of Contents
|
|
6
6
|
|
|
7
|
-
### Guides
|
|
8
|
-
- [
|
|
7
|
+
### Guides
|
|
8
|
+
- [OIDC Migration Plan](../OIDC_MIGRATION_PLAN.md) - Deprecation status and migration notes to keycloak-express-middleware
|
|
9
9
|
|
|
10
10
|
### Core API
|
|
11
11
|
- [Configuration & Authentication](api/configuration.md) - Setup, authentication, and lifecycle management
|
|
@@ -78,11 +78,11 @@ KeycloakManager.stop();
|
|
|
78
78
|
|-----------|-------------|--------|
|
|
79
79
|
| `configure()` | Authentication and setup | Core |
|
|
80
80
|
| `setConfig()` | Runtime configuration | Core |
|
|
81
|
-
| `getToken()` | Get current access token | Core |
|
|
82
|
-
| `login()` |
|
|
83
|
-
| `generateAuthorizationUrl()` |
|
|
84
|
-
| `loginPKCE()` |
|
|
85
|
-
| `auth()` |
|
|
81
|
+
| `getToken()` | Get current access/refresh token pair | Core |
|
|
82
|
+
| `login()` | Deprecated OIDC token endpoint wrapper (moved to keycloak-express-middleware) | Core |
|
|
83
|
+
| `generateAuthorizationUrl()` | Deprecated PKCE helper (moved to keycloak-express-middleware) | Core |
|
|
84
|
+
| `loginPKCE()` | Deprecated PKCE token exchange helper (moved to keycloak-express-middleware) | Core |
|
|
85
|
+
| `auth()` | Deprecated backward-compatible alias of `login()` | Core |
|
|
86
86
|
| `stop()` | Stop token refresh timer | Core |
|
|
87
87
|
| `realms` | Realm management | realmsHandler |
|
|
88
88
|
| `users` | User management | usersHandler |
|