Getting Started with Stormpath

What is Stormpath?

Stormpath is a cloud Identity and Access Management service that automates user management and security for your applications.  Using Stormpath, an application can easily and safely automate user authentication, access control, and common security workflows like Password Reset and Account Email Verification.

Stormpath secures user credentials with military-grade encryption and security best-practices so you never need to worry about managing passwords again.  If you have existing identity systems, we have you covered there too - Stormpath integrates with LDAP and Active Directory, even if they are behind a corporate firewall.

Stormpath is a highly available clustered service that can easily handle millions of user accounts.  It is accessible via a web UI console or REST+JSON API for developers.  If you don't want to use the REST+JSON API directly, there are supported API client libraries for Ruby, PHP, and the JVM (Java, Scala, etc), with more languages on the way.

Quickstarts

A set of quick, simple tutorials to help you connect to the Stormpath API, register your application and start securely authenticating users.

Product Guide

comprehensive guide to Stormpath IAM and its key features and functions.

Sample Code

Our java sample app covers Stormpath's basic features. Download and play with the code to see how Stormpath can work for you.

Developer SDKs

SDKs for PHP, Ruby and Java help you implement Stormpath user management quickly. C#, Node.js, and Python coming soon.

REST API Reference

Our handy reference guide covers each public REST endpoint, what operations can be run against it, and how to use it.

Stormpath on IRC (Real-Time Chat)

Our engineers and support team are logged into IRC channel during the day (PST). Point your favorite IRC client at irc.mibbit.net:6667 and join #stormpath or simply click here to connect to the Stormpath IRC-channel.

You can also click the "Contact us" button (below, to the right) to chat or leave a message.

Quickstart Guides

Stormpath's Quickstart guides are short, simple guides to help you get started using Stormpath API and Admin Console.

Connect to the Stormpath REST API

This guide shows how to succesfully communicate with the Stormpath REST API.

Register Your Application

Automate security features for your application by registering it with Stormpath.

Authenticate an Account

Learn how to authenticate your application users with the Stormpath REST API.

 

Sign Up for Stormpath

Before you can use Stormpath, you must first sign up for the service.  Sign-up and Developer-tier usage is 100% free, and no credit card is required.

To Sign Up

  1. In the upper right corner of this page, enter your email address and then click the orange "Sign Up Now" button.  This will send you a confirmation email.

  2. Click the link in the confirmation email.

  3. Follow the onscreen instructions.

After completing this process, you are ready to use Stormpath for free!

Get an API Key

If you need to make REST API requests to Stormpath, those requests must be authenticated with an API Key.

API keys are personally assigned to you and only you and should never be shared with anyone else, not even co-workers (co-workers should have their own API Keys if they need to communicate with Stormpath).

Here's how you get an API Key:

  1. Login to the Stormpath Web UI Console, using the email address and password you used during sign-up.

  2. After logging in, visit your account page by clicking on your name in the upper right-hand corner of the screen:

    Click on your name to access your account page

  3. On the resulting Account Details page, click the 'Create API Key' button about halfway down:

    Click Create API Key

    This will generate your API Key and download it to your computer as an apiKey.properties file. If you open the file in a text editor, you will see something similar to the following:
    apiKey.id = 144JVZINOF5EBNCMG9EXAMPLE
    apiKey.secret = lWxOiKqKPNwJmSldbiSkEbkNjgh2uRSNAb+AEXAMPLE
    
  4. Save this file in a very private place! In your home directory in a hidden .stormpath directory is a good choice. For example, in 

    $HOME/.stormpath/apiKey.properties

  5. Also change the file's permissions to ensure this file is readable by you and only you.  For example (on *nix operating systems):

    $ chmod go-rwx $HOME/.stormpath/apiKey.properties

Connect to the Stormpath REST API

This quickstart guide will help you connect to Stormpath's REST API quickly.

  1. If you haven't already, Sign Up for Stormpath for free.

  2. Ensure you have your own API Key.

  3. Test that the key works by opening a client (like a web browser window) and using the following URL:

    https://api.stormpath.com/v1/tenants/current/

    Use the API Key id as the username and the API Key secretas the password.

    For example, if using curl:

    curl --user YOUR_API_KEY_ID:YOUR_API_KEY_SECRET --header "Accept: application/json" https://api.stormpath.com/v1/tenants/current

    or perhaps httpie (which assumes application/json by default):

    http -a YOUR_API_KEY_ID:YOUR_API_KEY_SECRET https://api.stormpath.com/v1/tenants/current 

If you see a successful JSON response for your Tenant data, you've successfully made an API request!

You are now ready to make REST requests to access all of your data via our full REST API.

Connecting with Stormpath SDK

To test the connection via one of the Stormpath SDK's you will need to create a Client instance with your API key, and retrieve your current tenant.

The following examples assume the user already has the specific SDK installed.

