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:
-
Production: https://auth.civicsource.com/
-
Development: https://auth-stage.azurewebsites.net/
📝 The Mailhouse API falls under the civicsource-administrator application’s permission scope.
Auth Token ¶
Retrieve an access tokenPOST/token
Example URI
POST https://auth-stage.azurewebsites.net/token
Request
Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"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"
}
}
}