Skip to content

Secure Storage

Andy Johns edited this page Jul 28, 2017 · 5 revisions

Description: Secure Storage Service

Allows storage and retrieval of data that is persistent in an encrypted state, and optionally requires authentication to retrieve.

Save Data to storage

Method: POST

URL: http://pmapi/secstorage

Input:
JSON Dictionary containing elements:

  • key : Key string used to retrieve value
  • value : Value string to store
  • promptToRead : Optional string. If provided, the value stored will not be retrievable without providing authentication. This prompt will appear in the authentication UI.

Output:
201 - storage successful
400 - Invalid request, usually incorrect JSON
500 - Unable to store value. This can happen if you provided promptToRead on device that does not support authentication.


Method: GET

URL: http://pmapi/secstorage/{key}?prompt={override%20prompt}

Input:
If prompt query string is provided, this prompt will override the promptToRead text used when the key/value was stored. If no promptToRead value was used, this is ignored.

Output:
200 - retrieval successful. Body of response will be JSON dictionary containing a single element with a key of "value" whose value is the stored data.
404 - Either key was not found in the secure storage, or the authentication failed.


Method: DELETE

URL: http://pmapi/secstorage

Notes: User must be Authenticated online. All keys in the chain for the application will be deleted, and the running hybrid webapp will be restarted.

Output: If user is not authenticated online, status code 403, Forbidden. If the user is authenticated, status code 200, and the webapp will restart requiring the user to re-authenticate.

Clone this wiki locally