@startuml title Extended Process of AppBase of GateToken participant ErpFrontend as front_api participant ErpBackendAPI as back_api database MemoryDB as memory_db participant SsoFrontAPi as sso_front_api participant SsoBackAPI as sso_back_api database SsoDB as sso_db autonumber note over front_api #FCC873 .env.dabory file ClientId CleintSecret BeforeBase64 end note front_api->back_api: Request /gate-token-get note over back_api #73EDFC Go to 10. Decrypt BB64 with KeyPair if LocalKeyPair end note note over back_api #73EDFC GateToken/BackAPI Url Get Skip to 7.Request GateToken To DaborySSO Backend unlessf they are not in Memory Array end note back_api->sso_front_api: Request \n/dabory-app/gate-token-get\n with BB64 of DaborySSO \nwhich is in conf file sso_front_api->sso_back_api: Request \n/gate-token-get with BB64 sso_back_api->sso_back_api: Get Local KeyPair \n & Decrypt BB64 sso_back_api->sso_front_api: Return GateToken from Sso /'6'/ sso_front_api->back_api: Response \nGateToken/BackApiUri \n from Sso to Backend note over back_api #99FF99: Keep GateToken/BackApiUri in array back_api->sso_back_api: Request /key-pair-get with ClientId to DaborySSO Backend sso_back_api->sso_db: Get key-pair-get \n with ClientId from SsoDb sso_db->sso_back_api: Return key-pair-get \n with ClientId from SsoDb sso_back_api->back_api: Response KeyPair from Sso to Backend note over back_api 1.Decrypt BB64 with KeyPair end note back_api->memory_db: save GateToken/Base \n into MemoryDB back_api->front_api: Response GateToken front_api->front_api: keep GateToken in Front Session note over front_api #FCC873 if GateToken Lost or Expired Show 505 Error Page & Go back to 1. Request /gate-token-get end note @enduml