Using Java SDK:
(The Java SDK documentation is here: https://github.com/stormpath/stormpath-sdk-java/wiki)

 
import com.stormpath.sdk.client.*; 
... 
String path = System.getProperty("user.home") + "/.stormpath/apiKey.properties"; 
//assuming that the apiKey.properties file with your Stormpath API key was saved in this location with read access
Client client = new ClientBuilder().setApiKeyFileLocation(path).build();
Tenant tenant = client.getCurrentTenant();

Using Ruby SDK:
(The Ruby SDK documentation is here: https://github.com/stormpath/stormpath-sdk-ruby/wiki)

 
require "stormpath-sdk"
include Stormpath::Client
...
api_key_file = '/home/myhomedir/.stormpath/apiKey.yml' 
#assuming that the apiKey.yml file with your Stormpath API key (in YAML format) was saved in this location with read access
client = ClientBuilder.new.set_api_key_file_location(api_key_file).build
tenant = client.current_tenant

Using PHP SDK:
(The PHP SDK documentation is here: https://github.com/stormpath/stormpath-sdk-php/wiki)

 
$path = '/home/myhomedir/.stormpath/apiKey.yml'; 
//assuming that the apiKey.yml file with your Stormpath API key (in YAML format) was saved in this location with read access
$builder = new Services_Stormpath_Client_ClientBuilder;
$client = $builder->setApiKeyFileLocation($path)->build(); 
$tenant = $client->getCurrentTenant();

Configuring a REST Client

If you are NOT using one of the official Stormpath SDKs, you will need to configure your rest client for authentication and also to accept JSON content.

Depending on your REST library or client, you accept JSON typically by setting the Accept header with a value of application/json:

Accept: application/json

This ensures that the Stormpath API Server will respond with JSON data.

Once your REST client can authenticate and accept JSON, you will be able to access all of your data via our full REST API.

Register Your Application

This guide shows how to register an application with Stormpath.  Registering an application quickly enables Stormpath's full user management features and security workflows for that application.

This guide assumes that you have already signed up for Stormpath.

Register your Application with Stormpath

  1. Login into the Stormpath web UI console.  If you do not have a Stormpath account, please sign up or ask your existing Stormpath administrator to give you access.

  2. After logging in, Click on the top-level "Applications" button and then click "Register Application":

    Register your application, step 2

  3. Complete the Register Application wizard:

    1. Wizard step 1. Details: Enter your application's name and optional description:

      Register your application, step 3a

    2. Wizard step 2. Directories: Choose one or more directories with user accounts that will log in to your application.  You must choose at least one directory, and you can create directories later.  In this getting started guide, we'll just choose the 'Stormpath Administrators' directory for simplicity.  

      Register your application, step 3b

    3. Wizard step 3. Groups: If you do not want an entire directory to be able to log in, you can configure specific groups within directories instead.  We'll just choose 'all  users' (representing all users in a Directory) in this example.

      Register your application, step 3c

    4. Wizard step 4. Confirm: Confirm your settings and click 'Finish'.

      Register your application, step 3d

    5. Your application is now registered! You will see it listed in the resulting Applications listing page

      Register your application, step 3e

Congratulations!  You have registered your first application in Stormpath.  

You will probably want to make sure users can log in to your application.  Feel free to try that next:

Authenticate an Account

Authenticate a User Account

This guide shows you how to use Stormpath to log in (authenticate) your application's user accounts.

To authenticate users in an application, it is assumed that you have already:

  1. Signed-up for Stormpath.
  2. Ensured you can connect to the Stormpath REST API with your API Key.
  3. Registered your Application within Stormpath and know its REST URL.
  4. Assigned one or more Login Sources to your Application.  Assigning login sources (entire directories or groups within a directory) to an application defines its user base.

Contents

Authentication Overview

When you use Stormpath's REST API (via cURL, httpie, or one of our wrapper SDKs) to authenticate your application's user accounts, the basic flow is as follows:

  1. Collect your end-user's plaintext username (or email) and password.
  2. Base64-encode the user-submitted data.
  3. Post the Base64-encoded data over SSL to your application's loginAttempts REST URL.

loginAttempts REST URL

Your application's loginAttempts URL is the application's Stormpath REST URL with /loginAttempts added to the end.  For example, if your application's Stormpath REST URL is:

https://api.stormpath.com/v1/applications/dRvH4y0nT6uNl6gEXAMPLE

then your application's login attempts URL is the following:

https://api.stormpath.com/v1/applications/dRvH4y0nT6uNl6gEXAMPLE/loginAttempts

This loginAttempts URL will be referenced in the instructions below.

1. Collect the submitted username (or email) and password

When your user logs into your application, they submit their username (or email address) and password directly to you.  For example, they might visit https://www.myAwesomeApplication.com/login, fill out a username/password form, and hit 'submit'.

Collect the user's submitted username (or email address) and password.  These are the raw text values submitted by your application's end user.  You can collect them in any way you wish (web form, mobile interface, desktop application, etc).  

Web applications MUST collect usernames/emails and passwords over HTTPS to ensure security.  (e.g. https://myapplication.com/login).  DO NOT use http for collecting login information.

2. Base64 encode the user-submitted data

Concatenate the username, the colon character ':', and the raw text password into a String.  Get the String's UTF-8 bytes, and then Base64 encode the bytes.  For example:

byte[] bytes = getUTF8Bytes( usernameOrEmailString + ":" + rawPasswordString)
String encoded = base64Encode( bytes )

This encoded value will be used in the next step.

3. POST a Login Attempt

After constructing the encoded value above, send an HTTP POST it to the application's loginAttempts URL with the following JSON body (don't forget to set the Accept and Content-Type headers!):

POST /v1/applications/dRvH4y0nT6uNl6gEXAMPLE/loginAttempts
Accept: application/json
Content-Type: application/json
  
{
  "type": "basic",
  "value": "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
} 
  • The type property indicates the type of authentication being performed.  This must equal basic. Additional authentication types will be supported in the near future.
  • The value property holds the encoded value from Step 2. 

If the login attempt is successful, a 200 OK response will be returned with a link to the successfully authenticated Account:

Example Login Attempt success response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "account": {
    "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02bAb" 
  }
}

If the login attempt fails, a 400 Bad Request will be returned with an error payload explaining the details of why the attempt failed:

Example Login Attempt failure response:

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
 
{
  "status": 400,
  "code": 400,
  "message": "Invalid username or password.",
  "developerMessage": "Invalid username or password.",
  "moreInfo": "mailto:support@stormpath.com"
}

For more information, see the complete LoginAttempt REST API documentation.

Authenticate a User Account with cURL

  1. Base64 encode the user's submitted username (or email), colon character ':', and password.  For example, on *nix:

    $ echo 'account_username:account_password' | openssl base64
    YWNjb3VudF91c2VybmFtZTphY2NvdW50X3Bhc3N3b3JkCg==

  2. Use your API Key ID and Secret and the base64 value and POST to your application's loginAttempts URL:

    curl --user API_KEY_ID:API_KEY_SECRET \
           -H "Accept: application/json" \
           -H "Content-Type: application/json"
           -d '{"type": "basic", \
           "value":"
    YWNjb3VudF91c2VybmFtZTphY2NvdW50X3Bhc3N3b3JkCg=="}' \
           
    https://api.stormpath.com/v1/applications/APP_UID/loginAttempts

Authenticate a User Account with httpie

  1. Base64 encode the user's submitted username (or email), colon character ':', and password.  For example, on *nix:

    $ echo 'account_username:account_password' | openssl base64
    YWNjb3VudF91c2VybmFtZTphY2NvdW50X3Bhc3N3b3JkCg==

  2. Use your API Key ID and Secret and the base64 value and POST to your application's loginAttempts URL:

    $ http -a API_KEY_ID:API_KEY_SECRET POST \
      
    https://api.stormpath.com/v1/applications/APP_UID/loginAttempts \
        type=basic value=YWNjb3VudF91c2VybmFtZTphY2NvdW50X3Bhc3N3b3JkCg==

Authenticate a User Account with Java

This example assumes you are using the Stormpath Java SDK.

Use your application's REST URL as the href variable value:

import com.stormpath.sdk.client.*;
import com.stormpath.sdk.ds.*;
import com.stormpath.sdk.application.*;
import com.stormpath.sdk.account.*;
import com.stormpath.sdk.authc.*;
...

String userHome = System.getProperty("user.home");
String path = userHome + "/.stormpath/apiKey.properties";
Client client = new ClientBuilder().setApiKeyFileLocation(path).build();
DataStore dataStore = client.getDataStore();

String href = "https://api.stormpath.com/v1/applications/APP_UID_HERE";
Application application = dataStore.getResource(href, Application.class);

// when the account is authenticated, it produces an AuthenticationResult
String un = "usernameOrEmail"; //get from form
String pw = "password"; //get from form
AuthenticationRequest request = new UsernamePasswordRequest(un,pw);
AuthenticationResult result = application.authenticateAccount(request);

// from the result instance we get the authenticated Account
Account account = result.getAccount();

Authenticate a User Account with Ruby

This example assumes you are using the Stormpath Ruby SDK.

Use your application's REST URL as the href variable value:

require "stormpath-sdk"
include Stormpath::Client
include Stormpath::Resource
include Stormpath::Authentication
...

api_key_file = '/home/myhomedir/.stormpath/apiKey.yml'
client = ClientBuilder.new.set_api_key_file_location(api_key_file).build

href = 'https://api.stormpath.com/v1/applications/APP_UID_HERE'
application = client.data_store.get_resource href, Application

# when the account is authenticated, it produces an AuthenticationResult
request = UsernamePasswordRequest.new 'usernameOrEmail', 'password'
result = application.authenticate_account request

# from the result, we obtain the authenticated Account
account = result.get_account

Authenticate a User Account with PHP

This example assumes you are using the Stormpath PHP SDK.

Use your application's REST URL as the $href variable value:

$path = '/home/myhomedir/.stormpath/apiKey.yml';
$builder = new Services_Stormpath_Client_ClientBuilder;
$client = $builder->setApiKeyFileLocation($path)->build(); 

$href = 'https://api.stormpath.com/v1/applications/APP_UID_HERE';
$ds = $client->getDataStore();
$application = $ds->getResource($href, Services_Stormpath::APPLICATION);

// when the account is authenticated, it produces an AuthenticationResult
$un = 'usernameOrEmail';
$pw = 'rawPassword';
$req = new Services_Stormpath_Authc_UsernamePasswordRequest($un,$pw);
$authResult = $application->authenticateAccount($req);

// from the result, we obtain the authenticated Account
$account = $authResult->getAccount();

Product Guide

The Stormpath Product Guide is comprehesive guide to our Identity and Access Management (IAM) product and its key features and functions.

Stormpath Basics

A high-level overview of Stormpath IAM and its key concepts.

Managing Directories

Create and manage directories of user accounts. 

Managing Applications

Register and manage applications that use Stormpath IAM.

Managing User Accounts

Add and manage user accounts in your Stormpath directories.

Managing Groups and Roles

Create and manage user groups and roles, as well as their member accounts.

Stormpath Basics

Contents

Key Concepts and Definitions

Account - Sometimes called 'users', an Account is more specifically a unique identity within a Directory.  Stormpath does not call these Users because the word 'user' usually implies a person. Accounts however can also represent 3rd-party software or non-human clients.  But you can essentially think of an account as Stormapth's 'User' concept.  Accounts may be used login to Applications.

API Key - A unique ID paired with a very secret value. The ID + the secret together are an API Key. API Keys are used by software applications to communicate with Stormpath IAM via the Stormpath REST API.

Application - A software application that can communicate with Stormpath.  This is usually your real world application that you are building, such as a web application, but it can also be infrastructural software, like a unix machine or web server.

Authentication - the act of proving someone (or something) is actually who they say they are.  When you authenticate an account, you have a high degree of certainty that the account identity is legitimate.

Authorization - (aka Access Control): the process of managing and enforcing access to protected resources, functionality or behavior.

Directory - A collection of accounts and groups. Administrators can use different directories to create silos of accounts. For example, you might store your customers in one directory and your employees in another.

Directory Agent - A Stormpath software application that you install in your corporate network to securely synchronize an on-premise Directory like LDAP or Active Directory into a Stormpath Cloud Directory.

Directory Mirroring - Securely replicating selected data from one directory (called the source directory) into another directory (the 'target' or 'mirrored' directory) for the purposes of authentication and access control. The source directory is the authoritative source for all data. Changes are propagated to the target/mirror directory for convenience and performance benefits.

Group - A collection of accounts within a directory.  In Stormpath this serves the same purpose of a 'Role' for those familiar with Role-Based Access Control.

IAM - Identity and Access Manager.  The name of the core Stormpath product, accessed via API or web console.

Identity Management - the management of individual identities, their authentication, authorization, and permissions to increase security and productivity and decrease cost, downtime, and repetitive tasks.

Login Source - A Directory or Group associated with an Application for the purpose of account authentication.  Accounts within Login Sources that are associated with an Application may login to that Application.

Role - A classification of accounts, like 'administrators' or 'employees'.  In Stormpath IAM, roles are represented as Groups.  There is no concrete role concept - the word 'Role' is effectively a synonym for 'Group' in Stormpath.

Role-Based Access Control (aka RBAC) - The act of controlling access to protected resources or behavior based the groups assigned to a particular account.  In Stormpath, the word 'Group' is used instead of 'role'.  You perform RBAC using Stormpath Groups. 

REST API - a software architectural style enabling data transfer and functionality via common web-based communication protocols. Stormpath provides a REST API for Tenants so they may easily integrate Stormpath with their own software applications.

Tenant - A private partition within Stormpath that contains all of your data and settings—namely your applications, directories, groups and accounts. When you sign up for Stormpath, a tenant is created for you. You can add other user accounts (for example, for your co-workers) to your tenant to help you manage your data. Many companies like to have one tenant where they can easily manage all of their applications, directories and accounts across their organization for convenience.

Architectural Overview

High-level Architecture

About the Administration Console

The Stormpath Administration Console allows authorized administrators to:

To access the Stormpath Administration Console, visit https://api.stormpath.com/login

About the REST API

The Stormpath API offers authorized developers and administrators programmatic access to:

  • Create and manage accounts and adjust their group and role membership

For more detailed documentation on the Stormpath API, visit the API Reference Documentation.

Managing Directories

Directories contain authentication and authorization information about users, groups and roles. Stormpath supports an unlimited number of directories. Administrators can use different directories to create silos of users. For example, you might store your customers in one directory and your employees in another.

A directory can be one of the following types:

  • Cloud Directory
    Cloud Directories are hosted by Stormpath and use the Stormpath data model to store user, group and role information. This is the most common type of directory in Stormpath.

  • Cloud LDAP Mirror 
    Stormpath provides a synchronization agent for your existing LDAP directory. All user management will be done on your existing LDAP directory but the cloud mirror can be accessed via the Stormpath APIs by your modern applications.

Once you have created a directory in Stormpath, you can map it to applications. Stormpath will then route an application's login requests to the directory. Modification of directory entities (users accounts, groups and roles) can be done via the Stormpath Administration Console or Stormpath REST API.

You can also map multiple directories to an application, providing the application with a single view of multiple directories in a specified order

Listing Directories

Directories managed by Stormpath can be listed through the console user interface or programmatically via API and SDKs.

Contents

Using the Console UI's Directory Browser:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' tab in the primary navigation bar.
  3. This will display the Directory Browser, showing all the directories that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Description', or 'Status'.

    A 'Disabled' directory cannot be used by any applications, regardless of whether or not they are mapped to it.

  4. To view or edit a directory's details, click on the directory's name or the 'Edit' link under the 'Actions' column.

The Stormpath Administrators directory is set up by default when you first signed up for Stormpath IAM. To add more directories, see Adding a Directory 

Screenshot: 'Directory Browser' 

Screenshot of Directory Browser

Using the REST API:

Example request:

 
GET https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW/directories

Example response:

 
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW/directories"
  "offset": 0,
  "limit": 25,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q"
    },
    {
      "href" : "https://api.stormpath.com/v1/directories/lIKeabOss8w9fJf0fJfb34"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/directories/Hfjks7kj9sfKfh9fhsPifa"
    }
  ]
}

Using the SDKs

To retrieve directories via one of the Stormpath SDK's you need to do the following:

  • Get the current tenant from a Client instance.
  • Get the directories from the current tenant.

Java SDK:

 
Tenant tenant = client.getCurrentTenant();
 
DirectoryList directories = tenant.getDirectories();
 
for (Directory directory : directories) {
    System.out.println("Directory " + directory.getName());
}
 

Ruby SDK:

 
tenant = client.current_tenant
 
directories = tenant.get_directories
 
directories.each do |dir|
   p 'Directory ' + dir.get_name
end

PHP SDK:

 
$tenant = $client->getCurrentTenant();
 
$directories = $tenant->getDirectories();
 
foreach ($directories as $directory) {
 
    echo 'Directory ' . $directory->getName();
}

Adding a Directory

Directories contain authentication and authorization information about users, groups and roles. Stormpath supports an unlimited number of directories

Stormpath supports the following types of directory:

  • Cloud Directory
    Cloud Directories are hosted by Stormpath and use the Stormpath data model to store user, group and role information. This is the most common type of directory in Stormpath.

  • Cloud LDAP Mirror
    Stormpath provides a synchronization agent for your existing LDAP directory. All user management will be done on your existing LDAP directory but the cloud mirror can be accessed via the Stormpath APIs by your modern applications.

You can add as many directories of each type as you need.

To add a directory,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' link in the top navigation bar.
  3. This will display the Directory Browser. Click the 'Create Directory' button.
  4. This will display the 'Select Directory Type' screen (see below). Click the button corresponding to the type of directory you want to add:

Once a directory has been configured, you can then map the directory to appropriate applications.


Screenshot: 'Select Directory Type' 

Select Directory Type

Creating a Cloud Directory

Cloud Directories are hosted by Stormpath and use the Stormpath data model to store user, group and role information. This is the most common type of directory in Stormpath.

Cloud Directories can be created via the Console UI or via the REST API.  SDKs do not yet support directory creation.

Contents

Using the Console UI:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' tab in the top navigation bar.
  3. This will display the Directory Browser. Click 'Create Directory' in the left-hand menu.
  4. Click the 'Cloud' button.
  5. Complete the fields as described in the table below.
  6. Click the 'Finish' button to complete the process.

Once you complete the creation process.  You can then map the directory to appropriate applications.

Screenshot: Create cloud directory 
Create cloud directory

Attributes

Description

Name

The name used to identify the directory within Stormpath IAM. This is useful when there are multiple directories configured, e.g. Employees or Customers. This value must be unique, i.e. it cannot be used by more than one directory.

Description

Details about this specific directory.

