GET V1 ems/userTokens/publicKey

Gets the modulus and exponent of an RSA-generated public key as base64-encoded strings for encrypting passwords.

Request Information

Example Request

To get the public key for this server, make the following API call: GET /ems/userTokens/publicKey

Request Detail

This public key is used to encrypt the domain password that is sent to the API when requesting a user token using this API call. Encryption should be done using an RSA algorithm. C# consumers should use the System.Security.Cryptography.RSACryptoServiceProvider class to generate their encrypted passwords.

DO NOT STORE THIS PUBLIC KEY. The public key is discarded whenever the web application is restarted, and will become invalid at this time. Consumers of the API should always call this method before encrypting passwords.

Response Information

HTTP Status Codes

Status CodeMeaning
200 (OK) The request has completed successfully. The public key information was returned in the message body. (see below).

Response Body Formats

application/json, text/json

Sample:
{
  "Modulus": "QWERTYUIOPASDFGHJKLZXCVBNM1234567890",
  "Exponent": "ABCD"
}

application/xml, text/xml

Sample:
<PublicKey xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Unilever.Urdps.Hts.EmsApi.EntityRepresentations.EMS.V1">
  <Exponent>ABCD</Exponent>
  <Modulus>QWERTYUIOPASDFGHJKLZXCVBNM1234567890</Modulus>
</PublicKey>