Skip to content

stormpath-community/node-stormpath

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stormpath API wrapper library for node.js

node-stormpath aims to provide a complete library for accessing the Stormpath API

build status

** THIS IS STILL A WORK IN PROGRESS. API MAY CHANGE **

Requirements

  • node v0.8+ (may work with v0.6 but no guarantees)

Install

  • npm install node-stormpath

Getting started

  1. Install Stormpath from npm (npm install node-stormpath).
  2. Get API ID and Secret from your Stormpath install.
  3. Generally you will be interacting with one Tenant in Stormpath, so you want to make a simple call to grab your current Tenant info.
'use strict';

var c, options, Tenant = require('node-stormpath').Tenant

options = {
  apiId: "<API ID>"
  , apiSecret: "<API Secret>"
}

c = new Client(options)

c.getCurrentTenant(function(err, ten) {
  if (err) console.log(err)
  else { console.log("Tenant id is: " + ten.id) }
})
  1. Also depending on your application you may only require one application, in which case you can modify the above script to grab all your Applications located in your Tenant
'use strict';

var c, options, Tenant = require('node-stormpath').Tenant

options = {
  apiId: "<API ID>"
  , apiSecret: "<API Secret>"
}

c = new Client(options)
c.getCurrentTenant(function(err, ten) {
  if (err) console.log(err)
  else { 
    console.log("Tenant id is: " + ten.id)
    ten.getApplications(function(err, apps) {
      if (err) console.log(err)
      else {
        apps.forEach(function(app) {
          console.log(app.id, "::", app.getData('name'), "::", app.getData('href'), "::", app.getData('status'))
        })
      }
    })
  }
})

Contributors

TODO

  • Handle iterating over offset/limit until it exhausts the resource record
  • Rethink way to grab new resource URIs
  • More tests

CHANGELOG

0.0.9

  • Added support for registrationWorkflowEnabled

0.0.8

  • Added support for emailVerificationToken
  • Body parameter should only be value of json iff method is POST

0.0.7

  • Fixed Abstract.create not passing in an id
  • Fixed passwordResetTokens to allow a token to be passed through!

0.0.6

  • Have createGroupMembership return a clearer error message when the account or group is invalid or does not exist
  • Fixed some tests

0.0.5

  • Added GroupMembership functionality into Application

0.0.4

  • Added verifyAccount in Application to handle having to make 2 calls to retrieve a verified user's account information.

0.0.3

  • Fix request not causing correct data to be passed for POST calls
  • Turned redirects back on (/current/tenants was not properly sending the correct redirect location)

0.0.2

  • Basic support for expand
  • Bugfixes

0.0.1

  • Initial verison

About

API Wrapper for Stormpath in node.js

Resources

Stars

Watchers

Forks

Packages

No packages published