Skip to content
OpenIDM REST API client.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
lib
.gitignore
LICENSE
README.md
package.json

README.md

node-openidm

OpenIDM REST API Client.

Install

Install from npm:

$ npm install openidm

Preparing to use

var OpenIdm = require('openidm');

var openidm = new OpenIdm({
    host : 'localhost',
    port : 8080,
    userName : 'openidm-admin',
    password : 'openidm-admin'
});

Create Managed Object (POST)

var params = {
  '_id' : 'demiglacesource',
  'userName' : 'demiglacesource',
  'password' : 'P@ssw0rd',
  'mail' : 'demiglacesource@example.com',
  'givenName' : 'demiglace',
  'sn' : 'source',
  'phoneNumber' : '00000000000'
};

openidm.post('managed/user?_action=create', '', params, function(err, data) {
    if (err) {
        console.log("Error: " + err.message);
        console.log("Error: " + err.response.message);
        return ;
    }
    console.log(data);
});

Get Managed Object

openidm.get('managed/user/demiglacesource', function(err, data) {
    if (err) {
        console.log("Error: " + err.message);
        console.log("Error: " + err.response.message);
        return;
    }
    console.log(data);
});

Link

Something went wrong with that request. Please try again.