![]() |
REST API
16
REST API for Luna Network HSMs
|
This section contains the following information about authenticating to the webserver on the Luna Network HSM appliance using REST API:
REST API sessions store valuable information required to use the service. Two types of sessions are available:
To use basic authorization, you must include the following in the "Authorization" header:
Example: base64(admin:password123)
Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=
Certificate-based authorization requires you to upload a user certificate and perform a login handshake.
POST https://LUNAIPADDRESS:PORT/users/{userid}/certificates {"certificate": "-----BEGIN CERTIFICATE-----\n...{certificate}...\n-----END CERTIFICATE-----\n"}
POST https://LUNAIPADDRESS:PORT/auth/login/challenge { "username": "{username}", "certificate": "-----BEGIN CERTIFICATE-----\n...{certificate}...\n-----END CERTIFICATE-----\n" }The webserver responds with base64-encoded cryptographic challenge and nonce parameters.
POST https://LUNAIPADDRESS:PORT/auth/login/basic {"challengeResponse": "{challenge_response}"}The server responds with return code
204
if successful, and 401
in case of authentication failure.