Status

'Enabled' by default.  Only set to 'Disabled' if you wish to prevent all user accounts in the directory from authenticating even where the directory is set as a login source to an application.

Min Characters

The minimum number of characters an account's password can have in this directory.

Max Characters

The maximim number of characters an account's password can have in this directory.  

Mandatory Characters

TThe required character patterns which new passwords will be validated against. For example, for an alphanumeric password of at least 8 characters with at least one lowercase and one uppercase character, you would select the following options:

abc, ABC, 123

The more patterns selected the more secure the passwords but the more complicated for a human user.

Using the REST API

Example request:

POST https://api.stormpath.com/v1/directories
Content-Type: application/json
 
{
  "name" : "Captains",
  "description" : "Captains from a variety of stories"
}

Example response:

HTTP/1.1 201 Created
Location: https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q",
  "name" : "Captains",
  "description" : "Captains from a variety of stories",
  "status" : "enabled",
  "tenant" : {
  "href" : "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW"
  },
  "accounts" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/accounts"
  },
  "groups" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/groups"
  }
}

Setting up a Cloud LDAP Mirror

Stormpath provides a synchronization agent for your existing LDAP directory. This Agent sits in your corporate network in order to communicate with your LDAP Directory Services and then makes calls out to Stormpath. User management will be done on your existing LDAP directory but the cloud mirror can be accessed via the Stormpath APIs by your applications.

To setup an LDAP directory Agent,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' link in the top navigation bar.
  3. This will display the Directory Browser. Click the 'Create Directory' button.
  4. The 'Select Directory Type' screen will appear. Click the 'LDAP' button.
  5. The 'Directory Basics' step will appear. Complete the fields as described in the table below.

    Screenshot 1: Directory details 
    Ldap Directory Configuration

    Attribute

    Description

    Name

    The name used to identify the directory within Stormpath IAM. This is useful when there are multiple directories configured, e.g. Employees or Customers.

    Description

    Details about this specific directory.

    Status

    'Enabled' by default.  Only set to 'Disabled' if you wish to prevent all accounts in the directory from authenticating even where the account is set as a login source to an application

    After completing this form click the 'Next.'

  6. This will display the 'Agent Configuration' screen. Fill in the basic connection formation for your directory server. 

    Screenshot 2: Agent details 
    Ldap Agent Configuration

    Attribute

    Description

    Directory Host

    The domain portion of the URL to use when connecting to the directory server. This domain must be accessible to the Agent, e.g. behind any firewall that may exist.

    Directory Port

    The port to use when connecting to the directory server.

    Example: 10389 for ldap, 10689 for ldaps, however your directory server maybe configured differently.

    Use SSL

    Specifies whether the connection to the directory server is an SSL connection.

    Agent User DN

    The Distinguished Name of the user the Agent should authenticate as when communicating with the directory server.

    Example: cn=admin,cn=users,dc=ad,dc=acmecorp,dc=com

    Agent Password

    The password of the user user specified above.

    Base DN

    The root Distinguished Name to use when running queries agains the directory server.

    Directory Services Poll Interval

    The time interval that the Agent will wait before subsequent pollings of the directory service to check for new/updated information.

    Configuring LDAP Object and Attribute Settings

    You can specify various LDAP object and attribute settings of the specific LDAP server for users and groups as shown on the screenshots below. 

    If your Agent's status is Online but you are unable to see any data when browsing your LDAP mapped directory, it is likely that your object and filters are configured incorrectly.

    After completing this form click the 'Next.'

  7. This will display the 'Account Configuration' screen. Fill in the configuration details for your user accounts. 

    Screenshot 3: Account configuration 
    LDAP Account Configuration

    Attribute

    Description

    Account DN

    This value is used in addition to the base DN (distinguished name) when searching and loading users as ccounts. An example is ou=people. If no value is supplied, the subtree search will start from the base DN.

    Account Object Class

    This is the name of the class used for the LDAP user object. Example: person.

    Account Email Attribute

    The attribute field to use when loading the user's email address. Example: email.

    Account First Name Attribute

    The attribute field to use when loading the account's first name.  Example: givenname.

    Account Middle Name Attribute

    The attribute field to use when loading the account's middle name. Example: middlename.

    Account Last Name Attribute

    The attribute field to use when loading the account's last name. Example: sn.

    Account Username Attribute

    The attribute field to use when loading the account's username. Example: uid.

    Account Password Attribute

    The attribute field to use when loading the account's password. Example: password.

    Account Object Filter

    The filter to use when searching user objects.

    After completing this form click the 'Next.'

  8. This will display the 'Group Configuration' screen. Fill in the configuration details for your groups. 

    Screenshot 4: Group configuration 

    LDAP Group Configuration

    The Stormpath LDAP Agent assumes that all container objects (groups and roles) have the full DN to the associated member. 

    Attribute

    Description

    Group DN Suffix

    This value is used in addition to the base DN when searching and loading roles. An example is ou=Roles. If no value is supplied, the subtree search will start from the base DN.

    Group Object Class

    This is the name of the class used for the LDAP group object. Example: group.

    Group Name Attribute

    The attribute field to use when loading the role's name. Example: cn.

    Group Description Attribute

    The attribute field to use when loading the role's description. Example: desc.

    Group Members Attribute

    The attribute field to use when loading the role's members. Example: member.

    Group Object Filter

    The filter to use when searching for role objects. Exampe: (objectclass=group).

    After completing this form click the 'Next.'

  9. This will display the 'Confirm' screen.  Review and confirm your configuration data.

    Screenshot 5: Review and Confirm

    LDAP Review and Confirm

  10. Click the 'Create Directory' button to complete the creation process.
  11. Download and install Agent. 

    Screenshot 6: Download and Install Agent

    LDAP Agent Download and Install

    The agent.id and agent.key values will be specific to this directory's Agent.

After you've created an LDAP backed directory in the Stormpath Console and installed the Stormpath LDAP Agent, synchronization of your directory's data will begin once you start the Agent.

Disabling or Deleting a Directory

Disabling a directory prevents any of its accounts from logging into any applications connected to Stormpath IAM but retains the directory's data and all of its group, role, and account data. You would typically disable a directory if you need to shut off a large group of accounts quickly and easily.

Deleting a directory completely erases the directory and all of its group, role, and account data from Stormpath.  

Disabling instead of Deleting

We recommend that you disable a directory rather than delete it, in case an associated application contains historical data associated with accounts in the directory.

Disabling a Directory

To disable a directory,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' tab in the primary navigation bar.
  3. This will display the Directory Browser, showing all the directories that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Description', or 'Status'.
  4. Click on the 'Disable' button under the 'Actions' column.

All of that directory's accounts will now be unable to log into any applications connected to Stormpath.

Screenshot: Disabling an application
Disable a Directory

Deleting a Directory

To delete a directory,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' tab in the primary navigation bar.
  3. This will display the Directory Browser, showing all the directories that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Description', or 'Status'.
  4. Click on the 'Delete' button under the 'Actions' column.
    A directory can only be deleted if it is not mapped to any applications.

The directory will be erased from Stormpath IAM and will no longer appear in the Directory Browser.  In turn, its accounts, groups, and roles will also be erased from Stormpath IAM.

Screenshot: Deleting a directory 

Managing Workflow Automations

Workflows are common user management operations that are automated for you by Stormpath IAM.  Configurations for workflow automations are applied at the directory level.

To configure a workflow automation:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' tab in the top navigation bar.
  3. This will display the Directory Browser.  Click 'Workflows' tab in the secondary navigation bar.

Currently there are two available workflows:

Workflow Automation Configuration Home

Account Registration and Verification Workflow

Account Registration and Verification workflow configurations manage how accounts are created in your directory.

To configure the 'Registration and Verification' workflow:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' tab in the top navigation bar.
  3. This will display the Directory Browser.  Click 'Workflows' tab in the secondary navigation bar.
  4. This will display the 'Workflow Automations' screen.  Find the 'Registration and Verification' workflow.

There are three options for the workflow:

  1. Workflow disabled: An account is simply added and enabled in Stormpath IAM via the Console.
  2. Workflow enabled: An account is added and enabled in Stormpath IAM via the Console and a successful registration email is sent to email address of the newly created account.
  3. Workflow enabled with Verification: An account is added but not enabled in Stormpath IAM via the Console.  An Account Verification request email is sent to the user. Once the account is verified, it is enabled and the user sent a Verification Success message.

Configuration for the various emails when this workflow is enabled are described below.

Account Registration Success Configuration

When this workflow is enabled but email verification is not required, the configuration is as follows:

Screenshot: Account Registration Success Configuration

Account Registration Success Configuration

ATTRIBUTE

DESCRIPTION

Message Format

The message format for the body of the Account Registration Success email, either Plain Text or HTML. Available formats depend on your Tenant's Subscription Level.

"From" Name

The value to display in the "From" field of the Account Registration Success message.

"From" Email Address

The email address from which the Account Registration Success message will be sent.

Subject

The value for the subject field of the Account Registration Success message.

Body

The value for the body of the message.

Variable substitution is supported for the following:

  • The account's first name
  • The account's last name
  • The account's username
  • The account's email
  • The name of the directory in which the account is registered

Account Registration with Verification Configuration

When account email verification is required, a new account is only enabled once the account holder has verified his/her email.

Screenshot: Requiring account verification

Account Registration Workflow with Verification

When this workflow is enabled and email verification is required, there are two email messages to configure.

Account Verification Message

Screenshot: Account Verification Configuration

Account Verification Configuration

ATTRIBUTE

DESCRIPTION

Account Verification Base URL

Your application URL that receives the token and completes the workflow.

Message Format

The message format for the body of the Account Verification email, either Plain Text or HTML. Available formats depend on your Tenant's Subscription Level.

"From" Name

The value to display in the "From" field of the Account Verification message.

"From" Email Address

The email address from which the Account Verification message will be sent.

Subject

The value for the subject field of the Account Verification message.

Body

The value for the body of the message.

Variable substitution is supported for the following:

  • The account's first name
  • The account's last name
  • The account's username
  • The account's email
  • The name of the directory in which the account is registered
  • The url that the user must  click to verify their account

Verification Success Message

When the new user verifies his/her email address, the account is marked as enabled in Stormpath IAM and the user receives a Verification Success Message, as configured below:

Screenshot: Account Verification Success Configuration

Account Verification Success Configuration

ATTRIBUTE

DESCRIPTION

Message Format

The message format for the body of the Account Verification Success email, either Plain Text or HTML. Available formats depend on your Tenant's Subscription Level.

"From" Name

The value to display in the "From" field of the Account Verification Success message.

"From" Email Address

The email address from which the Account Verification Success message will be sent.

Subject

The value for the subject field of the Account Verification Success message.

Body

The value for the body of the message.

Variable substitution is supported for the following:

  • The account's first name
  • docs attributes
  • The account's last name
  • The account's username
  • The account's email
  • The name of the directory in which the account is registered

Password Reset Workflow

The Password Reset Worflow Automation configuration determines what your users will see if they have forgotten their login information.

To configure the 'Password Reset' workflow:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Directories' tab in the top navigation bar.
  3. This will display the Directory Browser.  Click 'Workflows' tab in the secondary navigation bar.
  4. This will display the 'Workflow Automations' screen.  Find the 'Password Reset' workflow.

When a user triggers this workflow from the Login page s/he will receive and email message with a link that will allow them to reset their password. Upon successful password reset, the user will receive a second email indicating the reset was successful. You can configure, at the directory level, how these emails will appear to your users. 

Basic Configuration

ATTRIBUTE

DESCRIPTION

Base URL

Your application URL that receives the reset token and completes the workflow.

Expiration Window

The number of hours that the token remains valid from the time it's sent.

Password Reset Message Configuration

Screenshot: Password Reset Message Configuration

Password Reset Message Configuration

