REST API - Authentication: POST Login

Description

SnapProtect REST APIs support token-based authentication via the Authtoken request header. The POST Login API is used to retrieve the authentication token. Once obtained, the authentication token must be inserted into the Authtoken header for all requests.

The authentication token expires after 30 minutes of inactivity.

Request

Syntax

XML

POST SearchSvc/CVWebService.svc/Login HTTP/1.1
Host: <web server host name>
Accept: application/xml
Content-type: application/xml

<DM2ContentIndexing_CheckCredentialReq mode="Webconsole" domain="" username="" password="" commserver="" />

JSON

POST SearchSvc/CVWebService.svc/Login HTTP/1.1
Host: <web server host name>
Accept: application/json
Content-type: application/json

{
  "DM2ContentIndexing_CheckCredentialReq":{
    "@mode":"Webconsole",
    "@domain":"",
    "@username":"",
    "@password":"",
    "@commserver":""
  }
}

Request Headers

Name Description
Host The host name of the web server.
Accept The format of the response. Valid values are: application/xml or application/json.
Content-type The media type contained in the request body. Valid values are: application/xml or application/json.

Request Body

An XML element or a JSON message is required. See Syntax. The following table displays the parameters for the request body.

Parameter Description Elements
mode This must equal Webconsole. DM2ContentIndexing_CheckCredentialReq
domain If the user logging in is a domain user, the domain parameter must be set to the domain associated with the user. DM2ContentIndexing_CheckCredentialReq
username The name of the CommCell Console user. DM2ContentIndexing_CheckCredentialReq
password A Base64 encoded password for the user. DM2ContentIndexing_CheckCredentialReq
commserver The option to log in to a remote CommServe. If this parameter is not used, the user is logged in to the CommServe associated with the Web Server.

Use the following values for the commserver parameter: commserve_host_name*commserve_name.

The CommServe host name and the CommServe name must be separated by an asterisk (*).

For example:

commserver="client.mydomain.com*testcs"

DM2ContentIndexing_CheckCredentialReq

Response

Response Parameters

Parameter Description Elements
aliasName The alias name. DM2ContentIndexing_CheckCredentialReq
userGUID The globally unique identifier for the user. DM2ContentIndexing_CheckCredentialReq
token The authentication token that must be inserted into the Authtoken header for all requests. DM2ContentIndexing_CheckCredentialReq
ccn An internal reference number. DM2ContentIndexing_CheckCredentialReq
userName The name of the CommCell Console user sent in the request. DM2ContentIndexing_CheckCredentialReq

Examples

Sample Request

XML

This request logs in to the CommServe associated with the Web Server.

POST SearchSvc/CVWebService.svc/Login HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Content-type: application/xml

<DM2ContentIndexing_CheckCredentialReq mode="Webconsole" username="admin" password="RkVSNTVXND0=" />

This request logs in to a remote CommServe.

POST SearchSvc/CVWebService.svc/Login HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Content-type: application/xml

<DM2ContentIndexing_CheckCredentialReq mode="Webconsole" username="admin" password="RkVSNTVXND0=" commserver="client.mydomain.com*testcs" />

JSON

This request logs in to the CommServe associated with the Web Server.

POST SearchSvc/CVWebService.svc/Login HTTP/1.1
Host: client.mydomain.com
Accept: application/json
Content-type: application/json

{
  "DM2ContentIndexing_CheckCredentialReq":{
    "@mode":"Webconsole",
    "@username":"admin",
    "@password":"RkVSNTVXND0"
  }
}

Sample Response

XML

<DM2ContentIndexing_CheckCredentialResp aliasName="1" userGUID="878A6149-65F9-424Z-80DF-92FCTESTF2D1" token="QSDK
38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexamples437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8"
ccn="0" userName="admin" />

JSON

{"DM2ContentIndexing_CheckCredentialResp":{"@aliasName":"1","@userGUID":"3A6C53F5-3FD0-4519-ADC6-D65TEST2EE43","@token":"QSDK 394164e2e20e800eacd1fcf4c4c2d09a173efbe4b0009e58f764edf574ba07433253d5e72dec61ca5e4f68
45940dd61e56c78f909007497bcd9cb7b489397fd5ea3a2a236f8bb898f6c963e34d92d66548b297283617
dff4d4532e365ebfe00529f0e5952fe98bb62ff0608f3d6aa8bf22ca333089e4a2c79f50a3fa3715b6a969
5836332275f213d865d43afd3f4b7d7f056f6bc3eb2ce9aca23dexample32cff27cce4dfab79c8f03a5095
bff43ca79ba69bf2bfd313be0f345ef9a597ad23eca45fe8952105fe998d76a7f1838214e0cad5f5fe44d0
399fe12c01664b5b4a065042bbfb9e123614f44d75d64c09770f6ace22b3592460c470b511999f3f6fe95c
12b9651f28947ba6dd390d1d13473","@ccn":"0","@userName":"admin","@capability":"4328784592895"}}