{"_id":"@abdoulaye.diallo.job/keycloack-admin","_rev":"3-f553e0019d62ea3a0904e8a57ab39002","name":"@abdoulaye.diallo.job/keycloack-admin","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@abdoulaye.diallo.job/keycloack-admin","version":"1.0.0","description":"keycloak admin client","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"clean":"rimraf lib","lint":"tslint --force --format verbose \"src/**/*.ts\" \"test/*\"","build":"npm run clean && tsc -p ./tsconfig.release.json --pretty","test":"mocha --require ts-node/register --recursive \"test/**/*.spec.ts\"","test:subset":"mocha --require ts-node/register --recursive --","test:grep":"mocha --require ts-node/register","coverage":"nyc npm run test","watch":"npm run build -- --watch","watch:test":"npm run test -- --watch","prepublishOnly":"npm run build"},"dependencies":{"axios":"^0.24.0","camelize-ts":"^1.0.8","keycloak-js":"^15.0.2","lodash":"^4.17.21","query-string":"^7.0.1","url-join":"^4.0.0","url-template":"^2.0.8"},"devDependencies":{"@types/axios":"^0.14.0","@types/chai":"^4.2.14","@types/faker":"^5.1.4","@types/lodash":"^4.14.165","@types/mocha":"^9.0.0","@types/node":"^16.7.1","@types/url-join":"^4.0.0","@types/url-template":"^2.0.28","chai":"^4.1.2","faker":"^5.1.0","mocha":"^9.1.0","nyc":"^15.1.0","prettier":"^2.1.2","rimraf":"^3.0.2","ts-node":"^10.2.1","tslint":"^6.1.3","typescript":"^4.0.5"},"author":{"name":"wwwy3y3"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/keycloak/keycloak-nodejs-admin-client.git"},"homepage":"https://www.keycloak.org/","bugs":{"url":"https://github.com/keycloak/keycloak-nodejs-admin-client/issues"},"directories":{"lib":"lib","test":"test"},"gitHead":"f2abbaab5460341ea8571a1b3c0cedacefbe5c36","_id":"@abdoulaye.diallo.job/keycloack-admin@1.0.0","_nodeVersion":"14.18.1","_npmVersion":"7.20.5","dist":{"integrity":"sha512-4v0j77V9MdDSTxDNnuVRuStJUtNMWCmj+xqTtNNMm/a5RXqmO6Q3Z+wkQssO/sfXMpZUfoEnlgrPJ7aQ9zIB8w==","shasum":"fd2d3d2715da4645a6f05b764debde0c95690232","tarball":"https://registry.npmjs.org/@abdoulaye.diallo.job/keycloack-admin/-/keycloack-admin-1.0.0.tgz","fileCount":237,"unpackedSize":319376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnmTRCRA9TVsSAnZWagAAmC0P/A6Uek1Qhy57tXVyKWOi\n674cvs4PJZQbE5Rc8mbDbjZB5Q+n1TmzDP7H49/STa4sLoglnjsDV+KARLLU\nldrL+lLWhkuQO4CDlU3fZ08PJTNCTkCoDiK7NG3B15nQHTxE50sfDGtTrWC5\nl+pPxwTFqbZqd3KQZCaKL/r+ROk023jFx9Ko80RQ9NPsSui23pmkz3BjsBKL\nRyQTVp/U2PwRCCNl+EXuHH/AQkFyySRD7n6QiBIIk/ocjFs2h6jApG7t/aad\nLiLKwhZKAPKhCWwKLb+9gu0ZykIzNT6OB8b2Mq4BONtEmN/KHuTcQdmeuZ0f\n4TtGI5Wanba5X2Pw0sWlipjFIk0+h7yB0YjiKTN6IHLtUgucE8KZFIn+rHvV\nvJxAUp35UfSoH6Rd+NE7OccbH3SgKpCSn4UE8RQfFq4tb5jQQEShNkCp9JDI\nID4ANzr+J87rJyOEiIQyK0fhLddgG5IlVKRzB95mrYfTtRCNGT132Pey8N+s\nY/d50tK4+aadPjfyIB6/2nNM8hVbm8XBUpbyi/VpRGvK1q6WWHpRstIQD90V\nhnQ+Shs0559YACGHHAIMiz11O4ulPdbK7sobEYrmVdbqtlVGj/VEqvWNSouR\nZ+RYcs2mTKwCYwVYaANXw0M5KZncT/sJbCKCpUQ8TGgvZq2A/eOC2q89fTKK\nJ8PP\r\n=Shot\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJJuxUnGP4gwHZHEp4/cOGmykFG11YtLo7b4MGydakdAiEA4ZuRfa02NJ+MamPYEoQV1sE3f5naZeepayhXK6JQ+QU="}]},"_npmUser":{"name":"abdoulaye.diallo.job","email":"abdoulaye.diallo.job@gmail.com"},"maintainers":[{"name":"abdoulaye.diallo.job","email":"abdoulaye.diallo.job@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/keycloack-admin_1.0.0_1637770449469_0.46120077158399986"},"_hasShrinkwrap":false},"1.0.1":{"name":"@abdoulaye.diallo.job/keycloack-admin","version":"1.0.1","description":"keycloak admin client","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"clean":"rimraf lib","lint":"tslint --force --format verbose \"src/**/*.ts\" \"test/*\"","build":"npm run clean && tsc -p ./tsconfig.release.json --pretty","test":"mocha --require ts-node/register --recursive \"test/**/*.spec.ts\"","test:subset":"mocha --require ts-node/register --recursive --","test:grep":"mocha --require ts-node/register","coverage":"nyc npm run test","watch":"npm run build -- --watch","watch:test":"npm run test -- --watch","prepublishOnly":"npm run build"},"dependencies":{"axios":"^0.24.0","camelize-ts":"^1.0.8","keycloak-js":"^15.0.2","lodash":"^4.17.21","query-string":"^7.0.1","url-join":"^4.0.0","url-template":"^2.0.8"},"devDependencies":{"@types/axios":"^0.14.0","@types/chai":"^4.2.14","@types/faker":"^5.1.4","@types/lodash":"^4.14.165","@types/mocha":"^9.0.0","@types/node":"^16.7.1","@types/url-join":"^4.0.0","@types/url-template":"^2.0.28","chai":"^4.1.2","faker":"^5.1.0","mocha":"^9.1.0","nyc":"^15.1.0","prettier":"^2.1.2","rimraf":"^3.0.2","ts-node":"^10.2.1","tslint":"^6.1.3","typescript":"^4.0.5"},"author":{"name":"wwwy3y3"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/keycloak/keycloak-nodejs-admin-client.git"},"homepage":"https://www.keycloak.org/","bugs":{"url":"https://github.com/keycloak/keycloak-nodejs-admin-client/issues"},"directories":{"lib":"lib","test":"test"},"gitHead":"e927aab3b41c5f86b5f3def91d94e40998982b38","_id":"@abdoulaye.diallo.job/keycloack-admin@1.0.1","_nodeVersion":"14.18.1","_npmVersion":"7.20.5","dist":{"integrity":"sha512-7muuLyqe5o5sF16uWn9Yc2tYNC/Kv39Li9EJkukptq9NRqs0Zm5zQ6qEX4FOz2kR75cJHpiPNEUUeN+hwPEK/Q==","shasum":"f5d658daf7785f74a59a9aa4487f312b9bb9b861","tarball":"https://registry.npmjs.org/@abdoulaye.diallo.job/keycloack-admin/-/keycloack-admin-1.0.1.tgz","fileCount":237,"unpackedSize":319975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoMjZCRA9TVsSAnZWagAASK8P/iMlebm0rNKvIC6C4OGD\ncg+w3qqgGD3aEBE9/iA3rm4Rvk0VEApl9jKLkfCpg+UH1cusdHTQIVnUbfpO\nfQU06MMsebpaFqitQo//2QwV+QZZ8ns9AwleEq5zTkhgzQmcBgvD4+7q9z+L\n5JL3cgAwIVIOA0XKEHhTX38vXcpFTIzTMbPKl8/tLGxFQE8ywbDcO+xVlm/Y\n9ceKv1F6vcbODjPywh/Zm6sXInK4fRpgLSas2I+Gj/aBm/LDpMMUfI9t02dZ\nwE/R1Gw7wpBMD0U+PSLXF3GSObCUlpgXTn/oRcahQfs4dsJIERPe/fPuAf0d\nhEmppNPm9Uy5ltN0wOsvUgQ3rH176dCG0qjdwZ5AlRg7WxGbZPqxggaA1qLX\nNUwe4KJs3rOZQhVtuuThyzu1R+T9wz7XkiVGGXFRqRCrqhdKr3oIUHwEpaaJ\nPsM1iDcrmH9bSU/ufUX9+I65Py5fi8DL5pUdlOcAo+xhuYLRG+ZcfccDVojW\nsQFXo6WHa3kOCHxUp0/JcQxLg9hz524rO/nnR+rDAKwLWWdKZw4G4G+Fxdqa\nMUjw+7UPwkXrzZCEwo2zAFeF+5T3EBI0V7PYPNa9qfNGyuDK80cIhKBp1Arx\nDb0mjK+H/TH+M0rfE1yx08RMBALhma6K+3TdrY6PBGcWy3DYy65KyX56NNek\ngtjt\r\n=iVGg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBegrb920c71Zr7YXEGsmnMnTbgEu+ofL5/v2CbYzuzAIgBHs/IGOr0JVAVNSPwch9RJzh0s/bvQ4dJrbh9gO8zjU="}]},"_npmUser":{"name":"abdoulaye.diallo.job","email":"abdoulaye.diallo.job@gmail.com"},"maintainers":[{"name":"abdoulaye.diallo.job","email":"abdoulaye.diallo.job@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/keycloack-admin_1.0.1_1637927129706_0.3071447162466763"},"_hasShrinkwrap":false},"1.0.2":{"name":"@abdoulaye.diallo.job/keycloack-admin","version":"1.0.2","description":"keycloak admin client","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"clean":"rimraf lib","lint":"tslint --force --format verbose \"src/**/*.ts\" \"test/*\"","build":"npm run clean && tsc -p ./tsconfig.release.json --pretty","test":"mocha --require ts-node/register --recursive \"test/**/*.spec.ts\"","test:subset":"mocha --require ts-node/register --recursive --","test:grep":"mocha --require ts-node/register","coverage":"nyc npm run test","watch":"npm run build -- --watch","watch:test":"npm run test -- --watch","prepublishOnly":"npm run build"},"dependencies":{"axios":"^0.24.0","camelize-ts":"^1.0.8","keycloak-js":"^15.0.2","lodash":"^4.17.21","query-string":"^7.0.1","url-join":"^4.0.0","url-template":"^2.0.8"},"devDependencies":{"@types/axios":"^0.14.0","@types/chai":"^4.2.14","@types/faker":"^5.1.4","@types/lodash":"^4.14.165","@types/mocha":"^9.0.0","@types/node":"^16.7.1","@types/url-join":"^4.0.0","@types/url-template":"^2.0.28","chai":"^4.1.2","faker":"^5.1.0","mocha":"^9.1.0","nyc":"^15.1.0","prettier":"^2.1.2","rimraf":"^3.0.2","ts-node":"^10.2.1","tslint":"^6.1.3","typescript":"^4.0.5"},"author":{"name":"wwwy3y3"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/keycloak/keycloak-nodejs-admin-client.git"},"homepage":"https://www.keycloak.org/","bugs":{"url":"https://github.com/keycloak/keycloak-nodejs-admin-client/issues"},"directories":{"lib":"lib","test":"test"},"gitHead":"987cd15372b8e512ff55f3d801dc7c8a1256a77a","_id":"@abdoulaye.diallo.job/keycloack-admin@1.0.2","_nodeVersion":"14.18.1","_npmVersion":"7.20.5","dist":{"integrity":"sha512-g+dtdAhEu1djdQNXfGp3ffktsmz8+fOFSFr6NdYfnLky7NUAsp6rklcCSrHGpnKEf1ZdioEMuiUoyPlMM1jbJA==","shasum":"8dfc450d584f7230d10c857db9e0d24b024e6a52","tarball":"https://registry.npmjs.org/@abdoulaye.diallo.job/keycloack-admin/-/keycloack-admin-1.0.2.tgz","fileCount":237,"unpackedSize":319985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoMwuCRA9TVsSAnZWagAAfa8QAJYjrv8+W4SV5uWANc7+\nHyqYn5d300NNXmAzJwJnjs87LbhyTv31vlJLoC8wE4hSblXH2KkiipHFg8Ml\nqENUyvwF0V8SHMi5XNVqjErwSNW2mMWY6FAVn5FLHd3QNDMvyLBvN5RUMU4N\npy1UddvbjFEYOIseCFXG9oKHMuWImxP0QUe2pwes4vG7Pzsh8S9HzzwVwm3k\n+YuKebyVMsibMhLa1m11aKlb3xP/DJaeYu+pvn/hX+t+urUHKg077hk/8aQN\nJlYupFas6v932i6DdCQR2zI7yzRoCXtYMKVJCgLkN4QNnCXeDZwLbxikLQal\n6+WMvPyUd8D2p42UIp3UPHDbd7JyevAhTHKcm4WndWzvCi6uaGpjlIvemsQC\noBfVff7KfDk8MeX73Ckr9Hc1DGKGp9wYELsLxigzPUVGIozT8QaEuQ+hf/kl\nBgz7zxyZ4c/ExWo87dyg9gj9ofZokQpw5l2lJ3aJ6hoNhu+cLg28dz1VRhS8\ns8snEKetEwJYi3P9vCrYlq7D8a+tYirZeZLtjWU0IQcCdQWTJPRwL65437jt\nLvBYMAb6mF9JFbJAY09S/Eh2kVWfggxOCX9orB6PFWdYRfHYBNFZcQsW+6Af\ny914D4q+lhWk53KrzyYTRhu9O5p4AWRo5YB51WuXbFyCDV3g//17uIhBbb4l\nMDGM\r\n=CNQf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1KMLmrTfbJkGZS/la7fG8d0jUinQPDPAvZxmjoAblpAiEAjzt3/SvXEHy6JtDsOApaqmJ/XT+BThJEqddmQXjucBI="}]},"_npmUser":{"name":"abdoulaye.diallo.job","email":"abdoulaye.diallo.job@gmail.com"},"maintainers":[{"name":"abdoulaye.diallo.job","email":"abdoulaye.diallo.job@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/keycloack-admin_1.0.2_1637927982808_0.8843380209576679"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-24T16:14:09.427Z","1.0.0":"2021-11-24T16:14:09.630Z","modified":"2022-04-04T10:58:28.961Z","1.0.1":"2021-11-26T11:45:29.861Z","1.0.2":"2021-11-26T11:59:42.961Z"},"maintainers":[{"name":"abdoulaye.diallo.job","email":"abdoulaye.diallo.job@gmail.com"}],"description":"keycloak admin client","homepage":"https://www.keycloak.org/","repository":{"type":"git","url":"git+https://github.com/keycloak/keycloak-nodejs-admin-client.git"},"author":{"name":"wwwy3y3"},"bugs":{"url":"https://github.com/keycloak/keycloak-nodejs-admin-client/issues"},"license":"Apache-2.0","readme":"## Keycloak Admin Client\n\n[![Github Actions](https://github.com/keycloak/keycloak-nodejs-admin-client/workflows/CI/badge.svg)](https://github.com/keycloak/keycloak-nodejs-admin-client/actions/workflows/main.yaml)\n[![npm version](https://badge.fury.io/js/%40keycloak%2Fkeycloak-admin-client.svg)](https://badge.fury.io/js/%40keycloak%2Fkeycloak-admin-client)\n\n## Features\n\n- TypeScript supported\n- Latest Keycloak version supported\n- [Complete resource definitions](https://github.com/keycloak/keycloak-nodejs-admin-client/tree/master/src/defs)\n- [Well-tested for supported APIs](https://github.com/keycloak/keycloak-nodejs-admin-client/tree/master/test)\n\n## Install\n\n```sh\nnpm install @abdoulaye.org/keycloak-admin-client\n```\n\n## Usage\n\n```js\nimport KcAdminClient from '@abdoulaye.org/keycloak-admin-client';\n\n// To configure the client, pass an object to override any of these  options:\n// {\n//   baseUrl: 'http://127.0.0.1:8080/auth',\n//   realmName: 'master',\n//   requestConfig: {\n//     /* Axios request config options https://github.com/axios/axios#request-config */\n//   },\n// }\nconst kcAdminClient = new KcAdminClient();\n\n// Authorize with username / password\nawait kcAdminClient.auth({\n  username: 'wwwy3y3',\n  password: 'wwwy3y3',\n  grantType: 'password',\n  clientId: 'admin-cli',\n  totp: '123456', // optional Time-based One-time Password if OTP is required in authentication flow\n});\n\n// List all users\nconst users = await kcAdminClient.users.find();\n\n// Override client configuration for all further requests:\nkcAdminClient.setConfig({\n  realmName: 'another-realm',\n});\n\n// This operation will now be performed in 'another-realm' if the user has access.\nconst groups = await kcAdminClient.groups.find();\n\n// Set a `realm` property to override the realm for only a single operation.\n// For example, creating a user in another realm:\nawait this.kcAdminClient.users.create({\n  realm: 'a-third-realm',\n  username: 'username',\n  email: 'user@example.com',\n});\n```\n\nTo refresh the access token provided by Keycloak, an OpenID client like [panva/node-openid-client](https://github.com/panva/node-openid-client) can be used like this:\n\n```js\nimport {Issuer} from 'openid-client';\n\nconst keycloakIssuer = await Issuer.discover(\n  'http://localhost:8080/auth/realms/master',\n);\n\nconst client = new keycloakIssuer.Client({\n  client_id: 'admin-cli', // Same as `clientId` passed to client.auth()\n  token_endpoint_auth_method: 'none', // to send only client_id in the header\n});\n\n// Use the grant type 'password'\nlet tokenSet = await client.grant({\n  grant_type: 'password',\n  username: 'wwwy3y3',\n  password: 'wwwy3y3',\n});\n\n// Periodically using refresh_token grant flow to get new access token here\nsetInterval(async () => {\n  const refreshToken = tokenSet.refresh_token;\n  tokenSet = await client.refresh(refreshToken);\n  kcAdminClient.setAccessToken(tokenSet.access_token);\n}, 58 * 1000); // 58 seconds\n```\n\nIn cases where you don't have a refresh token, eg. in a client credentials flow, you can simply call `kcAdminClient.auth` to get a new access token, like this:\n\n```js\nconst credentials = {\n  grantType: 'client_credentials',\n  clientId: 'clientId',\n  clientSecret: 'some-client-secret-uuid',\n};\nawait kcAdminClient.auth(credentials);\n\nsetInterval(() => kcAdminClient.auth(credentials), 58 * 1000); // 58 seconds\n```\n\n## Supported APIs\n\n### [Realm admin](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_realms_admin_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/realms.spec.ts\n\n- Import a realm from a full representation of that realm (`POST /`)\n- Get the top-level representation of the realm (`GET /{realm}`)\n- Update the top-level information of the realm (`PUT /{realm}`)\n- Delete the realm (`DELETE /{realm}`)\n- Partial export of existing realm into a JSON file (`POST /{realm}/partial-export`)\n- Get users management permissions (`GET /{realm}/users-management-permissions`)\n- Enable users management permissions (`PUT /{realm}/users-management-permissions`)\n- Get events (`GET /{realm}/events`)\n- Get admin events (`GET /{realm}/admin-events`)\n- Remove all user sessions (`POST /{realm}/logout-all`)\n- Remove a specific user session (`DELETE /{realm}/sessions/{session}`)\n- Get client policies policies (`GET /{realm}/client-policies/policies`)\n- Update client policies policies (`PUT /{realm}/client-policies/policies`)\n- Get client policies profiles (`GET /{realm}/client-policies/profiles`)\n- Update client policies profiles (`PUT /{realm}/client-policies/profiles`)\n\n### [Role](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_roles_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/roles.spec.ts\n\n- Create a new role for the realm (`POST /{realm}/roles`)\n- Get all roles for the realm (`GET /{realm}/roles`)\n- Get a role by name (`GET /{realm}/roles/{role-name}`)\n- Update a role by name (`PUT /{realm}/roles/{role-name}`)\n- Delete a role by name (`DELETE /{realm}/roles/{role-name}`)\n- Get all users in a role by name for the realm (`GET /{realm}/roles/{role-name}/users`)\n\n### [Roles (by ID)](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_roles_by_id_resource)\n\n- Get a specific role (`GET /{realm}/roles-by-id/{role-id}`)\n- Update the role (`PUT /{realm}/roles-by-id/{role-id}`)\n- Delete the role (`DELETE /{realm}/roles-by-id/{role-id}`)\n- Make the role a composite role by associating some child roles(`POST /{realm}/roles-by-id/{role-id}/composites`)\n- Get role’s children Returns a set of role’s children provided the role is a composite. (`GET /{realm}/roles-by-id/{role-id}/composites`)\n- Remove a set of roles from the role’s composite (`DELETE /{realm}/roles-by-id/{role-id}/composites`)\n- Get client-level roles for the client that are in the role’s composite (`GET /{realm}/roles-by-id/{role-id}/composites/clients/{client}`)\n- Get realm-level roles that are in the role’s composite (`GET /{realm}/roles-by-id/{role-id}/composites/realm`)\n\n### [User](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_users_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/users.spec.ts\n\n- Create a new user (`POST /{realm}/users`)\n- Get users Returns a list of users, filtered according to query parameters (`GET /{realm}/users`)\n- Get representation of the user (`GET /{realm}/users/{id}`)\n- Update the user (`PUT /{realm}/users/{id}`)\n- Delete the user (`DELETE /{realm}/users/{id}`)\n- Count users (`GET /{realm}/users/count`)\n- Send a update account email to the user An email contains a link the user can click to perform a set of required actions. (`PUT /{realm}/users/{id}/execute-actions-email`)\n- Get user groups (`GET /{realm}/users/{id}/groups`)\n- Add user to group (`PUT /{realm}/users/{id}/groups/{groupId}`)\n- Delete user from group (`DELETE /{realm}/users/{id}/groups/{groupId}`)\n- Remove TOTP from the user (`PUT /{realm}/users/{id}/remove-totp`)\n- Set up a temporary password for the user User will have to reset the temporary password next time they log in. (`PUT /{realm}/users/{id}/reset-password`)\n- Send an email-verification email to the user An email contains a link the user can click to verify their email address. (`PUT /{realm}/users/{id}/send-verify-email`)\n\n### User group-mapping\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/users.spec.ts#L178\n\n- Add user to group (`PUT /{id}/groups/{groupId}`)\n- List all user groups (`GET /{id}/groups`)\n- Count user groups (`GET /{id}/groups/count`)\n- Remove user from group (`DELETE /{id}/groups/{groupId}`)\n\n### User role-mapping\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/users.spec.ts#L143\n\n- Get user role-mappings (`GET /{realm}/users/{id}/role-mappings`)\n- Add realm-level role mappings to the user (`POST /{realm}/users/{id}/role-mappings/realm`)\n- Get realm-level role mappings (`GET /{realm}/users/{id}/role-mappings/realm`)\n- Delete realm-level role mappings (`DELETE /{realm}/users/{id}/role-mappings/realm`)\n- Get realm-level roles that can be mapped (`GET /{realm}/users/{id}/role-mappings/realm/available`)\n- Get effective realm-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/users/{id}/role-mappings/realm/composite`)\n\n### [Group](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_groups_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/groups.spec.ts\n\n- Create (`POST /{realm}/groups`)\n- List (`GET /{realm}/groups`)\n- Get one (`GET /{realm}/groups/{id}`)\n- Update (`PUT /{realm}/groups/{id}`)\n- Delete (`DELETE /{realm}/groups/{id}`)\n- Count (`GET /{realm}/groups/count`)\n- List members (`GET /{realm}/groups/{id}/members`)\n- Set or create child (`POST /{realm}/groups/{id}/children`)\n\n### Group role-mapping\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/groups.spec.ts#L76\n\n- Get group role-mappings (`GET /{realm}/groups/{id}/role-mappings`)\n- Add realm-level role mappings to the group (`POST /{realm}/groups/{id}/role-mappings/realm`)\n- Get realm-level role mappings (`GET /{realm}/groups/{id}/role-mappings/realm`)\n- Delete realm-level role mappings (`DELETE /{realm}/groups/{id}/role-mappings/realm`)\n- Get realm-level roles that can be mapped (`GET /{realm}/groups/{id}/role-mappings/realm/available`)\n\n### [Client](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_clients_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clients.spec.ts\n\n- Create a new client (`POST /{realm}/clients`)\n- Get clients belonging to the realm (`GET /{realm}/clients`)\n- Get representation of the client (`GET /{realm}/clients/{id}`)\n- Update the client (`PUT /{realm}/clients/{id}`)\n- Delete the client (`DELETE /{realm}/clients/{id}`)\n\n### [Client roles](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_roles_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clients.spec.ts\n\n- Create a new role for the client (`POST /{realm}/clients/{id}/roles`)\n- Get all roles for the client (`GET /{realm}/clients/{id}/roles`)\n- Get a role by name (`GET /{realm}/clients/{id}/roles/{role-name}`)\n- Update a role by name (`PUT /{realm}/clients/{id}/roles/{role-name}`)\n- Delete a role by name (`DELETE /{realm}/clients/{id}/roles/{role-name}`)\n\n### [Client role-mapping for group](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_client_role_mappings_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/groups.spec.ts#L150\n\n- Add client-level roles to the group role mapping (`POST /{realm}/groups/{id}/role-mappings/clients/{client}`)\n- Get client-level role mappings for the group (`GET /{realm}/groups/{id}/role-mappings/clients/{client}`)\n- Delete client-level roles from group role mapping (`DELETE /{realm}/groups/{id}/role-mappings/clients/{client}`)\n- Get available client-level roles that can be mapped to the group (`GET /{realm}/groups/{id}/role-mappings/clients/{client}/available`)\n\n### [Client role-mapping for user](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_client_role_mappings_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/users.spec.ts#L217\n\n- Add client-level roles to the user role mapping (`POST /{realm}/users/{id}/role-mappings/clients/{client}`)\n- Get client-level role mappings for the user (`GET /{realm}/users/{id}/role-mappings/clients/{client}`)\n- Delete client-level roles from user role mapping (`DELETE /{realm}/users/{id}/role-mappings/clients/{client}`)\n- Get available client-level roles that can be mapped to the user (`GET /{realm}/users/{id}/role-mappings/clients/{client}/available`)\n\n### [Client Attribute Certificate](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_client_attribute_certificate_resource)\n\n- Get key info (`GET /{realm}/clients/{id}/certificates/{attr}`)\n- Get a keystore file for the client, containing private key and public certificate (`POST /{realm}/clients/{id}/certificates/{attr}/download`)\n- Generate a new certificate with new key pair (`POST /{realm}/clients/{id}/certificates/{attr}/generate`)\n- Generate a new keypair and certificate, and get the private key file Generates a keypair and certificate and serves the private key in a specified keystore format. (`POST /{realm}/clients/{id}/certificates/{attr}/generate-and-download`)\n- Upload certificate and eventually private key (`POST /{realm}/clients/{id}/certificates/{attr}/upload`)\n- Upload only certificate, not private key (`POST /{realm}/clients/{id}/certificates/{attr}/upload-certificate`)\n\n### [Identity Providers](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_identity_providers_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/idp.spec.ts\n\n- Create a new identity provider (`POST /{realm}/identity-provider/instances`)\n- Get identity providers (`GET /{realm}/identity-provider/instances`)\n- Get the identity provider (`GET /{realm}/identity-provider/instances/{alias}`)\n- Update the identity provider (`PUT /{realm}/identity-provider/instances/{alias}`)\n- Delete the identity provider (`DELETE /{realm}/identity-provider/instances/{alias}`)\n- Find identity provider factory (`GET /{realm}/identity-provider/providers/{providerId}`)\n- Create a new identity provider mapper (`POST /{realm}/identity-provider/instances/{alias}/mappers`)\n- Get identity provider mappers (`GET /{realm}/identity-provider/instances/{alias}/mappers`)\n- Get the identity provider mapper (`GET /{realm}/identity-provider/instances/{alias}/mappers/{id}`)\n- Update the identity provider mapper (`PUT /{realm}/identity-provider/instances/{alias}/mappers/{id}`)\n- Delete the identity provider mapper (`DELETE /{realm}/identity-provider/instances/{alias}/mappers/{id}`)\n- Find the identity provider mapper types (`GET /{realm}/identity-provider/instances/{alias}/mapper-types`)\n\n### [Client Scopes](https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_client_scopes_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clientScopes.spec.ts\n\n- Create a new client scope (`POST /{realm}/client-scopes`)\n- Get client scopes belonging to the realm (`GET /{realm}/client-scopes`)\n- Get representation of the client scope (`GET /{realm}/client-scopes/{id}`)\n- Update the client scope (`PUT /{realm}/client-scopes/{id}`)\n- Delete the client scope (`DELETE /{realm}/client-scopes/{id}`)\n\n### [Client Scopes for realm](https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_client_scopes_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clientScopes.spec.ts\n\n- Get realm default client scopes (`GET /{realm}/default-default-client-scopes`)\n- Add realm default client scope (`PUT /{realm}/default-default-client-scopes/{id}`)\n- Delete realm default client scope (`DELETE /{realm}/default-default-client-scopes/{id}`)\n- Get realm optional client scopes (`GET /{realm}/default-optional-client-scopes`)\n- Add realm optional client scope (`PUT /{realm}/default-optional-client-scopes/{id}`)\n- Delete realm optional client scope (`DELETE /{realm}/default-optional-client-scopes/{id}`)\n\n### [Client Scopes for client](https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_client_scopes_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clientScopes.spec.ts\n\n- Get default client scopes (`GET /{realm}/clients/{id}/default-client-scopes`)\n- Add default client scope (`PUT /{realm}/clients/{id}/default-client-scopes/{clientScopeId}`)\n- Delete default client scope (`DELETE /{realm}/clients/{id}/default-client-scopes/{clientScopeId}`)\n- Get optional client scopes (`GET /{realm}/clients/{id}/optional-client-scopes`)\n- Add optional client scope (`PUT /{realm}/clients/{id}/optional-client-scopes/{clientScopeId}`)\n- Delete optional client scope (`DELETE /{realm}/clients/{id}/optional-client-scopes/{clientScopeId}`)\n\n### [Scope Mappings for client scopes](https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_scope_mappings_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clientScopes.spec.ts\n\n- Get all scope mappings for the client (`GET /{realm}/client-scopes/{id}/scope-mappings`)\n- Add client-level roles to the client’s scope (`POST /{realm}/client-scopes/{id}/scope-mappings/clients/{client}`)\n- Get the roles associated with a client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/clients/{client}`)\n- The available client-level roles (`GET /{realm}/client-scopes/{id}/scope-mappings/clients/{client}/available`)\n- Get effective client roles (`GET /{realm}/client-scopes/{id}/scope-mappings/clients/{client}/composite`)\n- Remove client-level roles from the client’s scope. (`DELETE /{realm}/client-scopes/{id}/scope-mappings/clients/{client}`)\n- Add a set of realm-level roles to the client’s scope (`POST /{realm}/client-scopes/{id}/scope-mappings/realm`)\n- Get realm-level roles associated with the client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/realm`)\n- Remove a set of realm-level roles from the client’s scope (`DELETE /{realm}/client-scopes/{id}/scope-mappings/realm`)\n- Get realm-level roles that are available to attach to this client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/realm/available`)\n- Get effective realm-level roles associated with the client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/realm/composite`)\n\n### [Scope Mappings for clients](https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_scope_mappings_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clientScopes.spec.ts\n\n- Get all scope mappings for the client (`GET /{realm}/clients/{id}/scope-mappings`)\n- Add client-level roles to the client’s scope (`POST /{realm}/clients/{id}/scope-mappings/clients/{client}`)\n- Get the roles associated with a client’s scope (`GET /{realm}/clients/{id}/scope-mappings/clients/{client}`)\n- Remove client-level roles from the client’s scope. (`DELETE /{realm}/clients/{id}/scope-mappings/clients/{client}`)\n- The available client-level roles (`GET /{realm}/clients/{id}/scope-mappings/clients/{client}/available`)\n- Get effective client roles (`GET /{realm}/clients/{id}/scope-mappings/clients/{client}/composite`)\n- Add a set of realm-level roles to the client’s scope (`POST /{realm}/clients/{id}/scope-mappings/realm`)\n- Get realm-level roles associated with the client’s scope (`GET /{realm}/clients/{id}/scope-mappings/realm`)\n- Remove a set of realm-level roles from the client’s scope (`DELETE /{realm}/clients/{id}/scope-mappings/realm`)\n- Get realm-level roles that are available to attach to this client’s scope (`GET /{realm}/clients/{id}/scope-mappings/realm/available`)\n- Get effective realm-level roles associated with the client’s scope (`GET /{realm}/clients/{id}/scope-mappings/realm/composite`)\n\n### [Protocol Mappers for client scopes](https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_protocol_mappers_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clientScopes.spec.ts\n\n- Create multiple mappers (`POST /{realm}/client-scopes/{id}/protocol-mappers/add-models`)\n- Create a mapper (`POST /{realm}/client-scopes/{id}/protocol-mappers/models`)\n- Get mappers (`GET /{realm}/client-scopes/{id}/protocol-mappers/models`)\n- Get mapper by id (`GET /{realm}/client-scopes/{id}/protocol-mappers/models/{mapperId}`)\n- Update the mapper (`PUT /{realm}/client-scopes/{id}/protocol-mappers/models/{mapperId}`)\n- Delete the mapper (`DELETE /{realm}/client-scopes/{id}/protocol-mappers/models/{mapperId}`)\n- Get mappers by name for a specific protocol (`GET /{realm}/client-scopes/{id}/protocol-mappers/protocol/{protocol}`)\n\n### [Protocol Mappers for clients](https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_protocol_mappers_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clients.spec.ts\n\n- Create multiple mappers (`POST /{realm}/clients/{id}/protocol-mappers/add-models`)\n- Create a mapper (`POST /{realm}/clients/{id}/protocol-mappers/models`)\n- Get mappers (`GET /{realm}/clients/{id}/protocol-mappers/models`)\n- Get mapper by id (`GET /{realm}/clients/{id}/protocol-mappers/models/{mapperId}`)\n- Update the mapper (`PUT /{realm}/clients/{id}/protocol-mappers/models/{mapperId}`)\n- Delete the mapper (`DELETE /{realm}/clients/{id}/protocol-mappers/models/{mapperId}`)\n- Get mappers by name for a specific protocol (`GET /{realm}/clients/{id}/protocol-mappers/protocol/{protocol}`)\n\n### [Component]()\n\nSupported for [user federation](https://www.keycloak.org/docs/latest/server_admin/index.html#_user-storage-federation). Demo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/components.spec.ts\n\n- Create (`POST /{realm}/components`)\n- List (`GET /{realm}/components`)\n- Get (`GET /{realm}/components/{id}`)\n- Update (`PUT /{realm}/components/{id}`)\n- Delete (`DELETE /{realm}/components/{id}`)\n\n### [Sessions for clients]()\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clients.spec.ts\n\n- List user sessions for a specific client (`GET /{realm}/clients/{id}/user-sessions`)\n- List offline sessions for a specific client (`GET /{realm}/clients/{id}/offline-sessions`)\n- Get user session count for a specific client (`GET /{realm}/clients/{id}/session-count`)\n- List offline session count for a specific client (`GET /{realm}/clients/{id}/offline-session-count`)\n\n### [Authentication Management: Required actions](https://www.keycloak.org/docs-api/8.0/rest-api/index.html#_authentication_management_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/authenticationManagement.spec.ts\n\n- Register a new required action (`POST /{realm}/authentication/register-required-action`)\n- Get required actions. Returns a list of required actions. (`GET /{realm}/authentication/required-actions`)\n- Get required action for alias (`GET /{realm}/authentication/required-actions/{alias}`)\n- Update required action (`PUT /{realm}/authentication/required-actions/{alias}`)\n- Delete required action (`DELETE /{realm}/authentication/required-actions/{alias}`)\n- Lower required action’s priority (`POST /{realm}/authentication/required-actions/{alias}/lower-priority`)\n- Raise required action’s priority (`POST /{realm}/authentication/required-actions/{alias}/raise-priority`)\n- Get unregistered required actions Returns a list of unregistered required actions. (`GET /{realm}/authentication/unregistered-required-actions`)\n\n### [Authorization: Permission](https://www.keycloak.org/docs/8.0/authorization_services/#_overview)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clients.spec.ts\n\n- Create permission (`POST /{realm}/clients/{id}/authz/resource-server/permission/{type}`)\n- Get permission (`GET /{realm}/clients/{id}/authz/resource-server/permission/{type}/{permissionId}`)\n- Update permission (`PUT /{realm}/clients/{id}/authz/resource-server/permission/{type}/{permissionId}`)\n- Delete permission (`DELETE /{realm}/clients/{id}/authz/resource-server/permission/{type}/{permissionId}`)\n\n### [Authorization: Policy](https://www.keycloak.org/docs/8.0/authorization_services/#_overview)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/clients.spec.ts\n\n- Create policy (`POST /{realm}/clients/{id}/authz/resource-server/policy/{type}`)\n- Get policy (`GET /{realm}/clients/{id}/authz/resource-server/policy/{type}/{policyId}`)\n- Get policy by name (`GET /{realm}/clients/{id}/authz/resource-server/policy/search`)\n- Update policy (`PUT /{realm}/clients/{id}/authz/resource-server/policy/{type}/{policyId}`)\n- Delete policy (`DELETE /{realm}/clients/{id}/authz/resource-server/policy/{policyId}`)\n\n### [Attack Detection](https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_attack_detection_resource)\n\nDemo code: https://github.com/keycloak/keycloak-nodejs-admin-client/blob/master/test/attackDetection.spec.ts\n\n- Clear any user login failures for all users This can release temporary disabled users (`DELETE /{realm}/attack-detection/brute-force/users`)\n- Get status of a username in brute force detection (`GET /{realm}/attack-detection/brute-force/users/{userId}`)\n- Clear any user login failures for the user This can release temporary disabled user (`DELETE /{realm}/attack-detection/brute-force/users/{userId}`)\n\n## Not yet supported\n\n- [Authentication Management](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_authentication_management_resource)\n- [Client Initial Access](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_client_initial_access_resource)\n- [Client Registration Policy](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_client_registration_policy_resource)\n- [Key](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_key_resource)\n- [User Storage Provider](https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_user_storage_provider_resource)\n\n## Maintainers\n\nThis repo is originally developed by [Canner](https://www.cannercms.com) and [InfuseAI](https://infuseai.io) before being transferred under keycloak organization.\n","readmeFilename":"README.md"}