provider-reciever-js-service.uml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. title "How to Create GateToken for Api23 Service (Frontend and Backend are abbreviated in 'Server')"
  2. boundary ReceiverAppOrJs as rec_page
  3. boundary Api23Service as api23
  4. entity ProvBackend as prov_back
  5. database ProvDB as prov_db
  6. database MemoryDB as bunt_db
  7. entity SsoServer as sso_svr
  8. autonumber
  9. rec_page->api23: request /api23-js\n( Api23Key, RecUrl )\n @HtmHeader, \n Json @htmBody
  10. activate api23
  11. api23->prov_back: request /gate-token-get-api23hash
  12. activate prov_back
  13. prov_back->prov_back: extract Api23Hash<-Api23Key
  14. bunt_db->prov_back: get GateToken %Api23Hash
  15. prov_back->api23: response gate-token or 505
  16. deactivate prov_back
  17. note over api23: [if exists] jump GateToken@Api65Hash addr
  18. api23->api23: get ClientId@SysVars, \nReferer@HtmHeader
  19. api23->prov_back: request\n/gate-token-get \nwith ClientId, BB64 in json & \n(Referer, Api23Key)@htmHeader
  20. activate prov_back
  21. prov_back->sso_svr: request /key-pair-get %ClientID
  22. activate sso_svr
  23. sso_svr->prov_back: respond KeyPair
  24. deactivate sso_svr
  25. prov_db->prov_back: get Api23eKeyPair@setup table
  26. prov_back->prov_back: decrypt Api23KeyPair \n $Api23eKeyPair, KeyPair
  27. prov_back->prov_back: decrypt Api23Key %Api23KeyPair \n #(ClientId, RecUrl, SsoSubId)
  28. note over prov_back
  29. [if not]
  30. ClientId@HtmHeader = ClientId
  31. Referer@HtmHeader = RecUrl
  32. (app does NOT have the referer)
  33. end note
  34. prov_back->api23: fail
  35. prov_back->prov_back: get GateToken, GTB # BB23, KeyPair
  36. prov_back->bunt_db: save GateTokenInfo@GateToken
  37. note over prov_back: [if receiver_type=js]
  38. prov_back->bunt_db: save GateToken@Api23Hash
  39. prov_back->api23: response OK \nwithout json data
  40. note over prov_back: [else if receiver_type= web or app]
  41. prov_back->api23: response OK \nwith GateToken
  42. api23->rec_page: response OK \nwith GateToken
  43. note over prov_back: [end if]
  44. deactivate prov_back
  45. deactivate api23
  46. note over api23: Jump: GateToken@Api65Hash addr
  47. api23->api23: insert GateToken &\n Referer in Htm Header
  48. api23->prov_back: request regular Dabory API
  49. activate prov_back
  50. prov_back->api23: response Dabory API result
  51. deactivate prov_back
  52. api23->rec_page: response Js API result
  53. deactivate api23