ATTRIBUTE

DESCRIPTION

Message Format

The message format for the body of the Password Reset email, either Plain Text or HTML. Available formats depend on your Tenant's Subscription Level.

"From" Name

The value to display in the "From" field of the Password Reset message.

"From" Email Address

The email address from which the Password Reset message will be sent.

Subject

The value for the subject field of the Password Reset message.

Body

The value for the body of the message.

Variable substitution is supported for the following:

  • The account's first name
  • The account's last name
  • The account's username
  • The account's email
  • The name of the directory in which the account is registered
  • The url that the user must  click to verify their account
  • The number of hours for which the ${url} is valid

Password Reset Successful Message

Screenshot: Password Reset Success Configuration

Password Reset Success Configuration

ATTRIBUTE

DESCRIPTION

Message Format

The message format for the Password Reset Successful email, either Plain Text or HTML. Available formats depend on your Tenant's Subscription Level.

"From" Name

The value to display in the "From" field of the Password Reset Successful message.

"From" Email Address

The email address from which the Password Reset Successful message will be sent.

Subject

The value for the subject field of the Password Reset Successful message.

Body

The value for the body of the message.

Variable substitution is supported for the following:

  • The account's first name
  • The account's last name
  • The account's username
  • The account's email
  • The name of the directory in which the account is registered

Directory REST URL

When communicating with the Stormpath REST API, you might need to reference a Directory via it's REST URL (aka href), for example, so you can create Accounts in it. The simplest way to find the href is to view the Directory's details screen:

To obtain a directory's REST URL,

1.  Log in to the Stormpath Administration Console

2.  Click the 'Directories' tab in the top navigation bar and then click the directory's name:

Choose Directory

3.  This will display the 'Directory Details' screen. The directory's REST URL (aka href) is the first property listed:

Stormpath Directory REST URL href

Managing Applications

An application in Stormpath IAM represents a real world application that can communicate with and can by provisioned by Stormpath. Once defined, an application is mapped to one or more directories, groups, or roles, whose users are then granted access to the application. 

When you first create your tenant in Stormpath IAM, an application 'Stormpath IAM' is added by default and listed on your Application Browser.  You can control access to your Stormpath Console and API by managing the Login Sources for the 'Stormpath IAM' application listed. 

To add more directories, see Adding an Application

Using the Application Browser

The Application Browser allows you to view and search for integrated applications.

To use the Application Browser,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Applications' tab in the top navigation bar.
  3. This will display the Application Browser, showing all the applications that exist in your Stormpath tenant.

    A 'Disabled' application cannot authenticate any user accounts

  4. To view or edit a application's details, click on the application's name or the 'Edit' link under the 'Actions' column.


Screenshot: Application Browser 
Application Browser Screenshot

Adding an Application

Before you start

Before adding the application, consider whether you need to add your directories, accounts, and groups.

To add an application:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Applications' tab in the top navigation bar.
  3. This will display the Application Browser. Click 'Register Application' button.
  4. This will display the first screen for the 'Register Application' wizard for Stormpath. Complete the fields as described in the table below.

    Screenshot:Application Details 

    Adding an Application: Details

    Attribute

    Description

    Name

    The name used to identify the application within Stormpath. This value must be unique, i.e. it cannot be used by more than one application.

    Description

    A short description of the application. Note: A URL for the application is often helpful.

    Status

    'Enabled' by default. Only set to 'Disabled' if you wish to turn off the application's ability to log in accounts.


    After completing this form, click the 'Next' button to go to the 'Login Sources' step. 

  5. Step 2. Directories: Now select the directories that this application can use for authentication and authorization:

    Screenshot: Select Login Sources

    Adding an Application: Directories

    Click the relevant checkbox(es) to select one or more directories. 

    After completing this form, click the 'Next' button to go to 'Authorization' step. 

  6. Step 3. Groups: Determine the accounts that are authorized to access the application based on their group and role memberships.

    Screenshot: Select Groups and Roles for Authorization

    Adding an Application: Groups and Roles

    For each directory, you should do one of the following:

    • Either select 'All users', to grant application access to all accounts defined in the directory.
    • Or, select 'Only specific groups' to narrow access down to groups and roles you explicitly set.  Then select the groups you wish to have access, and click 'Add Group' to add each group to the list. 

      If your directory does not have any groups or roles then you will not see a choice. "All users" will be set by default.

      To remove a group from the list after adding it, click the 'remove' link that will appear next to the authorized groups' names.

    After completing this form, click the 'Next' button to go to the 'Confirm' step.

  7. Step 4. Confirm: Now confirm the details for your application.

    Screenshot: Confirm Application Data

    Adding an Application: Confirmation

    Check the details of your application.

    • If you need to change anything, you can click the tabs to go back to one of the steps in the 'Register Application' wizard.
    • When you are happy with the details, click the 'Finish' button 

  8. After completing the 'Register Application' wizard, remember to configure the application to connect to Stormpath IAM

Disabling or Deleting an Application

Disabling an application prevents the applicatiom from logging in any accounts in Stormpath but retains all the application's configurations. You would typically disable an application if you need to temporarily turn off log-ins.

Deleting an application completely erases the application and its configurations from Stormpath.  

Disabling instead of Deleting

We recommend that you disable an application rather than delete it, if you believe you might use the application again.

Disabling an Application

To disable a application,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Application' tab in the primary navigation bar.
  3. This will display the Application Browser, showing all the applications that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Description', or 'Status'.
  4. Click on the 'Disable' button under the 'Actions' column.

The application will no longer be able to log in accounts.

Screenshot: Disabling an application
Disabling an Application

Deleting an Application

To delete an application,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Applications' tab in the primary navigation bar.
  3. This will display the Application Browser, showing all the applications that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Description', or 'Status'.
  4. Click on the 'Delete' button under the 'Actions' column.

The application will be erased from Stormpath IAM and will no longer appear in the Application Browser.  

Screenshot: Deleting an application 
Deleting an Application

Managing an Application's Login Sources

An application's login sources define its user base. Sometimes known as 'application provisioning', login sources determine which user account stores will be used when authenticating and authorizing an account's access request.  In Stormpath IAM, a directory, group, or role can be a login source for application.  At least one login source must be associated with an application in order for accounts to log in to that application.  

Multiple login sources may be configured for an application, but at least one is required for login.  This allows each of your applications to view multiple directories as a single repository during a login attempt.

To manage an application's login sources,

  1. Log in to the Stormpath Administration Console
  2. Click the 'Applications' tab in the top navigation bar
  3. This will display the Application Browser. Click on the target application's name
  4. This will display the 'Application Details' screen. Click the 'Login Sources' tab
  5. This will display a list of the application's login sources in order 

Screenshot: 'Application — Login Sources'

Application Login Sources

Adding a Login Source to an Application

Adding a login source to an application provisions a directory or group to that application.  By doing so, all of the login source's user accounts can now log into the application.   A login source can be a directory or group in Stormpath.

To add a login source to an application:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Applications tab in the top navigation bar.
  3. This will display the Application Browser.  Click on the target application's name. 
  4. This will display the 'Application Details' screen. Click the 'Login Sources' tab.
  5. This will display the 'Login Sources' screen. Click the 'Add Login Source' button.
  6. This will dispay the 'Add Login Source' screen.  You will see a drop down of all the available Directories you can choose from.  
  7. Upon selecting a directory, you will be given the option to narrow your Login Source definition to a specific group or role within that directory.  If you would like to limit the login source to a specific group or role then select that radio button.
  8. Once you have your login source properly defined click the 'Add Login Source' button.
  9. The new login source will be added to the bottom of the list of login sources.  You can drag and drop a login source higher or lower in the application's login source order.   

Screenshot: 'Add a Login Source' 

Login Sources

Specifying the Login Source Order for an Application

When you map multiple login sources to an application, you also need to define the login source order.

The login source order is important during the login attempt for a user account, in cases where the same user account exists in multiple directories. When a user account attempts to log in to an application, Stormpath will search the listed login sources in the order you specified, and will use the credentials (password) of the first occurrence of the user account to validate the login attempt. See diagram below.

On this page:

Specifying the Login Source Order

To specify the login source order,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Applications tab in the top navigation bar.
  3. This will display the Application Browser.  Click on the target application's name. 
  4. This will display the 'Application Details' screen. Click the 'Login Sources' tab.
  5. This will display the 'Login Sources' screen and a list login sources in their current order.
  6. You can drag and drop a login source higher or lower in the application's login source order.   

Screenshot: Application Login Sources

Application Login Sources

How Login Attempts Works

The login source order is important during a user account's login attempt against a Stormpath integrated application.

Let's assume our application 'Foo', and has been mapped to two login sources, the 'Customers' and 'Employees' directories, in that order.

Here is what happens when a user attempts to log in to the 'Foo' application: 

Diagram: Login Attempt Flow 

Login Attempt Flow

Removing a Login Source from an Application

Removing a login source from an application deprovisions that directory or group from the application. By doing so, all of the login source's user accounts will no longer be able to log into that application.

To remove a login source from an application:

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Applications tab in the top navigation bar.
  3. This will display the Application Browser.  Click on the target application's name. 
  4. This will display the 'Application Details' screen. Click the 'Login Sources' tab.
  5. This will display the 'Login Sources' screen and a list of the application login sources in order.
  6. Find your target login source. Click the 'Remove' button under the 'Actions' column.

Screenshot - 'Remove a Login Source'

Remove a Login Source

Viewing User Accounts Mapped to an Application

The application 'Accounts' tab shows all the user accounts in all the login sources mapped to the selected application. You will also see basic information for each user account, including the account's full name, username, email address, and status. The user account's parent directory is also listed.

To see the users visible to an application,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Applications tab in the top navigation bar.
  3. This will display the Application Browser.  Click on the target application's name. 
  4. This will display the 'Application Details' screen. Click the 'Accounts' tab.

Screenshot: Viewing users for an application

Viewing users for an application

Application REST URL

When configuring an Application to communicate with Stormpath's REST API, you might need to configure the REST client with the Application's REST URL (aka href).  The simplest way to find the href is to view the Application's details screen:

To obtain an application's REST URL,

1.  Log in to the Stormpath Administration Console

2.  Click the 'Applications' tab in the top navigation bar and then click the application's name:

Choose Application

This will display the 'Application Details' screen.  The application's REST URL (aka href) is the first property listed:

Stormpath Application REST URL href

Managing Accounts

In Stormpath IAM, users are referred to as user accounts objects or just accounts. Accounts are unique within a directory and are used to log into applications.  Stormpath support an unlimited number of accounts per directory.

Using the Account Browser

The Account Browser allows you to view and search for accounts in Stormpath.

To use the Account Browser,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Accounts' tab in the primary navigation bar.
  3. This will display the Account Browser, showing all the Accounts that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Directory', 'Username', 'Email', or 'Status'.

    A 'Disabled' account cannot log into any application, regardless of whether or not they are mapped to it.

  4. To view or edit an account's details, click on the account's name or the 'Edit' link under the 'Actions' column.

Screenshot: 'Account Browser' 

Account Browser

Adding an Account

To add an account,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Accounts' link in the top navigation bar.
  3. This will display the Account Browser. Click the 'Create an Account' button.
  4. This will display the 'Create Account' screen. Complete the fields as described in the table below
  5. Click the 'Create Account' button to add the account

Creating an account will automatically initiate an Account Registration & Verifaction workflow that will send the account owner an email message. To suppress the email messages be sure to select the checkbox 'Suppress Registration and Verification emails'

After adding the account, you will be able to specify its group membership. And if the account will have administrator rights to Stormpath, you will also be to set their API keys.


Screenshot: 'Create Account' 

Create Account

Attribute

Description

Directory

The directory to which the account will be added.  Note that the account cannot be moved to a different directory once the account has been created.

Username

