Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Authentication API

Tim Morgan edited this page Jan 26, 2015 · 1 revision

There is a special authentication resource available at /authentications.

This endpoint could be used to implement a Single Sign-On (SSO) system.

You must first authenticate to the API as a super user using HTTP basic auth.

Details

Required parameters:

  • authentication[email]
  • authentication[password]

Possible return values are:

  • 201, authenticated person as xml
  • 401, unauthorized (incorrect password)
  • 404, not found (email address not found)
  • 400, bad request – bad api authentication or not a super user

Curl Example

curl -u superuser@example.com:APIKEY http://example.com/authentications -F authentication[email]=user@example.com -F authentication[password]=password

ActiveResource Example

require 'rubygems'
require 'active_resource'

class Authentication < ActiveResource::Base
  self.site = 'http://example.com'
  self.user = 'superuser@example.com'
  self.password = 'APIKEY'
end

auth = Authentication.new
auth.email = 'user@example.com'
auth.password = 'password'
auth.save