REST API  4.0.0
REST API for SafeNet Network HSMs
POST /api/lunasa/hsms/{hsmid}/login

POST /api/lunasa/hsms/{hsmid}/login

Logs in to the HSM.

Parameters

hsmid

The serial number of the HSM of interest

Use: Required

JSON Schema:

   Object
   type: string

password

The password for authentication if password-based HSM

Use: Required

JSON Schema:

   Object
   type: string

ped

The identifier of the PED connected to the HSM. '0' is local PED; 1 or greater is remote PED. For remote PED, ped corresponds to the PED identifier. The parameter has no use for password-based HSMs.

Use: Required

JSON Schema:

   Object
   type: string

role

The security function to login on the HSM

Use: Required

JSON Schema:

   Object
   type: string

response

The response to provide to the HSM for indirect login

Use: Required

JSON Schema:

   Object
   type: string

Responses

204

Success

Location

"Location" is the URL to the HSM role logged onto and is returned in the server response. You can use "Location" to form a GET resource to query the HSM role.

see GET /api/lunasa/hsms/{hsmid}/roles/{roleid}


For PED-based HSMs, "Location" is the URL to the task spawned to log into the HSM.

400

Unexpected error

404

HSM does not exist.

Example Requests

Direct Login

   POST 
   https://1.2.3.4:8443/api/lunasa/hsms/154704/login
   {"ped": "0", "password": "myPassword", "role": "so"}


Indirect Login

   POST 
   https://1.2.3.4:8443/api/lunasa/hsms/151256/login
   {"response": "qlpLRuWfzCpyYkji4YguJSlpkvr9ZTq/NB5ymFPnLxc="}

Example Result

password-based HSM:
{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/api/lunasa/hsms/154704/login/so/1', 'Content-Length': '2', 'Access-Control-Allow-Credentials': 'true'}

PED-based HSM
{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/tasks/2', 'Content-Length': '712', 'Access-Control-Allow-Credentials': 'true'}

{}