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

scim-node

v2.2.2

Published

node lib for SCIM 2.0

Downloads

343

Readme

SCIM-node

SCIM is a specification designed to reduce the complexity of user management operations by providing a common user schema and the patterns for exchanging this schema using HTTP in a platform-neutral fashion. The aim of SCIM is to achieve interoperability, security, and scalability in the context of identity management.

Developers can think of SCIM merely as a REST API with endpoints exposing CRUD functionality (create, update, retrieve and delete).

Detailed specifications for SCIM can be found at RFC 7642, RFC 7643, and RFC 7644.

SCIM node is a client library for the Gluu SCIM 2.0. Gluu's implementation of SCIM service is available at User Management with SCIM.

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);

Prerequisite

  1. Gluu CE >= 4.0
  2. Node JS >= 10.x.x

Installation

$ npm install scim-node

Configuration

  1. Copy the requesting party JKS file to your nodejs project (inside the Gluu server chroot, it is located at /install/community-edition-setup/output/scim-rp.jks).

  2. Have the requesting party client ID and password at hand. You can find this info in the file /install/community-edition-setup/setup.properties.last. Try running cat setup.properties.last | grep "scim_rp_client". The default password is secret.

  3. Ensure you have enabled SCIM and UMA.

  4. scim-node need privateKey, keyAlg and keyId. so you need to run generate-private-key.sh. Download generate-private-key.sh file, put it in your project root folder where you have scim-rp.jks file. it will provide you private key file final-private-key.key, keyId and keyAlg. you just need to pass the scim_rp_client's password.

    sh generate-privte-key.sh [scim_rp_client's password]

    Once you run this file. It will show keyId and keyAlg. You need to copy and use it for scim-node configuration.

  5. Use above all values to configure scim-node.

var config = {
  keyAlg: 'XXXXX', // Algorithm type.
  domain: 'https://example.com/', // Gluu server URL.
  privateKey: 'final-private-key.key', // Value can be buffer or path of private key.
  clientId: '@!XXXX.XXXX.XXXX.XXXX!XXXX!XXXX.XXXX!XXXX!XXXX.XXXX', // scim_rp_client's client id.
  keyId: '000xx0x0-xx00-00xx-xx00-0x000x0x000x', // JWKS key id.
};

var scim = require('scim-node')(config);

Methods

| Method | Description | |---------|-------------| |scim.scim2.getUsersCount(callback)| Get total number of users.| |scim.scim2.getUsers(startIndex, count, filter, callback)| Get users records. | |scim.scim2.searchUsers(filter, startIndex, count, callback)| Extra search to get users records| |scim.scim2.getUser(id, filter, callback)| Get the user by id. | |scim.scim2.addUser(userData, callback)| Add the user. | |scim.scim2.removeUser(id, callback)| Delete the user. | |scim.scim2.editUser(id, userData, callback)| Update the details of user. | |scim.scim2.getGroupCount(callback)| Get total number of groups. | |scim.scim2.getGroups(startIndex, count, filter, callback)| Get groups records. | |scim.scim2.getGroup(id, filter, callback)| Get the groups by id. | |scim.scim2.addGroup(groupData, callback)| Add the group. | |scim.scim2.editGroup(id, groupData, callback)| Update the details of group. | |scim.scim2.removeGroup(id, callback)| Delete the group. |

Example

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 |

License

(MIT License)

Copyright (c) 2016-2019 Gluu