The account's login name for applications that using username instead of email.  The value must be unique within its parent directory. i.e. it cannot be used by more than one account.

First Name

The account owner's first name

Middle Name

The account owner's middle name

Last Name

The account owner's last name

Email

The account owner's email addres.  This is can be used for log in for applications that prefer email, like the Stormpath Administrator Console.  The value must be unique within its parent directory. i.e. it cannot be used by more than one account.

Status

'Enabled' by default. Only set to 'Disabled' if you deny access to the account to Stormpath connected applications.

Password

The account's credentials used during a login attempt.  This must adhere to the password policies set for the parent directory.

Confirm Password

Confirmation of the account's credentials.  This value must match the value of the 'Password' attribute above.

Disabling or Deleting a User Account

Disabling a user account prevents that account from logging into any applications in Stormpath IAM but retains all the account's information. You would typically disable an account if you need to temporarily remove access priviledges.

Deleting a user account completely erases the account from ita directory and erases all of the accounts information from Stormpath.  

Disabling instead of Deleting

We recommend that you disable a directory rather than delete it, in case some applications contain historical data associated with accounts in the directory.

Disabling accounts that resides in LDAP

For applications that need users to exist for historical data, you should recreate the account and mark it disabled in a Stormpath Cloud Directory before deleting from your LDAP directory.

Disabling an Account

To disable a Account,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Accounts' tab in the primary navigation bar.
  3. This will display the Account Browser, showing all the accounts that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Username', 'Email Address', 'Directory' or 'Status'.
  4. Click on the 'Disable' button under the 'Actions' column.

The account will no longer be able to log into applications.

Screenshot: Disabling an account
Disable an Account

Deleting an Account

To delete an account,

  1. Log in to the Stormpath Administration Console.
  2. Click the 'Accounts' tab in the primary navigation bar.
  3. This will display the Account Browser, showing all the accounts that exist in your Stormpath tenant. You can refine your search by specifying a 'Name', 'Username', 'Email Address', 'Directory', or 'Status'.
  4. Click on the 'Delete' button under the 'Actions' column.

The account will be erased from Stormpath IAM and will no longer appear in the Account Browser.  

Screenshot: Deleting an account 

Delete an Account

Managing Groups and Roles

Groups are collections of user accounts within a directory and are often used for authorization and access control in an application. In Stormpath, a group serves the same purpose of a role so the two terms are used interchangeably.

Using the Group Browser

The Group Browser allows you to search for and view existing groups and roles within a specified directory.

To use the Group Browser:

  1. Log in to the Stormpath Administration Console.
  2. Click 'Directories" and open the group’s parent directory.  See Using the Directory Browser for more information.
  3. Click on the ‘Groups’ tab.
  4. This will display the Group Browser, showing all the groups and roles that exist within the directory. You can refine your search by specifying a 'Name', 'Description', or 'Status'.
     A 'Disabled' group cannot be used by any applications, regardless of whether or not they are mapped to it.
  5. To view or edit a group's details, click on the group's name or the 'Edit' link under the 'Actions' column.

To add a new group or role, see Adding Groups and Roles

Screenshot: 'Group Browser' 

Group Browser

Adding a Group or Role

To add a group,

  1. Log in to the Stormpath Administration Console.
  2. Open the group’s parent directory.  See Using the Directory Browser for more information.
  3. Click on the ‘Groups’ tab.  Click the 'Create Group' button.
  4. Complete the fields as described in the table below, then click the 'Create' button.

    You can now add users to the new group.

Screenshot: 'Add Group'

Add a Group

  

Field

Description

Name

The unique name of the group. Within a given directory, the Name must be unique. Note that the Name cannot be changed once the group is created.

Description

A short description of the group.

Status

'Enabled' by default. Only set to 'Disabled' if you wish to prevent all user accounts in the group from logging into any application even when the group is set as a login source to an application. Note that if an account is also a member to another group that does have access to an application, then the account can login.

Disabling or Deleting Groups and Roles

If a group is explicitly set an application's login source, then disabling that group prevents any of its user accounts from logging into that application but retains the group's data and memberships. You would typically disable a group if you need to shut off a group of user accounts quickly and easily.

Deleting a group erases the group and all its membership relationships.  User accounts that are members of the group will not be deleted.

Disabling instead of Deleting

We recommend that you disable an group rather than delete it, if you believe you might need to retain the user data or application connection.

Disabling a Group

To disable a group:

  1. Log in to the Stormpath Administration Console.
  2. Open the group’s parent directory.  See Using the Directory Browser for more information.
  3. Click on the ‘Groups’ tab. 
  4. This will display the Group Browser, showing all the groups that exist in your directory. You can refine your search by specifying a 'Name', 'Description', or 'Status'.
  5. Click on the 'Disable' button under the 'Actions' column.

Screenshot: Disabling a group

Deleting a Group

To delete a group:

  1. Log in to the Stormpath Administration Console.
  2. Open the group’s parent directory.  See Using the Directory Browser for more information.
  3. Click on the ‘Groups’ tab. 
  4. This will display the Group Browser, showing all the groups that exist in your directory. You can refine your search by specifying a 'Name', 'Description', or 'Status'.
  5. Click on the 'Delete' button under the 'Actions' column.

    A group can only be deleted if it is not explicitly mapped to any applications.

The group will be erased from Stormpath IAM and will no longer appear in the Group Browser.

Screenshot: Deleting a group 

Managing Group and Role Members

To view the members of a group,

  1. Log in to the Stormpath Administration Console.
  2. Open the target group.  See Using the Group Browser for more information.
  3. Click on the ‘Accounts’ tab in the Group's secondary navigation.
  4. This will display a list of user accounts that are members of the group.  

Screenshot: Viewing the members of a group

 View members of a group

Adding an Account to a Group and Role

User accounts can be added to a group in two ways:

To add an account to a group from the account's settings:

  1. Log in to the Stormpath Administration Console.
  2. Click "Accounts" and open the target user account.  See Using the Account Browser for more information.
  3. Click on the ‘Groups’ tab.  Click the 'Assign Group' button.

To add an account to a group from the groups's settings:

  1. Log in to the Stormpath Administration Console.
  2. Click 'Directories" and open the group’s parent directory. Click to open the target group. See Using the Group Browser for more information.
  3. Click on the ‘Accounts’ tab.  Click the 'Assign Accounts' button.

Removing an Account from a Group or Role

User accounts can be removed from a group in two ways:

To remove an account from a group from the account's settings:

  1. Log in to the Stormpath Administration Console.
  2. Click "Accounts" and open the target user account.  See Using the Account Browser for more information.
  3. Click on the ‘Groups’ tab.  
  4. Find the target group and click the 'Remove' button in the 'Actions' column.

Screenshot 1: Remove a group from an account

Remove a group from an account

To remove an account from a group from the groups's settings:

  1. Log in to the Stormpath Administration Console.
  2. Click 'Directories" and open the group’s parent directory. Click to open the target group.  See Using the Group Browser for more information.
  3. Click on the ‘Accounts’ tab.  
  4. Find the target account and click the 'Remove' button in the 'Actions' column.

Screenshot 2: Remove an account from a group

Remove account from group

Developer SDKs

Developer SDKs make it easy for you to use the Stormpath API from your language or framework of choice. Below you'll find a list of officially supported that are tested against the latest version of the API. 

These libraries are open sourced under the business-friendly Apache Software License 2.0 and hosted on GitHub.

Java

  • stormpath-sdk-java - Official Java SDK for the Stormpath Identity and Access Manager REST+JSON API
  • stormpath-shiro - Official Stormpath integration for Apache Shiro

Ruby

  • stormpath-sdk-ruby - Official Ruby SDK for the Stormpath Identity and Access Manager REST+JSON API

PHP

  • stormpath-sdk-php - Offical PHP SDK for the Stormpath Identity and Access Manager REST+JSON API

Stay Tuned!  More SDKs are currently in development, as are several independent community projects. 

Sample Code

Java

Spring MVC Sample App - a Twitter clone that will help you implement Stormpath's core functionality. The example application shows Stormpath-based login, user registration, email verification, password reset, role/group assignments, role-based access control (RBAC) checks, and user profile updates.

Apache Shiro Sample Web App - A simple web application secured by the Apache Shiro security framework and Stormpath IAM.  The example is based of the standard Apache Shiro web sample application.  Shows login and role-bases access control (RBAC) using an authorization cache.

Ruby and PHP samples coming soon

OLD - REST API Reference

Stormpath provides developers a simple yet powerful ReST+JSON API enabling Identity and Access Management control for organizations and applications. 

 

 

 

Base URL

All URLs referenced in the API documentation begin with the following base URL:

This file has been depreceted. Please visit stormpath.com/docs

https://api.stormpath.com/v1

HTTPS Only

To help ensure data security, only HTTPS is allowed when communicating with the Stormpath API servers. HTTP is not supported.

Authentication

Every request to Stormpath's REST API must be authenticated with an API Key over HTTPS.   Please see our API Authentication section for more information, including requirements for configuring a REST client.

Resource Representation Format

Stormpath's REST API currently only supports JSON resource representations.  If you would like other formats supported, please email us and let us know!

Retrieving Resources with HTTP GET

Request

You can retrieve a resource representation by GETting its url. The easiest way to do this is to copy and paste a URL into your web browser's address bar.

An example API GET:

GET /v1/tenants/cJoiwcorTTmkDDBsf02AbA HTTP/1.1

Response

GET responses contain:

  • The HTTP Status Code: indicates general success or failure of the request.
  • HTTP Headers: various response headers will be set relevant to the particular request
  • Response Body: A successful request contains the requested entity resource representation. Failed requests will show an error representation.
Possible GET Response Status Codes
  • 200 OK: The request was successful and the response body contains the representation requested.
  • 302 FOUND: A common redirect response; you can GET the representation at the URI in the Location response header.
  • 304 NOT MODIFIED: Your client's cached version of the representation is still up to date.
  • 401 UNAUTHORIZED: Authentication credentials are required to access the resource.  All requests must be authenticated.
  • 403 FORBIDDEN: The supplied authentication credentials are not sufficient to access the resource.
  • 404 NOT FOUND: We couldn't locate the resource based on the specified URI.
  • 429 TOO MANY REQUESTS: Your application is sending too many simultaneous requests.
  • 500 SERVER ERROR: We couldn't return the representation due to an internal server error.
  • 503 SERVICE UNAVAILABLE: We are temporarily unable to service the request. Please wait for a bit and try again.

An example API GET response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA",
  "name": "My Tenant",
  "key": "myTenant"
}

Creating Resources with HTTP POST

You create a resource by submitting an HTTP POST to a resource URI. Any POST body must be represented as JSON.

Request

Request Body

Requests that contain body content MUST specify the HTTP Content-Type header with a value of application/json

An example Create POST request:

POST /v1/tenants/cJoiwcorTTmkDDBsf02AbA/applications HTTP/1.1
Content-Type: application/json

{
  "name": "Desired name",
  "description": "Desired description",
  "status": "enabled"
}

Response

Create POST responses contain:

  • The HTTP Status Code: indicates general success or failure of the request.
  • HTTP Headers: various response headers will be set relevant to the particular request
  • Response Body: A successful request contains the created entity resource representation.  Failed requests will show an error representation.
Possible Create POST Response Status Codes
  • 201 CREATED: The request was successful, we created a new resource, and the response body contains the representation.  TheLocation header contains the new resource's canonical URI.
  • 400 BAD REQUEST: The data given in the POST or PUT failed validation. Inspect the response body for details.
  • 401 UNAUTHORIZED: Authentication credentials are required to access the resource.  All requests must be authenticated.
  • 403 FORBIDDEN: The supplied authentication credentials are not sufficient to access the resource.
  • 404 NOT FOUND: We couldn't locate the resource based on the specified URI.
  • 405 METHOD NOT ALLOWED: POST is not supported for the resource.
  • 409 CONFLICT: You can't create or update a resource because another resource already exists or conflicts with one you are submitting.
  • 429 TOO MANY REQUESTS: Your application is sending too many simultaneous requests.
  • 500 SERVER ERROR: We couldn't create or update the resource. Please try again.
  • 503 SERVICE UNAVAILABLE: We are temporarily unable to service the request. Please wait for a bit and try again.

