Endpoint /admin/securityprofiles

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

POST

Adds a new security profile.

Examples

The following example adds a new security profiles with given information.

# Request:
curl --location --request POST 'https://trial.dsserver.io/admin/securityprofiles' \
    --header 'Authorization: Basic YWRtaW46YWRtaW5hZG1pbg==' \
    --header 'Content-Type: application/json' \
    --data-raw '{
            "name": "My security profile",
            "clientCredentials": {
                "id": "GHGGHGD6766",
                "secret": "GHZUZW441543HJUKUU",
                "authorizedRedirectUris": [ 
                    "https://trial.dsserver.io/oauth/redirect" 
                ],
                "allowClientCredentialsGrantType": false
            }
        }'

# Result:
7

Authorization

This endpoint supports the Basic authorization method:

Basic

Header Field Description
Authorization

The 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

Type Value
SecurityProfile The SecurityProfile object contains information about the security profile.

SecurityProfile

Name Type Value Optional
name String A user friendly name for the security profile no
allowClientCredentialsGrantType Boolean Specifies whether the client credentials grant type is activated or not. yes
expiryDate DateTime An expiry date for the security profile. When omitted, the security profile doesn't expire. yes
clientCredentials ClientCredentials The ClientCredentials object contains OAuth client credentials for the security profile. yes

ClientCredentials

Name Type Value Optional
id String The ClientID of the security profile. no
secret String The ClientSecret of the security profile. no
authorizedRedirectUris String[] An array of authorized redirect URIs. no

Success Response

Status Description
200 On success, the HTTP status code in the response header is 200 (OK). The return value is the new ID of the added security profile.

Error Response

Status Description
401 A 401 (Unauthorized) is returned, if the user is not authorized.
400 A 400 (Bad Request) is returned, if the given ID exists already.
400 A 400 (Bad Request) is returned, if the security profile could not be added.