keycloak-api-manager 6.0.1 → 6.0.2
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/clientPoliciesHandler.js +4 -2
- package/Handlers/clientsHandler.js +1 -13
- package/Handlers/organizationsHandler.js +2 -1
- package/Handlers/realmsHandler.js +0 -1
- package/Handlers/userProfileHandler.js +2 -2
- package/OIDC_MIGRATION_PLAN.md +5 -15
- package/README.md +4 -4
- package/docs/api/configuration.md +39 -386
- package/docs/api-reference.md +7 -7
- package/docs/guides/PKCE-Login-Flow.md +13 -659
- package/index.js +131 -0
- package/package.json +1 -1
- package/test/helpers/config.js +15 -9
|
@@ -42,7 +42,8 @@ exports.getPolicies = function(filter) {
|
|
|
42
42
|
* - profiles: (array) - Profiles to apply when policy matches
|
|
43
43
|
*/
|
|
44
44
|
exports.updatePolicies = async function(filter, policiesRepresentation) {
|
|
45
|
-
// Direct API call
|
|
45
|
+
// Direct API call: admin-client support for client-policies update endpoints
|
|
46
|
+
// is incomplete/inconsistent across versions.
|
|
46
47
|
const realm = filter?.realm || kcAdminClientHandler.realmName;
|
|
47
48
|
const baseUrl = kcAdminClientHandler.baseUrl;
|
|
48
49
|
const token = kcAdminClientHandler.accessToken;
|
|
@@ -95,7 +96,8 @@ exports.getProfiles = function(filter) {
|
|
|
95
96
|
* - configuration: (object) - Executor-specific configuration
|
|
96
97
|
*/
|
|
97
98
|
exports.updateProfiles = async function(filter, profilesRepresentation) {
|
|
98
|
-
// Direct API call
|
|
99
|
+
// Direct API call: admin-client support for client-policies update endpoints
|
|
100
|
+
// is incomplete/inconsistent across versions.
|
|
99
101
|
const realm = filter?.realm || kcAdminClientHandler.realmName;
|
|
100
102
|
const baseUrl = kcAdminClientHandler.baseUrl;
|
|
101
103
|
const token = kcAdminClientHandler.accessToken;
|
|
@@ -14,6 +14,7 @@ exports.setKcAdminClient=function(kcAdminClient){
|
|
|
14
14
|
/**
|
|
15
15
|
* Helper function to make direct HTTP calls to Keycloak Admin API.
|
|
16
16
|
* Used when @keycloak/keycloak-admin-client has bugs or inconsistencies.
|
|
17
|
+
* This keeps behavior aligned with server endpoints even when upstream wrappers lag behind.
|
|
17
18
|
*
|
|
18
19
|
* @param {string} path - API path relative to baseUrl (e.g., '/admin/realms/...')
|
|
19
20
|
* @param {string} method - HTTP method (GET, POST, PUT, DELETE)
|
|
@@ -551,19 +552,6 @@ exports.listAvailableRealmScopeMappings=function(filter){
|
|
|
551
552
|
}
|
|
552
553
|
|
|
553
554
|
|
|
554
|
-
/**
|
|
555
|
-
* ***************************** - listAvailableRealmScopeMappings - *******************************
|
|
556
|
-
* The method is used to retrieve all realm-level roles that are available to be assigned to a specific client.
|
|
557
|
-
* These are roles defined at the realm level that the client does not yet have mapped, allowing you to see what can be added.
|
|
558
|
-
* @parameters:
|
|
559
|
-
* - filter: JSON structure that defines the filter parameters:
|
|
560
|
-
* - id: [required] The ID of the client for which you want to list available realm-level role mappings.
|
|
561
|
-
*/
|
|
562
|
-
exports.listAvailableRealmScopeMappings=function(filter){
|
|
563
|
-
return (kcAdminClientHandler.clients.listAvailableRealmScopeMappings(filter));
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
567
555
|
/**
|
|
568
556
|
* ***************************** - listRealmScopeMappings - *******************************
|
|
569
557
|
* The method retrieves the realm-level roles currently assigned to a client as part of its scope mappings.
|
|
@@ -17,7 +17,8 @@ exports.setKcAdminClient = function(kcAdminClient) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Helper
|
|
20
|
+
* Helper to perform direct Admin REST calls for Organizations endpoints.
|
|
21
|
+
* This bypasses admin-client gaps for some Keycloak versions/features.
|
|
21
22
|
*/
|
|
22
23
|
async function makeDirectApiCall(method, endpoint, body = null) {
|
|
23
24
|
const baseUrl = kcAdminClientHandler.baseUrl;
|
|
@@ -23,7 +23,7 @@ exports.setKcAdminClient = function(kcAdminClient) {
|
|
|
23
23
|
* @returns: User profile configuration object with attributes, groups, etc.
|
|
24
24
|
*/
|
|
25
25
|
exports.getConfiguration = async function(filter) {
|
|
26
|
-
// Direct API call
|
|
26
|
+
// Direct API call: this endpoint is not consistently exposed across admin-client versions.
|
|
27
27
|
const realm = filter?.realm || kcAdminClientHandler.realmName;
|
|
28
28
|
const baseUrl = kcAdminClientHandler.baseUrl;
|
|
29
29
|
const token = kcAdminClientHandler.accessToken;
|
|
@@ -63,7 +63,7 @@ exports.getConfiguration = async function(filter) {
|
|
|
63
63
|
* - unmanagedAttributePolicy: (string) - Policy for unmanaged attributes
|
|
64
64
|
*/
|
|
65
65
|
exports.updateConfiguration = async function(filter, userProfileConfig) {
|
|
66
|
-
// Direct API call
|
|
66
|
+
// Direct API call: this endpoint is not consistently exposed across admin-client versions.
|
|
67
67
|
const realm = filter?.realm || kcAdminClientHandler.realmName;
|
|
68
68
|
const baseUrl = kcAdminClientHandler.baseUrl;
|
|
69
69
|
const token = kcAdminClientHandler.accessToken;
|
package/OIDC_MIGRATION_PLAN.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# OIDC Methods Migration Plan - keycloak-api-manager
|
|
2
2
|
|
|
3
|
-
## 🚀 Current Status: v6.0.
|
|
3
|
+
## 🚀 Current Status: v6.0.1 - Migration Released
|
|
4
4
|
|
|
5
|
-
✅ **OIDC Methods Deprecated:** All OIDC authentication methods are
|
|
5
|
+
✅ **OIDC Methods Deprecated:** All OIDC authentication methods are marked `@deprecated` since v6.0.0.
|
|
6
6
|
|
|
7
7
|
✅ **keycloak-express-middleware v6.1.0 Released:** OIDC methods now available in middleware package with full test coverage.
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
## Overview
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
This architecture follows a **planned migration** of OIDC methods (`auth()`, `login()`, `loginPKCE()`) from `keycloak-api-manager` to `keycloak-express-middleware`.
|
|
18
18
|
|
|
19
19
|
## Current State (v5.0.8)
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ L'architettura prevede una **migrazione pianificata** dei metodi OIDC (`auth()`,
|
|
|
24
24
|
- ✅ `generateAuthorizationUrl(options)` - PKCE URL generator
|
|
25
25
|
- ✅ `loginPKCE(credentials)` - PKCE token exchange
|
|
26
26
|
|
|
27
|
-
## Current State (v6.0.
|
|
27
|
+
## Current State (v6.0.1) - NOW
|
|
28
28
|
|
|
29
29
|
**Status Changes in keycloak-api-manager:**
|
|
30
30
|
- ⚠️ `auth(credentials)` - Marked @deprecated
|
|
@@ -125,7 +125,7 @@ keycloak-express-middleware (User Authentication)
|
|
|
125
125
|
| Version | OIDC Methods | Status |
|
|
126
126
|
|---------|------------|--------|
|
|
127
127
|
| v5.0.8 | Supported | Legacy (should migrate) |
|
|
128
|
-
| v6.0.
|
|
128
|
+
| v6.0.1 | Deprecated | Current (shows warnings) |
|
|
129
129
|
| v7.0.0 | Removed | Future (no OIDC methods) |
|
|
130
130
|
|
|
131
131
|
**NPM:** https://www.npmjs.com/package/keycloak-api-manager
|
|
@@ -225,16 +225,6 @@ const token = await keycloakMiddleware.loginPKCE({
|
|
|
225
225
|
});
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
-
**Migration Path:**
|
|
229
|
-
```javascript
|
|
230
|
-
// Move to middleware
|
|
231
|
-
const token = await keycloakMiddleware.loginPKCE({
|
|
232
|
-
code: req.query.code,
|
|
233
|
-
redirect_uri: 'https://app/callback',
|
|
234
|
-
code_verifier: req.session.verifier
|
|
235
|
-
});
|
|
236
|
-
```
|
|
237
|
-
|
|
238
228
|
---
|
|
239
229
|
|
|
240
230
|
## What Stays in keycloak-api-manager
|
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ console.log(users.length);
|
|
|
54
54
|
KeycloakManager.stop();
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
> **💡 Tip:** For user authentication (
|
|
57
|
+
> **💡 Tip:** For user authentication (including Authorization Code + PKCE), use [`keycloak-express-middleware`](https://github.com/smartenv-crs4/keycloak-express-middleware). OIDC methods in this package are deprecated and kept only for backward compatibility.
|
|
58
58
|
|
|
59
59
|
## Keycloak Feature Flags
|
|
60
60
|
|
|
@@ -102,9 +102,9 @@ Configured handler namespaces:
|
|
|
102
102
|
|
|
103
103
|
All documentation is centralized under `docs/`.
|
|
104
104
|
|
|
105
|
-
### Guides
|
|
105
|
+
### Guides
|
|
106
106
|
|
|
107
|
-
- [
|
|
107
|
+
- [OIDC Migration Plan](OIDC_MIGRATION_PLAN.md) - Deprecation status and migration notes to keycloak-express-middleware
|
|
108
108
|
|
|
109
109
|
### API Reference
|
|
110
110
|
|
|
@@ -163,7 +163,7 @@ docs/ # Centralized documentation
|
|
|
163
163
|
|
|
164
164
|
## Versioning and Compatibility
|
|
165
165
|
|
|
166
|
-
- Package version: `6.0.
|
|
166
|
+
- Package version: `6.0.1`
|
|
167
167
|
- Keycloak Admin client dependency: `@keycloak/keycloak-admin-client`
|
|
168
168
|
- Main compatibility target: Keycloak 25/26
|
|
169
169
|
|