Example Create POST response:

HTTP/1.1 201 Created
Location: https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA
Content-Type: application/json;charset=UTF-8

{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA",
  "name": "Best application ever",
  "description": "Really.  The best application ever.",
  "status": "enabled",
  "tenant": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA"
  },
  "loginSources": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/loginSources"
  },
  "accounts": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts"
  }
}

Updating Resources with HTTP POST

If you want to update a resource, you submit an HTTP POST to a resource URI. Any POST body must be represented as JSON. You may submit one or more properties of a resource, but at least one property must be specified.

Request

Request Body

Requests that contain body content MUST specify the HTTP Content-Type header with a value of application/json

An example Update (HTTP POST) request, updating a single property:

POST /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA HTTP/1.1
Content-Type: application/json

{
  "name": "New name"
}

Notice that the post body in this particular example contains only a single JSON name/value pair, although Application resources have multiple name/value pairs.

Updates enable updating one or more resource property values. At at least one resource property value must be specified.

Response

Update POST responses contain:

  • The HTTP Status Code: indicates general success or failure of the request.
  • HTTP Headers: various response headers will be set relevant to the particular request
  • Response Body: A successful request contains the created entity resource representation. Failed requests will show an error representation.
Possible Update PUT Response Status Codes
  • 200 OK: The request was successful, we updated the resource, and the response body contains the resource's full representation..
  • 400 BAD REQUEST: The data given in the POST request body failed validation. Inspect the response body for details.
  • 401 UNAUTHORIZED: The supplied credentials, if any, are not sufficient to create or update the resource.
  • 403 FORBIDDEN: The supplied authentication credentials are not sufficient to access the resource.
  • 404 NOT FOUND: We couldn't locate the resource based on the specified URI.
  • 405 METHOD NOT ALLOWED POST is not supported for the resource.
  • 409 CONFLICT: You can't create or update a resource because another resource already exists or conflicts with one you are submitting.
  • 429 TOO MANY REQUESTS: Your application is sending too many simultaneous requests.
  • 500 SERVER ERROR: We couldn't create or update the resource. Please try again.
  • 503 SERVICE UNAVAILABLE: We are temporarily unable to service the request. Please wait for a bit and try again.

Example Update POST response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA",
  "name": "New name",
  "description": "Really.  The best application ever.",
  "status": "enabled",
  "tenant": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA"
  },
  "loginSources": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/loginSources"
  },
  "accounts": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts"
  }
}

Deleting Resources with HTTP DELETE

To delete a resource make an HTTP DELETE request to the resource's URL. Not all Stormpath REST API resources support DELETE.

Request

An example DELETE request:

DELETE /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA HTTP/1.1

Response

Possible DELETE Response Status Codes

  • 204 NO CONTENT: The request was successful; the resource was deleted. The deleted resource representation will not be returned.
  • 401 UNAUTHORIZED: The supplied credentials, if any, are not sufficient to create or update the resource.
  • 403 FORBIDDEN: The supplied authentication credentials are not sufficient to access the resource.
  • 404 NOT FOUND: We couldn't locate the resource based on the specified URI.
  • 405 METHOD NOT ALLOWED: DELETE is not supported for the resource.
  • 429 TOO MANY REQUESTS: Your application is sending too many simultaneous requests.
  • 500 SERVER ERROR: We couldn't create or update the resource. Please try again.
  • 503 SERVICE UNAVAILABLE: We are temporarily unable to service the request. Please wait for a bit and try again.

Example DELETE response:

HTTP/1.1 204 No Content

Collection Resources and Pagination

If you need to acquire more than one Resource Instance, you may interact with a Collection Resource which represents collections of one or more Instance Resources.

If a Collection Resource represents too many items, it will not return every item in its collection.  It will instead use a technique called Pagination where the results are broken up into one or more pages of data.  You can acquire additional pages as separate requests.

Collection Resource Properties

PropertyDescriptionType
href The Collection Resource fully qualified location URI String
offset The starting index in the entire Collection of the first collection item to return. Default is 0 (zero). Integer
limit The maximum number of collection items N to return for a single request. Minimum value is 1. Max is 100. Default is25. Integer
items An array containing the current response's collection items. The number of returned items may differ than the requestedlimit size. array

Request

To acquire a Collection Resource, submit an HTTP GET to the Collection Resource URI.

Query Parameters

There are two optional supported query parameters:

  • offset: This is the starting index in the entire Collection of the first collection element to return.  If unspecified, the default value is 0(zero).
  • limit: The maximum number of collection elements N to return for a single request.  Minimum value is 1. Max is 100. If unspecified, the default value is 25.

An example Collection Resource GET request:

GET /v1/tenants/cJoiwcorTTmkDDBsf02AbA/applications?offset=10&limit=40 HTTP/1.1

This particular example requests from the server a Tenant's Application Resource Collection with elements starting at index 10 (i.e. the 11th element), asking for a maximum of 40 total elements.

Response

Collection Resource GET responses contain:

  • The HTTP Status Code: indicates general success or failure of the request.
  • HTTP Headers: various response headers will be set relevant to the particular request
  • Response Body: A successful request contains the requested Collection Resource representation.  Failed requests will show an error representation.

Example Collection Resource response:

HTTP/1.1 200 OK
 
{
  "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA/applications?offset=10&limit=40"
  "offset": 0,
  "limit": 10,
  "items" : [
    { 
      ... Reference to Application 0 (the 1st element)... 
    },
    ...,
    {
      ... Reference to Application 9 (the 10th element) ...
    }
  ]
}

 

Resource References (aka Links)

ReST resources that reference other resources (such as an Account referencing its parent Directory) will represent them as a Resource Reference object. (A 'Resource Reference' is also known in some circles as a 'Link' or 'Link Relation').

A Resource Reference is:

  • A nested object contained within an existing Resource representation.
  • A complex object that has, at the minimum, an href property.

Resource Reference Properties

PropertyDescriptionType
href The referenced Resource's fully qualified location URI. String

Example Resource Reference in JSON:

{
  "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA"
}

Here is an example of this Resource Reference as a property of an existing Application JSON Resource:

{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA",
  "name": "New name",
  "description": "Really.  The best application ever.",
  "status": "enabled",
  "tenant": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA"
  },
  "loginSources": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/loginSources"
  },
  "accounts": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts"
  }
}

In this example, the tenantloginSources, and accounts properties are all Resource Reference properties.

Upon encountering a Resource Reference object, you can use its href property to interact with that resource as necessary.

Errors

ReST API responses indicating an error or warning will be represented by a proper response HTTP status code (404, 403, etc).  Additionally, a response body will be provided containing the following information:

Error Response Properties

PropertyDescriptionType
status The corresponding HTTP status code. Integer
code A Stormpath IAM specific error code that can be used to obtain more information. Integer
message A simple, easy to understand message that may be shown directly to the application end-user if desired. String
developerMessage A clear, plain text explanation with technical details that might assist a developer calling the Stormpath IAM API. String
moreInfo A fully qualified URL that may be accessed to obtain more information about the error. String

Example

Example request for a resource that does not exist

GET /v1/applications/thisApplicationDoesNotExist

Example response:

HTTP/1.1 404 Not Found

{
  "status": 404,
  "code": 404,
  "message": "Oops! The application you specified cannot be found.",
  "developerMessage": "The specified Application cannot be found.  If you accessed this url via a stale href reference, it might be helpful to acquire the tenant's Application Collection Resource to obtain the current list of applications.",
  "moreInfo": "http://www.stormpath.com/docs/errors/404"
}

HTTP Method Overloading

The Stormpath ReST API uses HTTP GETPOSTPUT and DELETE methods.  Because some HTTP clients do not support PUT and DELETEmethods, you can simulate them by sending a POST request to a resource endpoint with a _method query string parameter (the word 'method' is prefixed with the underscore character '_').  The parameter value can be 'DELETE' or 'PUT' (_method=DELETE or _method=PUT).

For example, if you want to delete a particular Application resource, you would ordinarily execute an HTTP DELETE request:

DELETE /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA

But if your HTTP client only supports GET and POST, you can send a POST request with the _method query string parameter:

POST /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA?_method=DELETE

REST API: Authentication

Every request to Stormpath's REST API must be authenticated with an API Key.  If you wish to make a REST request to Stormpath, we assume you have already:

  1. Signed up for Stormpath
  2. Downloaded your API Key.

Once you have an API Key, you can choose one of two ways to authenticate with Stormpath: either with HTTP Basic Authentication or Digest Authentication.

Security Notice

Any account that may access the Stormpath IAM application within the Stormpath web UI Console has full administrative access to your Stormpath data and settings, including access to the REST API if they have an API Key.

Assign user accounts to the Stormpath IAM application (via login sources) wisely.

HTTPS

To help ensure data security, only secure (HTTPS) communication is allowed when communicating with the Stormpath API servers.  Standard HTTP is not supported.

Basic Authentication over HTTPS

Most clients (including web browsers) present a dialog or prompt for you to provide a username and password for HTTP Basic Authentication.

When using an API Key with Basic authentication, the API Key id is the 'username' and the API Key secret is the 'password':

HTTP Basic username: apiKey.id value
HTTP Basic password: apiKey.secret value

For example, if using curl:

curl --user YOUR_API_KEY_ID:YOUR_API_KEY_SECRET --header "Accept: application/json" https://api.stormpath.com/v1/tenants/current

or perhaps httpie (which assumes application/json by default):

http -a YOUR_API_KEY_ID:YOUR_API_KEY_SECRET https://api.stormpath.com/v1/tenants/current 

Digest Authentication over HTTPS

Stormpath also supports a more secure authentication scheme known as digest authentication*. This approach computes a cryptographic digest of the request and sends the digest value along with the request.  If the transmitted digest matches what the Stormpath API server computes for the same request, the request is authenticated.  

This technique is especially secure because the API Key secret is never transmitted outside of the application, making it extremely difficult for anything (or anyone) outside of the application to interfere with a request or see the secret.

We recommend using Digest authentication whenever possible because it is inherently more secure.  However, due to its complexity, it may not be feasible for some projects.

All of the Stormpath SDKs use this more secure Digest authentication so we recommend that you use the SDKs whenever possible. However, if we do not yet have an SDK for your programming language of choice, we recommend that you use Basic Authentication over HTTPS.

Finally, if you would like to use Stormpath Digest authentication in a programming langauge that Stormpath does not yet support, you might wish to attempt to port the algorithm to that language.  You can try to replicate the algorithm and use Stormpath's existing code as examples to help:

Java: Sauthc1Signer (the sign method)
Ruby: Sauthc1Signer (the sign_request method)
PHP: Sauthc1Signer (the signRequest method)

If you port the algorithm to other language(s), please do let us know!  We're happy to help!  Email us at support -at- stormpath.com or say hi on IRC (irc.mibbit.net:6667 and join #stormpath) and we'll help as best as we can.

*Note: Stormpath's SAuthc1 digest algorithm is NOT the same as HTTP Digest authentication.  The Stormpath SAuthc1 digest-based authentication scheme is much more secure than standard HTTP Digest authentication.

REST API: Accounts

An Account is a unique identity within a Directory.  An account can exist in only a single Directory but may be a part of multiple Groups owned by that Directory

Quick Links

Account Instance Resource

Resource URI

/v1/accounts/:accountId

Resource Properties

