DS Server

POST /admin/authenticationservers

Endpoint

POST https://example.com/admin/authenticationservers

Description

Adds a new authentication server, as Register on the Authentication page of the admin portal does. The endpoint was added in DS Server 3.1.0.

DS Server doesn't check the values: it neither requires the fields nor validates the URL or contacts the server.

Examples

The following sample registers the DS Server instance at https://ds2.example.com as an authentication server.

# Request:
curl --request POST 'https://trial.dsserver.io/admin/authenticationservers' \
    --header 'Authorization: Basic YWRtaW46YWRtaW5hZG1pbg==' \
    --header 'Content-Type: application/json' \
    --data-raw '{
            "name": "Server 2",
            "serverUrl": "https://ds2.example.com"
        }'

# Result:
1

Authorization

This endpoint supports the Basic authorization method:

Basic

Header fieldDescription
AuthorizationThe username "admin" and your admin password are combined into a string separated by a colon, e.g.: admin:password. The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line. The authorization method and a space i.e. "Basic " is then put before the encoded string. For example: Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

Request Payload

TypeValue
AuthenticationServerThe AuthenticationServer object contains the name and the URL of the authentication server.

AuthenticationServer

NameTypeValueOptional
nameStringA user friendly name for the authentication server.yes
serverUrlStringThe base URL of the DS Server instance, for example https://ds2.example.com. DS Server appends the paths of the endpoints it calls, such as /oauth/validatetoken.yes

Success Response

StatusDescription
200On success, the HTTP status code in the response header is 200 (OK). The return value is the new ID of the added authentication server.

Error Response

StatusDescription
401A 401 (Unauthorized) is returned, if the user is not authorized.
400A 400 (Bad Request) is returned, if the body is missing or isn't valid JSON. The body is the JSON string "Requst body cannot be empty." (spelled this way by DS Server).
415A 415 (Unsupported Media Type) is returned, if the Content-Type header isn't application/json.