Authentication messages

The following schemas represent the request and response messages used by the authentication service.

Login

The authentication service exposes a login operation. The following pair of schemas defines the request and response messages it deals with.

Request

The request schema represents a login request message that allows us to validate a user's credentials, and is coded as follows:

{
    "$schema": "http://json-schema.org/draft-03/schema#",
    "$content_type": "application/vnd.ccm.login.req.v1+json",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "username": {
            "type":"string",
            "required": true
        },
        "password": {
            "type":"string",
            "required": true
        }
    }
}

Response

The response schema represents the response to a login request, including a token that can be used to perform authenticated operations, and is coded as follows:

{
    "$schema": "http://json-schema.org/draft-03/schema#",
    "$content_type": "application/vnd.ccm.login.res.v1+json",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "success": {
            "type":"boolean",
            "required": true
        },
        "authentication_token": {
            "type":"string",
            "required": true
        }
    }
}

Logout

Another operation exposed by the authentication service is logout. The following two schemas represent the request and response messages the logout operation works with.

Request

A logout request message is defined by the following schema:

{
    "$schema": "http://json-schema.org/draft-03/schema#",
    "$content_type": "application/vnd.ccm.logout.req.v1+json",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "authentication_token": {
            "type":"string",
            "required": true
        }
    }
}

Response

The following schema represents the response after a logout operation has been attempted:

{
    "$schema": "http://json-schema.org/draft-03/schema#",
    "$content_type": "application/vnd.ccm.logout.res.v1+json",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "success": {
            "type":"boolean",
            "required": true
        }
    }
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.249.92