PropertyDescriptionTypeValid value
href The resource fully qualified location URI String --
username The username for the Account. Must be unique across the owning Directory. If not specified, the username will default to the e-mail field String 1 < N <= 255 characters
email The e-mail address for the Account. Must be unique across the owning Directory. String 1 < N <= 255 characters
password The password for the Account. Only include this property if setting or changing the account password. String 1 < N <= 255 characters
givenName The given (first) name for the Account holder. String 1 < N <= 255 characters
middleName The middle (second) name for the Account holder. String 1 < N <= 255 characters
surname The surname (last name) for the Account holder. String 1 < N <= 255 characters
status Enabled Accounts are able to login to their assigned Applications. enum enabled,disabled
groups A link to the Groups that the Account belongs to. link --
directory A link to the owning Directory. link --
tenant A link to the Tenant owning the Directory the Group belongs to. link --

Supported Operations

The following operations are supported on an existing individual Application instance resource:

Read (HTTP GET)

HTTP GET returns a representation of an Account resources that includes the above properties.

Example request:

GET /v1/accounts/cJoiwcorTTmkDDBsf02AbA

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA",
  "username" : "jlpicard",
  "email" : "capt@enterprise.com",
  "givenName" : "Jean-Luc",
  "middleName" : "",
  "surname" : "Picard",
  "status" : "enabled",
  "directory" : {
    "href" : "https://api.stormpath.com/v1/directories/WpM9nyZ2TbaEzfbRvLk9KA"
  },
  "groups" : {
    "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA/groups"
  }
}


Update (HTTP POST)

Use HTTP POST when you want to change one or more specific properties of an Account resource. Unspecified properties will not be changed. At least one property must be specified.

Optional Properties

Example Request:

POST /v1/accounts/cJoiwcorTTmkDDBsf02bAb
Content-Type: application/json
 
{
  "username" : "jlpicard",
  "givenName" : "Jean-Luc",
  "surname" : "Picard",
}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA",
  "username" : "jlpicard",
  "email" : "capt@enterprise.com",
  "givenName" : "Jean-Luc",
  "middleName" : "",
  "surname" : "Picard",
  "status" : "enabled",
  "directory" : {
    "href" : "https://api.stormpath.com/v1/directories/WpM9nyZ2TbaEzfbRvLk9KA"
  },
  "groups" : {
    "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA/groups"
  }
}


Delete (HTTP DELETE)

Permanently deletes an Account resource.

Example request:

DELETE /v1/accounts/cJoiwcorTTmkDDBsf02bAb

Example response:

HTTP/1.1 204 No Content

Create (HTTP POST)

Creates a new Account resource instance within a specified Directory.

Resource URI
/v1/directories/:directoryId/accounts
Required Properties
Optional Properties

Example request:

POST /v1/directories/WpM9nyZ2TbaEzfbRvLk9KA/accounts
Content-Type: application/json
 
{
  "username" : "jlpicard",
  "email" : "capt@enterprise.com",
  "givenName" : "Jean-Luc",
  "surname" : "Picard",
  "password" : "uGhd%a8Kl!"	
}

Example response:

HTTP/1.1 201 Created
Location: https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA 
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA",
  "username" : "jlpicard",
  "email" : "capt@enterprise.com",
  "givenName" : "Jean-Luc",
  "middleName" : "",
  "surname" : "Picard",
  "status" : "enabled",
  "directory" : {
    "href" : "https://api.stormpath.com/v1/directories/WpM9nyZ2TbaEzfbRvLk9KA"
  },
  "groups" : {
    "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA/groups"
  }
}

Child Collection Resources

The following Collections are supported on an existing individual Account instance resource:

For more information on working with Collections please read their section in our General Concepts documentation.

Account Groups Collection

An Account Groups Collection Resource represents all Groups where a specific Account is a member.

Resource URI

/v1/accounts/:accountId/groups

 

List Account Groups (HTTP GET)

HTTP GET returns a Collection Resource containing links for all Groups where a specific Account is a member.

Example request:
GET /v1/accounts/cJoiwcorTTmkDDBsf02AbA/groups

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02AbA/groups"
  "offset": 0,
  "limit": 25,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ"
    },
    {
      "href" : "https://api.stormpath.com/v1/groups/sUcKIttrebEcKhgU86Kl0u"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/groups/Yu8ihas7HOpjHs3uhd7jGd"
    }
  ]
}

REST API: Applications

An Application instance resource represents a software application that is registered with (and communicates with) Stormpath IAM to for its own application-specific Identity and Access Management needs.  A Tenant may register one or more Applications with Stormpath IAM.

Quick Links

Application Instance Resource

Resource URI

/v1/applications/:applicationId

Resource Properties

PropertyDescriptionTypeValid value
href The resource fully qualified location URI String --
name Name of the application. Must be unique within a Tenant    String 1 < N <= 255 characters
description Application description String 0 < N <= 1000 characters
status Enabled applications accept logins from Accounts in assigned loginSources. Disabled applications deny logins. enum enabled,disabled
accounts A link to the Accounts that may log in to the application. This list is an aggregate view of all 
accounts in the application's assigned loginSources.
link --
tenant A link to the owning Tenant link --

Supported Operations

The following operations are supported on an existing individual Application instance resource:

New applications may be registered with Stormpath IAM by Creating an application instance resource via the Application Collection ResourceURI

Read (HTTP GET)

Returns a representation of an Application resource that includes the above resource properties.

Example request:

GET /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA",
  "name": "Best application ever",
  "description": "Really.  The best application ever.",
  "status": "enabled",
  "accounts": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts"
  }
  "tenant": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA"
  }
}


Update (HTTP POST)

Use HTTP Post when you want to change one or more specific properties of an Application resource.  Unspecified properties will not be changed.  At least one property must be specified.

Optional Properties

Example request:

POST /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA
Content-Type: application/json
 
{
  "description": "A new description."
}

Example response: 

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA",
  "name": "Best application ever",
  "description": "A new description.",
  "status": "enabled",
  "accounts": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts"
  },
  "tenant": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA"
  }
}

Delete (HTTP DELETE)

Permanently deletes a specific Application resource.

Example request:

DELETE /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA

Example response: 

HTTP/1.1 204 No Content


Create (HTTP POST)

Creates a new application instance within the caller's Tenant.

Resource URI
/v1/applications
Required Properties
  • name - must be unique across all of the Tenant's applications.
Optional Properties
Example request:
POST /v1/applications
Content-Type: application/json
 
{
  "name": "Best application ever",
  "description": "A new description.",
  "status": "enabled"
}

Example response: 

HTTP/1.1 201 Created
Location: https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA
Content-Type: application/json;charset=UTF-8 

{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA",
  "name": "Best application ever",
  "description": "A new description.",
  "status": "enabled",
  "accounts": {
    "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts"
  },
  "tenant": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA"
  }
}

Child Collection Resources

 The following Collections are supported on an existing individual Application instance resource:

For more information on working with Collections please read their section in our General Concepts documentation. 

Application Accounts Collection

An Application Accounts Collection Resource represents all Accounts that may log in to the application.

Resource URI 

/v1/applications/:applicationId/accounts

List Application Accounts (HTTP GET)

HTTP GET returns a paginated list of links for Accounts within a specified Application.

Example request:

GET /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts

Example response 

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/accounts"
  "offset": 0,
  "limit": 25,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02bAb"
    },
    {
      "href" : "https://api.stormpath.com/v1/accounts/tHEcAkeiSAlIe9sdh8KjdJda"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/accounts/Gu8oshf7HdsspjHs3uhd7jGd"
    }
  ]
}

Application Login Attempts Collection

The Application Login Attempts endpoint allows an Application to authenticate its associated Accounts.

Resource URI 

/v1/applications/:applicationId/loginAttempts

Login Attempt Resource Properties

PropertyDescriptionTypeValid value
type The type of the login attempt. The only currently supported type is basic. Additional types will likely be supported in the future. enum basic
value

The Base64 encoded username:plaintextPassword pair. For example, for username jsmith and plaintext password mySecretValue
this value property would be set to the following computed result:

base64_encode("jsmith:mySecretPassword");

The base64_encode method call is only an example. You will need to use whatever Base64 encoding method is available to you
in your chosen programming language and/or software frameworks. 

String Base64 encoded String

Execute Account Login Attempt (HTTP POST)

An HTTP POST authenticates an associated application Account.  Only HTTP POST is supported.

The POST body must be a JSON object with the above Login Attempt Resource Properties.

Example request:

POST /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/loginAttempts
Content-Type: application/json
 
{
  "type": "basic",
  "value": "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
} 

If the login attempt is successful, a 200 OK response will be returned with a link to the successfully authenticated Account:

Example Login Attempt success response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "account": {
    "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02bAb" 
  }
}

If the login attempt fails, a 400 Bad Request will be returned with an error payload explaining the details of why the attempt failed:

Example Login Attempt failure response:

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
 
{
  "status": 400,
  "code": 400,
  "message": "Invalid username or password.",
  "developerMessage": "Invalid username or password.",
  "moreInfo": "mailto:support@stormpath.com"
}

Application Password Reset Tokens Collection Resource

The Application Password Reset Tokens endpoint supports the password reset workflow for an Account in an Application's assigned login sources.

Creating a new Password Reset Token will automatically send a password reset email to the destination email address if that email corresponds to an account that can login to the corresponding application.

Resource URI 

/v1/applications/:applicationId/passwordResetTokens

Application Password Reset Token Resource Properties

PropertyDescriptionTypeValid value

href

Fully qualified URL of the Password Reset Token resource String -- 
email Email address of the account for which the password reset will occur.  String Valid email address. Required.
account A link to the Account for which the password reset will occur. Link Cannot set in a request. Returned in a response only.

Create Account Password Reset Token (Initiate password reset workflow) (HTTP POST)

A successful HTTP POST sends a password reset email to the first discovered Account associated with the corresponding Application.  The email recipient can then click on a password reset URL in the email to reset their password in a web form.

The POST body must be a JSON object with a single email property:

Example request:

POST /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/passwordResetTokens
Content-Type: application/json
 
{
  "email": "john.smith@stormpath.com"

Example response 

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
  
{
  "email" : "john.smith@stormpath.com"
  "account" : {
  }
}

A 200 OK response indicates that a password reset email will be sent as soon as possible to the email specified.  

If the password reset token creation fails, a 400 Bad Request will be returned with an error payload explaining the details of why the attempt failed:

Example Password Reset Token creation failure response:

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
  
{
  "status": 400,
  "code": 400,
  "message": "There is no account with that email address.",
  "developerMessage": "There is no account with the specified email address currently accessible to the specified application.",
  "moreInfo": "mailto:support@stormpath.com"
}

Read a Password Reset Token (Validate password reset token) (HTTP GET)

Reading a token resource successfully indicates the token is valid. If you obtained the token because the email recipient clicked a link into your application and it verifies successfully, you can assume the token is valid.

After verifying that the token is valid, you can then collect the account's new password (e.g. via a web form over HTTPS) and submit the new password as an Account update.

Example GET request:

GET /v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/passwordResetTokens/j6HqguWPSBSXM2xmcOUShw

Example success response (if token is valid):

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "href": "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA/passwordResetTokens/j6HqguWPSBSXM2xmcOUShw",
  "email": "john.smith@stormpath.com",
  "account": {
      "href": "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02bAb"
  }
}

If the Password Reset Token is invalid (e.g. never existed or has expired), a 404 Not Found response will be returned.

Example error response:

HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
  
{
  "status"404,
  "code"404,
  "message""The password validation link is not valid.  You might want to try to reset your password again.",
  "developerMessage""The specified password reset token does not exist.  It may have expired.  A new password reset token should be created to reset the account password.",
  "moreInfo""mailto:support@stormpath.com"
}

Receving a 404 from a Password Reset Token resource indicates the token is invalid and the end-user should not be asked to present a new password.  A new Password Reset Token should be constructed to initiate the password reset workflow.

