angularjs - Solution to replace clear text with encrypted form in request and response payload at rest -


i apologize horrible title. not think of better. best in explaining question here.

i have existing rest api endpoints work clear id fields, taskid, userid, profileid, etc. writing angularjs based front-end, call these existing api endpoints get/post data. e.g. once user logins, api endpoint used validation login information, returns userid (unique identifier of logged-in user) in response. next, userid came last call's response used fetch list of tasks (each identified uniquely taskid) associated user. , futrther, taskid used fetch task details.

in above communication, ids - userid, taskid on client side in clear. want implement solution without changing apis, can replace clear ids encrypted tokens:

  1. user logins username/password. api returns user object userid , other ids in object encrypted. so, there response transformer encrypts pre-defined id fields before response sent client
  2. now, frontend component use encrypted id further calls. calls api /myapi/tasks/user/{encrypteduserid} tasks user.
  3. there filter on server, intercepts api requests , decrypts pre-defined id fields before passing request real api method.

my questions:

  1. is there open source api/framework available, can leverage implement solution?
  2. is there different/better way achieve same goals trying achieve solution?
  3. any reference implementation can refer implementing request interceptor , response transformer, encrypts/decrypts pre-defined id fields depending upon object being transmitted?

any inputs/suggestions/comments welcome , appreciated. please let me know if guys think question/topic belong elsewhere.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -