node lib for SCIM 2.0
npm install scim2-nodeNOTE: This is a re-upload of the original npm package scim-node. The original npm package was out of date with the git repository. All credit beyond the upload of the current git repo to npm belongs to the original developers.
SCIM node is a client library for the Gluu SCIM 2.0. For information about SCIM 2.0, visit
There are two scim for dealing with UMA 1.0 and UMA 2.0.
For UMA 1.0 use
```
var scim = require('scim-node')(config);
scim.scim.getUsersCount(callback);
For UMA 2.0 use
``
var scim = require('scim-node')(config);
scim.scim2.getUsersCount(callback);Installation
Install scim-node using following command:
`sh`
$ npm install scim2-node
Prerequisite
`
1) Install gluu server in your hosting server to use scim-node library.
2) Enable SCIM support in gluu server.
3) Application will not work if your host is not secure with https.
`
Note: To enable SCIM support, log into oxTrust, open organization configuration page, set "SCIM Support" to "Enabled" and save configuration. The scim-node contains complete documentation about itself.
Initialization
`javascript
var config = {
keyAlg: 'XXXXX', // Algorithm type.
domain: 'https://example.com/', // Gluu server URL.
privateKey: 'value', // Value can be buffer or path of private key.
clientId: '@!XXXX.XXXX.XXXX.XXXX!XXXX!XXXX.XXXX!XXXX!XXXX.XXXX', // UMA client id.
keyId: '000xx0x0-xx00-00xx-xx00-0x000x0x000x', // oxAuth JWKS key id.
};
var scim = require('scim-node')(config);
`
Methods:
Request:
`javascript`
// Process data or handle error in callback function.
scim.scim2.getUsersCount(callback);
function callback(error, data) {
if (error) {
// Handle error here.
} else {
// Process data here.
}
}`
orjavascript`
// Process data or handle error using promise.
scim.scim2.getUsersCount().then(function (data) {
// Process data here.
}).catch(function (error) {
// Handle error here.
});
Response:
| Status Code | Reason | Response Model |
|-------------|----------------------|----------------|
| 200 | successful operation | ListResponse |
| error_code | failed operation | Error |
Request:
`javascript`
scim.scim2.getUsers(startIndex, count, callback);
Response:
| Status Code | Reason | Response Model |
|-------------|----------------------|----------------|
| 200 | successful operation | ListResponse |
| error_code | failed operation | Error |
Request:
`javascript`
scim.scim2.getUser(id, callback);
Response:
| Status Code | Reason | Response Model |
|-------------|----------------------|----------------|
| 200 | successful operation | User |
| error_code | failed operation | Error |
Request:
`javascript`
scim.scim2.addUser(userSampleData, callback);
Response:
| Status Code | Reason | Response Model |
|-------------|----------------------|----------------|
| 201 | successful operation | User |
| error_code | failed operation | Error |
Request:
`javascript`
scim.scim2.removeUser(id, callback);
Response:
| Status Code | Reason | Response Model |
|-------------|----------------------|----------------|
| default | successful operation | - |
| error_code | failed operation | Error |
Request:
`javascript``
scim.scim2.editUser(id, userSampleData, callback);
Response:
| Status Code | Reason | Response Model |
|-------------|----------------------|----------------|
| 201 | successful operation | User |
| error_code | failed operation | Error |
(MIT License)
Copyright (c) 2016 Gluu