REST API: Directories

A Directory is a named root-level container of Groups and Accounts within a Tenant

Quick Links

Directory Instance Resource

Resource URI

/v1/directories/:directoryId

Resource Properties

PropertyDescriptionTypeValid value
href The resource fully qualified location URI String --
name Name of the directory. Must be unique within a Tenant    String 1 < N <= 255 characters
description Directory description String 0 < N <= 1000 characters
status Enabled directories may be used as loginSources for Applications. Disabled directories cannot be used for login. enum enableddisabled
accounts A link to the Accounts owned by the Directory. link --
groups A link to the Groups owned by the Directory. link --
tenant A link to the owning Tenant link --

Supported Operations

The following operations are supported on an existing individual Directory instance resource:

Read (HTTP GET)

HTTP GET returns a representation of a Directory resource that includes the above resource properties.

Example request:

GET /v1/directories/bckhcGMXQDujIXpbCDRb2Q

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q",
  "name" : "Captains",
  "description" : "Captains from a variety of stories",
  "status" : "enabled",
  "accounts" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/accounts"
  },
  "groups" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/groups"
  },
  "tenant" : {
    "href" : "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW"
  }
}

Update (HTTP POST)

Use HTTP POST when you want to change one or more specific properties of a Directory resource.  Unspecified properties will not be changed.  At least one property must be specified.

Optional Properties

Example request:

POST /v1/directories/bckhcGMXQDujIXpbCDRb2Q
Content-Type: application/json
 
{
  "name" : "Captains",
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q",
  "name" : "Captains",
  "description" : "Captains from a variety of stories",
  "status" : "enabled",
  "tenant" : {
    "href" : "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW"
  },
  "accounts" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/accounts"
  },
  "groups" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/groups"
  }
}
Delete (HTTP DELETE)

Permanently deletes a specific a Directory resource.

Example request:

DELETE /v1/directories/bckhcGMXQDujIXpbCDRb2Q

Example response:

HTTP/1.1 204 No Content


Create (HTTP POST)

Creates a new Directory resource within the caller's Tenant.

Resource URI
/v1/directories
Required Properties
Optional Properties

Example request:

POST /v1/directories
Content-Type: application/json
 
{
  "name" : "Captains",
  "description" : "Captains from a variety of stories"
}

Example response:

HTTP/1.1 201 Created
Location: https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q",
  "name" : "Captains",
  "description" : "Captains from a variety of stories",
  "status" : "enabled",
  "tenant" : {
    "href" : "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW"
  },
  "accounts" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/accounts"
  },
  "groups" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/groups"
  }
}

Child Collection Resources

The following Collections are supported on an existing individual Directory instance resource:

For more information on working with Collections please read their section in our General Concepts documentation.

Directory Groups Collection

A Directory Groups Collection Resource represents all Groups owned by a specific Directory.

Resource URI

/v1/directories/:directoryId/groups

 

List Directory Groups (HTTP GET)

HTTP GET returns a Collection Resource containing links for all Groups owned by a specific Directory.

Example request:
GET /v1/directories/bckhcGMXQDujIXpbCDRb2Q/groups

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/groups"
  "offset": 0,
  "limit": 25,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ"
    },
    {
      "href" : "https://api.stormpath.com/v1/groups/sUcKIttrebEcKhgU86Kl0u"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/groups/Yu8ihas7HOpjHs3uhd7jGd"
    }
  ]
}

Directory Accounts Collection

A Directory Accounts Collection Resource represents all Accounts owned by a specific Directory.

Resource URI

/v1/directories/:directoryId/accounts


List Directory Accounts Applications (HTTP GET)

HTTP GET returns a paginated list of links for Accounts within a specified directory.

Example request:
GET /v1/directories/bckhcGMXQDujIXpbCDRb2Q/accounts

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q/accounts"
  "offset": 0,
  "limit": 25,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02bAb"
    },
    {
      "href" : "https://api.stormpath.com/v1/accounts/tHEcAkeiSAlIe9sdh8KjdJda"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/accounts/Gu8oshf7HdsspjHs3uhd7jGd"
    }
  ]
}
.
 

REST API: Groups

A Group is a named collection of Accounts within a Directory.  Groups may be used as Login Sources within Applications to control who may login to an Application.

Quick Links

Groups Instance Resource

Resource URI

/v1/groups/:groupId

Resource Properties

PropertyDescriptionTypeValid value

href

The resource fully qualified location URI. String --
name The name of the group. Must be unique within a Directory. String 1 < N <= 255 characters
description Group description String 1 < N <= 1000 characters
status Enabled groups are able to authenticate against an Application. Disabled groups cannot authenticate against an Application. enum enabled,disabled
tenant The Tenant that owns the Directory containing this group. link --
directory A link to the Directory resource that the group belongs to. link --
accounts A link to the Accounts that are contained within this group. link --

Supported Operations

The following operations are supported on an existing individual Group instance resource:

Read (HTTP GET)

HTTP GET returns a representation of a Group resource that includes the above resource properties.

Example request:

GET /v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ",
  "name" : "Aquanauts",
  "description" : "Sea Voyagers",
  "status" : "enabled",
  "directory" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q"
  },
  "tenant" : {
    "href" : "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW"	
  },
  "accounts" : {
    "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ/accounts" 
  }
}

Update (HTTP POST)

Use HTTP POST when you want to change one or more specific properties of a Group resource.  Unspecified properties will not be changed.  At least one property must be specified.

Optional Properties

Example request:

POST /v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ
Content-Type: application/json
 
{
  "description" : "Sea Voyagers"
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ",
  "name" : "Aquanauts",
  "description" : "Sea Voyagers",
  "status" : "enabled",
  "directory" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q"
  },
  "tenant" : {
    "href" : "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW"
  },
  "accounts" : {
    "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ/accounts"
  }
}

Delete (HTTP DELETE)

Permanently deletes a specific a Group resource.

Example request:

DELETE /v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ

Example response:

HTTP/1.1 204 No Content


Create (HTTP POST)

Creates a new Group resource instance in a specified Directory.

Resource URI
/v1/directories/:directoryId/groups
Required Properties
Optional Properties

Example request:

POST /v1/directories/bckhcGMXQDujIXpbCDRb2Q/groups
Content-Type: application/json
 
{
  "name" : "Aquanauts",
  "description" : "Sea Voyagers",
  "status" : "enabled"
}

Example response:

HTTP/1.1 201 Created
Location: https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ
Content-Type: application/json;charset=UTF-8
 
{
  "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ",
  "name" : "Aquanauts",
  "description" : "Sea Voyagers",
  "status" : "enabled",
  "directory" : {
    "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q"
  },
  "tenant" : {
    "href" : "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW"
  },
  "accounts" : {
    "href" : "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ/accounts" 
  }
}

Child Collection Resources

 The following Collections are supported on an existing individual Group instance resource:

For more information on working with Collections please read their section in our General Concepts documentation. 

Group Accounts Collection

A Group Accounts Collection Resource represents all Accounts that are members of a specific Group.

Resource URI 

/v1/groups/:groupId/accounts

List Group Accounts (HTTP GET)

HTTP GET returns a paginated list of links for Accounts within a specified Group.

Example request:

GET /v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ/accounts

Example response 

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/groups/ZgoHUG0oSoVNeU0K4GZeVQ/accounts"
  "offset": 0,
  "limit": 25,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/accounts/cJoiwcorTTmkDDBsf02bAb"
    },
    {
      "href" : "https://api.stormpath.com/v1/accounts/tHEcAkeiSAlIe9sdh8KjdJda"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/accounts/Gu8oshf7HdsspjHs3uhd7jGd"
    }
  ]
}
 

REST API: Tenants

Stormpath IAM is a Multitenant software service.  When you sign up for the Stormpath IAM service, a Tenant instance is created for you.  As a Stormpath IAM customer, you own your Tenant instance and everything you create in it - your Applications, Directories, Accounts, Groups, etc.  You may access and update your tenant information via the Tenant REST API.

Very soon, future updates to Stormpath IAM will allow you to create and manage Sub-tenants.  Customers with their own Multitenant software applications will find this useful for managing Subtenant identity infrastructure for their own customers.

Quick Links

Tenant Instance Resource

Resource URI

/v1/tenants/:tenantId

Resource Properties

PropertyDescriptionTypeValidation
href The resource fully qualified location URI String --
name Tenant name. Unique across all Tenants. String 1 < N <= 255 characters
key Human readable tenant key. Unique across all Tenants. String --
applications A link to the tenant's registered Applications. link --
directories A link to the tenant's registered Directories. link --

Supported Operations

The following operations are supported on an existing individual Tenant instance resource:

Create, Delete, and List are currently not supported.

Read (HTTP GET)

Returns a representation of a Tenant resource that includes the above resource properties.

Example request:

GET /v1/tenants/cJoiwcorTTmkDDBsf02AbA

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA",
  "name": "My Tenant",
  "key": "myTenant",
  "applications": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA/applications"
  },
  "directories": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA/directories"
  }
}

Read Current Tenant (HTTP GET)

Returns a 302 Redirect to the Tenant instance resource corresponding to the currently executing API caller.  In other words, this endpoint will redirect the API caller to the REST resource URI for their own tenant.

Example request:

GET /v1/tenants/current

Example response:

HTTP/1.1 302 Moved Temporarily
Location: https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA
Expires: 0
Cache-Control: no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform
Pragma: no-cache

Update (HTTP POST)

Use HTTP POST when you want to change one or more specific properties of a Tenant resource.  Unspecified properties will not be changed.  At least one property must be specified.

Optional Properties

Example request:

POST /v1/tenants/WpM9nyZ2TbaEzfbRvLk9KA
 
{
  "name": "New Name"
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
 
{
  "href" : "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA",
  "name" : "New Name",
  "applications": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA/applications"
  },
  "directories": {
    "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA/directories"
  }
}

Child Collection Resources

The following Collections are supported on an existing individual Tenant instance resource:

For more information on working with Collections please read their section in our General Concepts documentation.

Tenant Directories Collection

A Tenant Directory Collection Resource represents all Directories owned by a specific Tenant.

Resource URI

/v1/tenants/:tenantId/directories

 

List Tenant Directories (HTTP GET)

HTTP GET returns a Collection Resource containing links for all Directories owned by a specific Tenant.

Example request:
GET /v1/tenants/Gh9238fksJlsieJkPkQuW/directories

Example response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
 
{
  "href": "https://api.stormpath.com/v1/tenants/Gh9238fksJlsieJkPkQuW/directories"
  "offset": 0,
  "limit": 25,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/directories/bckhcGMXQDujIXpbCDRb2Q"
    },
    {
      "href" : "https://api.stormpath.com/v1/directories/lIKeabOss8w9fJf0fJfb34"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/directories/Hfjks7kj9sfKfh9fhsPifa"
    }
  ]
}

Tenant Applications Collection

A Tenant Application Collection Resource represents all Applications owned by a specific Tenant.

Resource URI

/v1/tenants/:tenantId/applications


List Tenant Applications (HTTP GET)

HTTP GET returns a Collection Resource containing links for all Applications owned by a specific Tenant.

Example request:
GET /v1/tenants/cJoiwcorTTmkDDBsf02AbA/applications

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
 
{
  "href": "https://api.stormpath.com/v1/tenants/cJoiwcorTTmkDDBsf02AbA/applications",
  "offset": 0,
  "limit": 10,
  "items" : [
    { 
      "href" : "https://api.stormpath.com/v1/applications/WpM9nyZ2TbaEzfbRvLk9KA"
    },
    {
      "href" : "https://api.stormpath.com/v1/applications/aLlyOUrBAse34js9hjiH9j"
    }, 
    {
      "href" : "https://api.stormpath.com/v1/applications/Xhf0a9HLA02djsdP90dsQ2"
    }
  ]
}
.