keycloak-api-manager 2.0.0 → 2.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/.idea/workspace.xml +1 -1
- package/README.md +863 -1314
- package/index.js +4 -35
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -22,43 +22,9 @@ var authenticationManagementHandler=require('./Handlers/authenticationManagement
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* ***************************** - ENGLISH - *******************************
|
|
25
|
-
* Async Configuration function for the Keycloak adapter in an Express application.
|
|
26
|
-
* It must be called at app startup, before defining any protected routes.
|
|
27
|
-
* It returns a promise
|
|
28
25
|
*
|
|
29
|
-
* Parameters:
|
|
30
|
-
* - app: Express application instance (e.g., const app = express();)
|
|
31
|
-
* - keyCloakConfig: JSON object containing the Keycloak client configuration.
|
|
32
|
-
* This can be obtained from the Keycloak admin console:
|
|
33
|
-
* Clients → [client name] → Installation → "Keycloak OIDC JSON" → Download
|
|
34
|
-
* Example:
|
|
35
|
-
* {
|
|
36
|
-
* "realm": "realm-name",
|
|
37
|
-
* "auth-server-url": "https://keycloak.example.com/",
|
|
38
|
-
* "ssl-required": "external",
|
|
39
|
-
* "resource": "client-name",
|
|
40
|
-
* "credentials": { "secret": "secret-code" },
|
|
41
|
-
* "confidential-port": 0
|
|
42
|
-
* }
|
|
43
|
-
* - keyCloakOptions: advanced configuration options for the adapter.
|
|
44
26
|
* Main supported options:
|
|
45
|
-
* -
|
|
46
|
-
* - scope: authentication scopes (e.g., 'openid profile email offline_access')
|
|
47
|
-
* Note: to use offline_access, the client must have the option enabled and
|
|
48
|
-
* the user must have the offline_access role.
|
|
49
|
-
* - idpHint: to suggest an identity provider to Keycloak during login
|
|
50
|
-
* - cookies: to enable cookie handling
|
|
51
|
-
* - realmUrl: to override the realm URL
|
|
52
|
-
*
|
|
53
|
-
* - adminClientCredentials: [Optional] Advanced configuration for setting up the realm-admin user or client,
|
|
54
|
-
* which will be used as the administrator to manage Keycloak via API.
|
|
55
|
-
* This is required in order to use the administrative functions exposed by this library.
|
|
56
|
-
* If this parameter is not provided, it will not be possible to use the administrative functions of Keycloak
|
|
57
|
-
* exposed by this adapter. In fact, exports.kcAdminClient will be null, so any attempt to call
|
|
58
|
-
* keycloakAdapter.kcAdminClient will result in a runtime error due to access on an undefined object
|
|
59
|
-
*
|
|
60
|
-
* Main supported options:
|
|
61
|
-
* -baseUrl
|
|
27
|
+
* -baseUrl: Keycloak base Url
|
|
62
28
|
* - realmName: [Optional] A String that specifies the realm to authenticate against, if different from the keyCloakConfig.realm parameter.
|
|
63
29
|
* If you intend to use Keycloak administrator credentials, this should be set to 'master'.
|
|
64
30
|
* - scope: [Optional] A string that specifies The OAuth2 scope requested during authentication (optional).
|
|
@@ -117,6 +83,9 @@ exports.configure=async function(adminClientCredentials){
|
|
|
117
83
|
//exports = kcAdminClient;
|
|
118
84
|
};
|
|
119
85
|
|
|
86
|
+
exports.setConfig=async function(configToOverride){
|
|
87
|
+
return(kcAdminClient.setConfig(configToOverride));
|
|
88
|
+
}
|
|
120
89
|
|
|
121
90
|
|
|
122
91
|
/*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keycloak-api-manager",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Keycloak-api-manager is a lightweight Node.js wrapper for the Keycloak Admin REST API. It provides an easy-to-use functional methods and functions to manage realms, users, roles, clients, groups, and permissions directly from your application code — just like you would from the Keycloak admin console.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|