Back to top

CivicSource Single Sign-On API

Authentication

CivicSource and its APIs use Bearer token authorization. Before using any API which requires authorization, make a request to this API for a token, and include it as the token in an Authorization: Bearer <token> header.

📝 There are two instances of the auth service:

📝 The Mailhouse API falls under the civicsource-administrator application’s permission scope.

Auth Token

Retrieve an access token
POST/token

Example URI

POST https://auth-stage.azurewebsites.net/token
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "john.doe@gmail.com",
  "password": "a really strong password",
  "application": "civicsource-administrator"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "description": "The username of account used by the consuming application (e.g. Send)"
    },
    "password": {
      "type": "string"
    },
    "application": {
      "type": "string",
      "enum": [
        "civicsource-administrator",
        "civicsource-auctioneer"
      ],
      "description": "The application the account belongs to"
    }
  },
  "required": [
    "username",
    "password",
    "application"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "first.last",
  "email": "asdf@qwerty.com",
  "token": "J3Tj9W5k9fChF3t/cDwvcFJqN+NWEH9bGg=="
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "description": "The authenticated user's name"
    },
    "email": {
      "type": "string",
      "description": "The authenticated user's email address"
    },
    "token": {
      "type": "string",
      "description": "The token to be used in request authorization headers"
    }
  }
}

Generated by aglio on 27 Feb 2020