SSO keys setup

Updated 5 months ago by Jane

Install OpenSSL

Generate Keys

Open Terminal (Linux/Unix/MacOS) or Command Prompt/PowerShell (Windows) and run 2 commands below in the same directory/folder:

  • Generate Public Key:
openssl genrsa -out private.pem 2048

(The generated private key is stored in private.pem file)

  • Generate Private Key:
openssl rsa -in private.pem -pubout -out public.pem

(The generated public key is stored in public.pem file)

API to upload Public Key to server

Special character ‘\n’ in public key have to be removed before paste into Request Body.
{

"publicKey": "<public key>"

}
  • Request Example by Postman
POST /auth/private/v1/sso/configs HTTP/1.1

Host: apigateway-public.hoiio.com

Content-Type: application/json

x-credential-api-key: b2b93596d95bxxxxxx8a6ca774ec41c

cache-control: no-cache

{

"publicKey": "-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1JnL9hMphj1xJRqJMXIDmZvG3VCiFYlwc5eW00CBrIL1+E4X5VGqpZmQWlHcSoy3T0a0gkAHxoy6n0r/ECesRyR2SOJ5/u2XDKhPbttgF4rr2usXpmcBwEVtPCeVbK/VsxM9tvgfzr7fMInonb1yBIakS0hqdsfAGWp1obenH6ZnFO7xviPLvCxdgSAi8wsPMMwNZEpvAC4KsTCEApSnWBRXhsqixzAlwda5jToobRw4192ayeVdCGVFuAK3TrF39PeizhPCwGLSCENpcdPeIiUAj19UHtqEzqnZBwKvFjLHWKXBta6EpGt3rb67g4M/GsNiXrUU+TL6e7iHK2RpQIDAQAB-----END PUBLIC KEY-----"

}
  • Response Status: HTTP200/OK
  • Response Body: None

API to retrieve public key

{

    "publicKey": "-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr/LyYZaLB2Hf2D9W9xjU29c3o9jHZOqI4DHAtPVrJEaX4XX4rTLRWnaGBU6Z9LHKqSyRgGvmLKAN9jjecwDfzn1VQOdofdrDn/FiOtQHauNKqnc+xo0zIjHm2BVaqroXfWOmoMT/dKWcyLHdmpQoHiF+OR4eNgAh8lwxpQH7jze3df6mUya5FHH+jj8CtjFmluHp+jvgQhx1/c4EPJGizi62wyQZMiI2pDBli66V3YOHBsgRkEtEYl4HAaz7heq6IzUdKIsvC4l4VDVItpQ/raBxq3xqVWqezj43TNZpQ5oksJZWWZfAfEOf3g/dOglc+vXXjhW2E7JsKOrbNDeuvQIDAQAB-----END PUBLIC KEY-----",

    "createdOn": "06-09-2019"

}

API to delete Public Key

Deleting a public key would disable SSO function. Make sure you create a new pair of keys and upload the new key to the server as soon as possible for the SSO to work.


How did we do?


Powered by HelpDocs

Powered by HelpDocs