npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

scim2-node

v3.0.1

Published

node lib for SCIM 2.0

Downloads

197

Readme

SCIM-node

NOTE: 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 https://gluu.org/docs/api/scim-2.0/ 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:

$ 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.

Usage

example.js file contains sample code to call each function. Each function has two way to process data and handle error, either using callback function or using promise.

Initialization

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:

1) getUsersCount

To get total count of users.

Request:

// 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.
  }
}

or

// 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 |

2) getUsers

To get collection of users.
"startIndex" is page index.
"count" is number of users to be returned.

Request:

scim.scim2.getUsers(startIndex, count, callback);

Response:

| Status Code | Reason | Response Model | |-------------|----------------------|----------------| | 200 | successful operation | ListResponse | | error_code | failed operation | Error |

3) getUser

To get user object using id attribute of type inum.
"id" is inum of user.

Request:

scim.scim2.getUser(id, callback);

Response:

| Status Code | Reason | Response Model | |-------------|----------------------|----------------| | 200 | successful operation | User | | error_code | failed operation | Error |

4) addUser

To insert new user to SCIM.
'userSampleData' can be object or json ('username' attribute is required. 'meta' attribute is readonly).
Full structure of 'userSampleData' is specified in example.js file.

Request:

scim.scim2.addUser(userSampleData, callback);

Response:

| Status Code | Reason | Response Model | |-------------|----------------------|----------------| | 201 | successful operation | User | | error_code | failed operation | Error |

5) removeUser

To delete user from SCIM using id attribute of type inum.
"id" is inum of user.

Request:

scim.scim2.removeUser(id, callback);

Response:

| Status Code | Reason | Response Model | |-------------|----------------------|----------------| | default | successful operation | - | | error_code | failed operation | Error |

6) editUser

To update existing user in SCIM.
'userSampleData' can be object or json ('username' attribute is required. 'meta' attribute is readonly).
Full structure of 'userSampleData' is specified in example.js file.

Request:

scim.scim2.editUser(id, userSampleData, callback);

Response:

| Status Code | Reason | Response Model | |-------------|----------------------|----------------| | 201 | successful operation | User | | error_code | failed operation | Error |

License

(MIT License)

Copyright (c) 2016 Gluu